[Winpt-commits] r372 - trunk/Src
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Dec 9 11:59:19 CET 2011
Author: twoaday
Date: 2011-12-09 11:59:16 +0100 (Fri, 09 Dec 2011)
New Revision: 372
Modified:
trunk/Src/ChangeLog
trunk/Src/wptNLS.cpp
Log:
2011-12-09 Timo Schulz <twoaday at gmx.net>
* wptNLS.cpp (gettext_set_user_domain): Changed return type to
void.
Modified: trunk/Src/ChangeLog
===================================================================
--- trunk/Src/ChangeLog 2011-12-09 10:24:15 UTC (rev 371)
+++ trunk/Src/ChangeLog 2011-12-09 10:59:16 UTC (rev 372)
@@ -1,3 +1,8 @@
+2011-12-09 Timo Schulz <twoaday at gmx.net>
+
+ * wptNLS.cpp (gettext_set_user_domain): Changed return type to
+ void.
+
2011-12-06 Timo Schulz <twoaday at gmx.net>
* wptNLS.cpp (get_user_langid): Removed.
Modified: trunk/Src/wptNLS.cpp
===================================================================
--- trunk/Src/wptNLS.cpp 2011-12-09 10:24:15 UTC (rev 371)
+++ trunk/Src/wptNLS.cpp 2011-12-09 10:59:16 UTC (rev 372)
@@ -64,8 +64,11 @@
};
struct loaded_domain_s {
+ /* Full file name to the MO file */
char *file_name;
+ /* Last modification date of the MO file */
time_t modify_time;
+
char *data;
int must_swap;
DWORD nstrings;
@@ -172,8 +175,7 @@
} while (to_read > 0);
fclose (fp);
- /* Using the magic number we can test whether it really is a message
- * catalog file. */
+ /* Using the magic number we can test whether it really is a message catalog file. */
if (data->magic != MAGIC && data->magic != MAGIC_SWAPPED) {
/* The magic number is wrong: not a message catalog file. */
free (data);
@@ -229,7 +231,7 @@
size_t pos = strlen (buf);
while (pos > 0 && buf[--pos] != '\\')
;
- buf[pos+1] = '\0';
+ buf[pos + 1] = '\0';
return buf;
}
@@ -241,17 +243,16 @@
get_locale_name (const char *file)
{
const char *lang = gettext_get_langid ();
- char *name, *ext;
- char *p, buf[MAX_PATH+1];
+ char buf[MAX_PATH+1];
- p = strrchr (file, '.');
+ char *p = strrchr (file, '.');
if (p == NULL) {
p = new char[strlen(file)+strlen(lang)+2+1];
sprintf (p, "%s.%s", file, lang);
return p;
}
- name = substr (file, 0, p - file);
- ext = substr (file, p - file + 1, strlen(file));
+ char *name = substr (file, 0, p - file);
+ char *ext = substr (file, p - file + 1, strlen(file));
p = get_module_dir (buf, MAX_PATH);
if (!p)
BUG (NULL);
@@ -318,11 +319,11 @@
/* Try to load the user domain, either from
the WinPT.exe directory or from the registry */
-int
+void
gettext_set_user_domain (void)
{
if (!gettext_is_required ())
- return 0;
+ return;
gettext_domain_t domain = NULL;
char *file = get_locale_name ("winpt.mo");
@@ -332,7 +333,6 @@
domain = load_modir_domain ();
free_if_alloc (file);
gettext_update_domain (domain);
- return 0;
}
More information about the Winpt-commits
mailing list