Fix signedness warnings in gio/ginputstream.c

gio/ginputstream.c: In function ‘g_input_stream_real_skip’:
gio/ginputstream.c:431:21: warning: comparison of integer expressions of
different signedness: ‘goffset’ {aka ‘long int’} and ‘long unsigned int’
  431 |           if (start > G_MAXSIZE - count || start + count > end)
      |                     ^
gio/ginputstream.c:431:58: warning: comparison of integer expressions of
different signedness: ‘long unsigned int’ and ‘goffset’ {aka ‘long int’}
  431 |           if (start > G_MAXSIZE - count || start + count > end)
      |                                                          ^
This commit is contained in:
Emmanuel Fleury 2021-04-15 10:51:33 +02:00
parent 7a50c3184d
commit f2be8c74e5

View File

@ -427,8 +427,10 @@ g_input_stream_real_skip (GInputStream *stream,
NULL))
{
end = g_seekable_tell (seekable);
g_assert (start >= 0);
g_assert (end >= start);
if (start > G_MAXSIZE - count || start + count > end)
if ((guint64) start > (G_MAXSIZE - count) ||
(start + count) > (guint64) end)
{
stream->priv->pending = TRUE;
return end - start;