* coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 5 Apr 2011 06:24:54 +0000 (23:24 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 5 Apr 2011 06:24:54 +0000 (23:24 -0700)
This avoids several warnings with gcc -Wstrict-overflow.

src/ChangeLog
src/coding.c

index d489dcd..4e33ccb 100644 (file)
@@ -1,5 +1,8 @@
 2011-04-05  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
+       This avoids several warnings with gcc -Wstrict-overflow.
+
        * xfont.c (xfont_text_extents): Remove var that was set but not used.
        (xfont_open): Avoid unnecessary tests.
 
index b7e8154..6e5d065 100644 (file)
@@ -753,7 +753,7 @@ static struct coding_system coding_categories[coding_category_max];
     produced_chars++;                  \
     if (multibytep)                    \
       {                                        \
-       int ch = (c);                   \
+       unsigned ch = (c);              \
        if (ch >= 0x80)                 \
          ch = BYTE8_TO_CHAR (ch);      \
        CHAR_STRING_ADVANCE (ch, dst);  \
@@ -770,7 +770,7 @@ static struct coding_system coding_categories[coding_category_max];
     produced_chars += 2;               \
     if (multibytep)                    \
       {                                        \
-       int ch;                         \
+       unsigned ch;                    \
                                        \
        ch = (c1);                      \
        if (ch >= 0x80)                 \