[glib: 5/8] Fix signedness warning in glib/win_iconv.c




commit d16d780bf41f85c5c873f8c310947962c037fa05
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Fri May 14 12:47:24 2021 +0200

    Fix signedness warning in glib/win_iconv.c
    
    glib/win_iconv.c: In function 'iso2022jp_mbtowc':
    glib/win_iconv.c:1818:18: warning: comparison of integer expressions of different signedness: 'DWORD' 
{aka 'long unsigned int'} and 'int'
         if (cv->mode != ISO2022_MODE(cs, shift))
                      ^~
    glib/win_iconv.c: In function 'iso2022jp_wctomb':
    glib/win_iconv.c:1889:18: warning: comparison of integer expressions of different signedness: 'DWORD' 
{aka 'long unsigned int'} and 'int'
         if (cv->mode == ISO2022_MODE(cs, shift))
                      ^~

 glib/win_iconv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/win_iconv.c b/glib/win_iconv.c
index 605e5f08d..cc2ce53b6 100644
--- a/glib/win_iconv.c
+++ b/glib/win_iconv.c
@@ -1680,7 +1680,7 @@ utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize)
  * Use MLang instead.
  */
 
-#define ISO2022_MODE(cs, shift) (((cs) << 8) | (shift))
+#define ISO2022_MODE(cs, shift) ((((DWORD) cs) << 8) | (shift))
 #define ISO2022_MODE_CS(mode) (((mode) >> 8) & 0xFF)
 #define ISO2022_MODE_SHIFT(mode) ((mode) & 0xFF)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]