[glib: 1/6] Fix signedness warning in gio/gfileinfo.c:g_file_info_remove_attribute()




commit dd995ca54baf820974ef2f4f9184f5c09264d143
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Mon Nov 16 21:06:49 2020 +0100

    Fix signedness warning in gio/gfileinfo.c:g_file_info_remove_attribute()
    
    gio/gfileinfo.c: In function ‘g_file_info_remove_attribute’:
    gio/gfileinfo.c:706:9: error: comparison of integer expressions of different signedness: ‘int’ and 
‘guint’ {aka ‘unsigned int’}
      706 |   if (i < info->attributes->len &&
          |         ^
    
    Fix signedness warning in gio/gfileinfo.c:g_file_info_create_value()
    
    gio/gfileinfo.c: In function ‘g_file_info_create_value’:
    gio/gfileinfo.c:1084:9: error: comparison of integer expressions of different signedness: ‘int’ and 
‘guint’ {aka ‘unsigned int’}
     1084 |   if (i < info->attributes->len &&
          |         ^
    
    Fix signedness warning in gio/gfileinfo.c:matcher_matches_id()
    
    gio/gfileinfo.c: In function ‘matcher_matches_id’:
    gio/gfileinfo.c:2624:21: error: comparison of integer expressions of different signedness: ‘int’ and 
‘guint’ {aka ‘unsigned int’}
     2624 |       for (i = 0; i < matcher->sub_matchers->len; i++)
          |                     ^
    
    Fix signedness warnings in gio/gfileinfo.c:g_file_attribute_matcher_enumerate_namespace()
    
    gio/gfileinfo.c: In function ‘g_file_attribute_matcher_enumerate_namespace’:
    gio/gfileinfo.c:2713:21: error: comparison of integer expressions of different signedness: ‘int’ and 
‘guint’ {aka ‘unsigned int’}
     2713 |       for (i = 0; i < matcher->sub_matchers->len; i++)
          |                     ^
    gio/gfileinfo.c:2715:27: error: comparison of integer expressions of different signedness: ‘guint32’ {aka 
‘unsigned int’} and ‘int’
     2715 |    if (sub_matchers[i].id == ns_id)
          |                           ^~
    
    Fix signedness warning in gio/gfileinfo.c:g_file_attribute_matcher_enumerate_next()
    
    gio/gfileinfo.c: In function ‘g_file_attribute_matcher_enumerate_next’:
    ../glib.git/gio/gfileinfo.c:2752:13: error: comparison of integer expressions of different signedness: 
‘int’ and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
     2752 |       if (i < matcher->sub_matchers->len)
          |             ^

 gio/gfileinfo.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gio/gfileinfo.c b/gio/gfileinfo.c
index bbe393eed..42cdc7a5d 100644
--- a/gio/gfileinfo.c
+++ b/gio/gfileinfo.c
@@ -694,7 +694,7 @@ g_file_info_remove_attribute (GFileInfo  *info,
 {
   guint32 attr_id;
   GFileAttribute *attrs;
-  int i;
+  guint i;
 
   g_return_if_fail (G_IS_FILE_INFO (info));
   g_return_if_fail (attribute != NULL && *attribute != '\0');
@@ -1075,7 +1075,7 @@ g_file_info_create_value (GFileInfo *info,
                          guint32 attr_id)
 {
   GFileAttribute *attrs;
-  int i;
+  guint i;
 
   if (info->mask != NO_ATTRIBUTE_MASK &&
       !_g_file_attribute_matcher_matches_id (info->mask, attr_id))
@@ -2619,7 +2619,7 @@ matcher_matches_id (GFileAttributeMatcher *matcher,
                     guint32                id)
 {
   SubMatcher *sub_matchers;
-  int i;
+  guint i;
 
   if (matcher->sub_matchers)
     {
@@ -2696,8 +2696,8 @@ g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
                                              const char            *ns)
 {
   SubMatcher *sub_matchers;
-  int ns_id;
-  int i;
+  guint ns_id;
+  guint i;
 
   g_return_val_if_fail (ns != NULL && *ns != '\0', FALSE);
 
@@ -2738,7 +2738,7 @@ g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
 const char *
 g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher)
 {
-  int i;
+  guint i;
   SubMatcher *sub_matcher;
 
   /* We return a NULL matcher for an empty match string, so handle this */


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