[glib: 2/9] Fix signedness warning in gio/tests/readwrite.c




commit 4ad62f7fab017e3562256d82971ab9fdf13fb81b
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Fri Nov 20 20:29:28 2020 +0100

    Fix signedness warning in gio/tests/readwrite.c
    
    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),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]