From 4ad62f7fab017e3562256d82971ab9fdf13fb81b Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Fri, 20 Nov 2020 20:29:28 +0100 Subject: [PATCH] Fix signedness warning in gio/tests/readwrite.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gio/tests/readwrite.c: In function ‘verify_iostream’: gio/tests/readwrite.c:77:17: error: comparison of integer expressions of different signedness: ‘gboolean’ {aka ‘int’} and ‘size_t’ {aka ‘long unsigned int’} 77 | g_assert (res == strlen (original_data) - 15); | ^~ --- gio/tests/readwrite.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gio/tests/readwrite.c b/gio/tests/readwrite.c index 2aa925b30..7551e5384 100644 --- a/gio/tests/readwrite.c +++ b/gio/tests/readwrite.c @@ -32,6 +32,7 @@ static void verify_iostream (GFileIOStream *file_iostream) { gboolean res; + gssize skipped; GIOStream *iostream; GError *error; GInputStream *in; @@ -73,8 +74,9 @@ verify_iostream (GFileIOStream *file_iostream) g_assert (res == 5); verify_pos (iostream, 15); - res = g_input_stream_skip (in, 10000, NULL, NULL); - g_assert (res == strlen (original_data) - 15); + skipped = g_input_stream_skip (in, 10000, NULL, NULL); + g_assert_cmpint (skipped, >=, 0); + g_assert ((gsize) skipped == strlen (original_data) - 15); verify_pos (iostream, strlen (original_data)); res = g_seekable_seek (G_SEEKABLE (iostream),