Fixing signedness warning in glib/gfileutils.c

glib/gfileutils.c: In function ‘write_to_file’:
glib/gfileutils.c:1176:19: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
 1176 |       g_assert (s <= length);
      |                   ^~
glib/gmacros.h:939:25: note: in definition of macro ‘G_LIKELY’
  939 | #define G_LIKELY(expr) (expr)
      |                         ^~~~
glib/gfileutils.c:1176:7: note: in expansion of macro ‘g_assert’
 1176 |       g_assert (s <= length);
      |       ^~~~~~~~

Related to issue #1735 (Get back to a -werror build)
This commit is contained in:
Emmanuel Fleury 2020-08-27 14:26:20 +02:00 committed by Sebastian Dröge
parent 9674d14175
commit 856265fe66

View File

@ -1173,7 +1173,7 @@ write_to_file (const gchar *contents,
return FALSE;
}
g_assert (s <= length);
g_assert ((gsize) s <= length);
contents += s;
length -= s;