This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

warning in JOHAB converter



This fixes a gcc warning:

../iconv/loop.c: In function `from_johab':
../iconv/loop.c:282: warning: comparison between signed and unsigned
../iconv/loop.c:282: warning: comparison between signed and unsigned
../iconv/loop.c:282: warning: comparison between signed and unsigned
../iconv/loop.c: In function `from_johab_single':
../iconv/loop.c:384: warning: comparison between signed and unsigned
../iconv/loop.c:384: warning: comparison between signed and unsigned
../iconv/loop.c:384: warning: comparison between signed and unsigned


2002-04-20  Bruno Haible  <bruno@clisp.org>

	* iconvdata/johab.c (BODY for FROM_LOOP): Change type of i, m, f,
	to avoid gcc warning.

--- glibc-20020408/iconvdata/johab.c.bak	2001-08-15 21:39:08.000000000 +0200
+++ glibc-20020408/iconvdata/johab.c	2002-04-21 03:21:28.000000000 +0200
@@ -215,15 +215,15 @@
 	    if (__builtin_expect (ch <= 0xd3, 1))			      \
 	      {								      \
 		/* Hangul */						      \
-		uint_fast32_t i, m, f;					      \
+		int_fast32_t i, m, f;					      \
 									      \
 		i = init[(idx & 0x7c00) >> 10];				      \
 		m = mid[(idx & 0x03e0) >> 5];				      \
 		f = final[idx & 0x001f];				      \
 									      \
-		if (__builtin_expect (i, 0) == -1			      \
-		    || __builtin_expect (m, 0) == -1			      \
-		    || __builtin_expect (f, 0) == -1)			      \
+		if (__builtin_expect (i == -1, 0)			      \
+		    || __builtin_expect (m == -1, 0)			      \
+		    || __builtin_expect (f == -1, 0))			      \
 		  {							      \
 		    /* This is illegal.  */				      \
 		    if (! ignore_errors_p ())				      \
@@ -243,7 +243,7 @@
 		  ch = init_to_ucs[i - 1];				      \
 		else if (i == 0 && m > 0 && f == 0)			      \
 		  ch = 0x314e + m;	/* 0x314f + m - 1 */		      \
-		else if (__builtin_expect (i | m, 0) == 0		      \
+		else if (__builtin_expect ((i | m) == 0, 1)		      \
 			 && __builtin_expect (f > 0, 1))		      \
 		  ch = final_to_ucs[f - 1];	/* round trip?? */	      \
 		else							      \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]