summaryrefslogtreecommitdiffstats
path: root/gettext-tools/src/write-java.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2009-08-10 10:08:21 +0200
committerBruno Haible <bruno@clisp.org>2009-08-10 15:19:33 +0200
commit1a6abceb69f19fc4a949a8ee629c35a94a2e4692 (patch)
tree6d7068f00640a03b98eb97a2ebae6eef9a605ec6 /gettext-tools/src/write-java.c
parentde9c49f23c81890afddf773d32795da51d64298f (diff)
downloadexternal_gettext-1a6abceb69f19fc4a949a8ee629c35a94a2e4692.zip
external_gettext-1a6abceb69f19fc4a949a8ee629c35a94a2e4692.tar.gz
external_gettext-1a6abceb69f19fc4a949a8ee629c35a94a2e4692.tar.bz2
Use type 'ucs4_t' more often. Avoids gcc warnings on Cygwin.
Diffstat (limited to 'gettext-tools/src/write-java.c')
-rw-r--r--gettext-tools/src/write-java.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gettext-tools/src/write-java.c b/gettext-tools/src/write-java.c
index 370c235..d6c7614 100644
--- a/gettext-tools/src/write-java.c
+++ b/gettext-tools/src/write-java.c
@@ -117,7 +117,7 @@ string_hashcode (const char *str)
int hash = 0;
while (str < str_limit)
{
- unsigned int uc;
+ ucs4_t uc;
str += u8_mbtouc (&uc, (const unsigned char *) str, str_limit - str);
if (uc < 0x10000)
/* Single UCS-2 'char'. */
@@ -125,8 +125,8 @@ string_hashcode (const char *str)
else
{
/* UTF-16 surrogate: two 'char's. */
- unsigned int uc1 = 0xd800 + ((uc - 0x10000) >> 10);
- unsigned int uc2 = 0xdc00 + ((uc - 0x10000) & 0x3ff);
+ ucs4_t uc1 = 0xd800 + ((uc - 0x10000) >> 10);
+ ucs4_t uc2 = 0xdc00 + ((uc - 0x10000) & 0x3ff);
hash = 31 * hash + uc1;
hash = 31 * hash + uc2;
}
@@ -361,7 +361,7 @@ write_java_string (FILE *stream, const char *str)
fprintf (stream, "\"");
while (str < str_limit)
{
- unsigned int uc;
+ ucs4_t uc;
str += u8_mbtouc (&uc, (const unsigned char *) str, str_limit - str);
if (uc < 0x10000)
{
@@ -375,7 +375,7 @@ write_java_string (FILE *stream, const char *str)
else if (uc == 0x005c)
fprintf (stream, "\\\\");
else if (uc >= 0x0020 && uc < 0x007f)
- fprintf (stream, "%c", uc);
+ fprintf (stream, "%c", (int) uc);
else
fprintf (stream, "\\u%c%c%c%c",
hexdigit[(uc >> 12) & 0x0f], hexdigit[(uc >> 8) & 0x0f],
@@ -384,8 +384,8 @@ write_java_string (FILE *stream, const char *str)
else
{
/* UTF-16 surrogate: two 'char's. */
- unsigned int uc1 = 0xd800 + ((uc - 0x10000) >> 10);
- unsigned int uc2 = 0xdc00 + ((uc - 0x10000) & 0x3ff);
+ ucs4_t uc1 = 0xd800 + ((uc - 0x10000) >> 10);
+ ucs4_t uc2 = 0xdc00 + ((uc - 0x10000) & 0x3ff);
fprintf (stream, "\\u%c%c%c%c",
hexdigit[(uc1 >> 12) & 0x0f], hexdigit[(uc1 >> 8) & 0x0f],
hexdigit[(uc1 >> 4) & 0x0f], hexdigit[uc1 & 0x0f]);