From f2be8c74e547984b6dae3b3794e17ad37afbe056 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Thu, 15 Apr 2021 10:51:33 +0200 Subject: [PATCH] Fix signedness warnings in gio/ginputstream.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) | ^ --- gio/ginputstream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gio/ginputstream.c b/gio/ginputstream.c index 9330169dc..a40c7d9c4 100644 --- a/gio/ginputstream.c +++ b/gio/ginputstream.c @@ -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;