[polari/wip/fmuellner/more-warnings: 1/3] main: Fix signedness error



commit 111f9903eecfef90cea9be7f8db3b83469f1d69c
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Mar 6 01:49:05 2019 +0100

    main: Fix signedness error
    
    The G_N_ELEMENTS() macro is implemented with sizeof, which yields
    a value of (the unsigned) type size_t. It is always better to use
    types with matching signedness in comparisons instead of relying
    on integer promotion, so make the corresponding variables unsigned
    as well.
    
    https://gitlab.gnome.org/GNOME/polari/merge_requests/99

 src/polari.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/polari.c b/src/polari.c
index 9804f5e..e9d2837 100644
--- a/src/polari.c
+++ b/src/polari.c
@@ -21,8 +21,8 @@ get_js_argv (int argc, const char * const *argv)
     NULL
   };
   char **strv;
-  int js_argc = argc - 1; // gjs doesn't do argv[0]
-  int i;
+  guint js_argc = argc - 1; // gjs doesn't do argv[0]
+  guint i;
 
   strv = g_new0 (char *, js_argc + G_N_ELEMENTS (injected_args) + 1);
   for (i = 0; i < js_argc; i++)


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