[glib: 5/7] Fix signedness warning in gio/ginputstream.c




commit dea0ec3df61f93a21479741a7cd4b7fc88261cfb
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Thu Nov 4 22:05:30 2021 +0100

    Fix signedness warning in gio/ginputstream.c
    
    gio/ginputstream.c: In function 'g_input_stream_real_skip':
    gio/ginputstream.c:433:31: error: comparison of integer expressions of different signedness: 'goffset' 
{aka 'long long int'} and 'long long unsigned int'
      433 |               (start + count) > (guint64) end)
          |                               ^

 gio/ginputstream.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/ginputstream.c b/gio/ginputstream.c
index a40c7d9c4..8fda2693c 100644
--- a/gio/ginputstream.c
+++ b/gio/ginputstream.c
@@ -429,8 +429,8 @@ g_input_stream_real_skip (GInputStream  *stream,
           end = g_seekable_tell (seekable);
           g_assert (start >= 0);
           g_assert (end >= start);
-          if ((guint64) start > (G_MAXSIZE - count) ||
-              (start + count) > (guint64) end)
+          if (start > (goffset) (G_MAXOFFSET - count) ||
+              (goffset) (start + count) > end)
             {
               stream->priv->pending = TRUE;
               return end - start;


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