[glib: 7/8] Fix signedness warning in gio/gmemoryoutputstream.c




commit 0dde9f37446887dfda71a11da08402f3cd3c43da
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Wed Nov 18 19:36:21 2020 +0100

    Fix signedness warning in gio/gmemoryoutputstream.c
    
    gio/gmemoryoutputstream.c: In function ‘g_memory_output_stream_seek’:
    gio/gmemoryoutputstream.c:792:44: error: comparison of integer expressions of different signedness: 
‘goffset’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’}
      792 |   if (priv->realloc_fn == NULL && absolute > priv->len)
          |                                            ^

 gio/gmemoryoutputstream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/gmemoryoutputstream.c b/gio/gmemoryoutputstream.c
index de8babfa5..b120ccedc 100644
--- a/gio/gmemoryoutputstream.c
+++ b/gio/gmemoryoutputstream.c
@@ -789,7 +789,7 @@ g_memory_output_stream_seek (GSeekable    *seekable,
    * stream is valid (eg: a 1-byte fixed sized stream can have position
    * 0 or 1).  Therefore '>' is what we want.
    * */
-  if (priv->realloc_fn == NULL && absolute > priv->len)
+  if (priv->realloc_fn == NULL && (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]