[glib: 7/8] Fix signedness warnings in glib/gstdio.c




commit 928be8b8bc4a38107b8f2fdda7f069a28ac2eb50
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Fri May 14 13:31:26 2021 +0200

    Fix signedness warnings in glib/gstdio.c
    
    glib/gstdio.c: In function '_g_win32_stat_utf8':
    glib/gstdio.c:763:45: warning: comparison of integer expressions of different signedness: 'gsize' {aka 
'long long unsigned int'} and 'long long int'
           (g_path_is_absolute (filename) && len <= g_path_skip_root (filename) - filename))
                                                 ^~
    glib/gstdio.c: In function 'g_win32_readlink_utf8':
    glib/gstdio.c:896:15: warning: comparison of integer expressions of different signedness: 'glong' {aka 
'long int'} and 'gsize' {aka 'long long unsigned int'}
       if (tmp_len > buf_size)
                   ^

 glib/gstdio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glib/gstdio.c b/glib/gstdio.c
index c04b6c28c..45180eba8 100644
--- a/glib/gstdio.c
+++ b/glib/gstdio.c
@@ -760,7 +760,7 @@ _g_win32_stat_utf8 (const gchar       *filename,
     len--;
 
   if (len <= 0 ||
-      (g_path_is_absolute (filename) && len <= g_path_skip_root (filename) - filename))
+      (g_path_is_absolute (filename) && len <= (gsize) (g_path_skip_root (filename) - filename)))
     len = strlen (filename);
 
   wfilename = g_utf8_to_utf16 (filename, len, NULL, NULL, NULL);
@@ -893,7 +893,7 @@ g_win32_readlink_utf8 (const gchar  *filename,
       return tmp_len;
     }
 
-  if (tmp_len > buf_size)
+  if ((gsize) tmp_len > buf_size)
     tmp_len = buf_size;
 
   memcpy (buf, tmp, tmp_len);


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