[glib: 6/11] Fix signedness warning in gio/gmemoryinputstream.c:g_memory_input_stream_seek()




commit de5e43dc950d74abb200200ce493d163ad5c49fe
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Tue Nov 17 01:01:41 2020 +0100

    Fix signedness warning in gio/gmemoryinputstream.c:g_memory_input_stream_seek()
    
    gio/gmemoryinputstream.c: In function ‘g_memory_input_stream_seek’:
    gio/gmemoryinputstream.c:479:32: error: comparison of integer expressions of different signedness: 
‘goffset’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’}
      479 |   if (absolute < 0 || absolute > priv->len)
          |                                ^

 gio/gmemoryinputstream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/gmemoryinputstream.c b/gio/gmemoryinputstream.c
index 37846b6ac..a9e855cef 100644
--- a/gio/gmemoryinputstream.c
+++ b/gio/gmemoryinputstream.c
@@ -476,7 +476,7 @@ g_memory_input_stream_seek (GSeekable     *seekable,
       return FALSE;
     }
 
-  if (absolute < 0 || absolute > priv->len)
+  if (absolute < 0 || (gsize) absolute > priv->len)
     {
       g_set_error_literal (error,
                            G_IO_ERROR,


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