[glib: 2/10] Fixing signedness in g_ptr_array_maybe_expand():garray.c



commit 5ca8c2fa8f24655ac25a3012739d40fe7a86406b
Author: Emmanuel Fleury <emmanuel fleury u-bordeaux fr>
Date:   Sat Jan 26 12:21:23 2019 +0100

    Fixing signedness in g_ptr_array_maybe_expand():garray.c
    
    ../glib.git/glib/garray.c: In function ‘g_ptr_array_maybe_expand’:
    ../glib.git/glib/garray.c:1172:43: error: comparison of integer expressions of different signedness: 
‘unsigned int’ and ‘gint’ {aka ‘int’} [-Werror=sign-compare]
       if G_UNLIKELY ((G_MAXUINT - array->len) < len)

 glib/garray.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glib/garray.c b/glib/garray.c
index 3ef15cd5f..0e83db002 100644
--- a/glib/garray.c
+++ b/glib/garray.c
@@ -907,7 +907,7 @@ struct _GRealPtrArray
  */
 
 static void g_ptr_array_maybe_expand (GRealPtrArray *array,
-                                      gint           len);
+                                      guint          len);
 
 /**
  * g_ptr_array_new:
@@ -1166,7 +1166,7 @@ ptr_array_free (GPtrArray      *array,
 
 static void
 g_ptr_array_maybe_expand (GRealPtrArray *array,
-                          gint           len)
+                          guint          len)
 {
   /* Detect potential overflow */
   if G_UNLIKELY ((G_MAXUINT - array->len) < len)


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