mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38:54 +02:00
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) ^
This commit is contained in:
@@ -760,7 +760,7 @@ _g_win32_stat_utf8 (const gchar *filename,
|
|||||||
len--;
|
len--;
|
||||||
|
|
||||||
if (len <= 0 ||
|
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);
|
len = strlen (filename);
|
||||||
|
|
||||||
wfilename = g_utf8_to_utf16 (filename, len, NULL, NULL, NULL);
|
wfilename = g_utf8_to_utf16 (filename, len, NULL, NULL, NULL);
|
||||||
@@ -893,7 +893,7 @@ g_win32_readlink_utf8 (const gchar *filename,
|
|||||||
return tmp_len;
|
return tmp_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp_len > buf_size)
|
if ((gsize) tmp_len > buf_size)
|
||||||
tmp_len = buf_size;
|
tmp_len = buf_size;
|
||||||
|
|
||||||
memcpy (buf, tmp, tmp_len);
|
memcpy (buf, tmp, tmp_len);
|
||||||
|
Reference in New Issue
Block a user