1. 23 Dec, 2020 1 commit
    • Krzesimir Nowak's avatar
      gerror: Simplify error construction · b715e4c9
      Krzesimir Nowak authored
      Factor out the GError creation to a common function. When adding a
      support for extended error types, this will limit the number of places
      where these errors are allocated.
      b715e4c9
  2. 22 Dec, 2020 1 commit
  3. 21 Dec, 2020 6 commits
  4. 18 Dec, 2020 7 commits
    • Philip Withnall's avatar
      Merge branch 'fix_more_warnings' into 'master' · 2008cb58
      Philip Withnall authored
      Fix more warnings
      
      See merge request !1822
      2008cb58
    • Philip Withnall's avatar
      gdate: Limit length of dates which can be parsed as valid · 15634d64
      Philip Withnall authored
      
      
      Realistically any date over 200 bytes long is not going to be valid, so
      limit the input length so we can’t spend too long doing UTF-8 validation
      or normalisation.
      
      oss-fuzz#28718
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <pwithnall@endlessos.org>
      15634d64
    • Emmanuel Fleury's avatar
      Fix signedness warnings in gio/gcredentials.c:g_credentials_to_string() · e90a7913
      Emmanuel Fleury authored
      gio/gcredentials.c: In function ‘g_credentials_to_string’:
      gio/gcredentials.c:238:31: error: comparison of integer expressions of different signedness: ‘uid_t’ {aka ‘unsigned int’} and ‘int’
        238 |   if (credentials->native.uid != -1)
            |                               ^~
      gio/gcredentials.c:240:31: error: comparison of integer expressions of different signedness: ‘gid_t’ {aka ‘unsigned int’} and ‘int’
        240 |   if (credentials->native.gid != -1)
            |                               ^~
      e90a7913
    • Emmanuel Fleury's avatar
      Fix signedness warning in gio/gbufferedoutputstream.c:g_buffered_output_stream_set_buffer_size() · 477d53b2
      Emmanuel Fleury authored
      gio/gbufferedoutputstream.c: In function ‘g_buffered_output_stream_set_buffer_size’:
      glib/gmacros.h:806:26: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘goffset’ {aka ‘long int’}
        806 | #define MAX(a, b)  (((a) > (b)) ? (a) : (b))
            |                          ^
      gio/gbufferedoutputstream.c:211:14: note: in expansion of macro ‘MAX’
        211 |       size = MAX (size, priv->pos);
            |              ^~~
      
      Fix signedness warning in gio/gbufferedinputstream.c:g_buffered_input_stream_real_fill()
      
      gio/gbufferedinputstream.c: In function ‘g_buffered_input_stream_real_fill’:
      glib/gmacros.h:809:26: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’}K [-Werror=sign-compare]
        809 | #define MIN(a, b)  (((a) < (b)) ? (a) : (b))
            |                          ^
      gio/gbufferedinputstream.c:664:11: note: in expansion of macro ‘MIN’
        664 |   count = MIN (count, priv->len - in_buffer);
            |           ^~~
      gio/gbufferedinputstream.c:667:29: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘gssize’ {aka ‘long int’}
        667 |   if (priv->len - priv->end < count)
            |                             ^
      
      Fix signedness warnings in gio/gbufferedinputstream.c:g_buffered_input_stream_real_fill_async()
      
      gio/gbufferedinputstream.c: In function ‘g_buffered_input_stream_real_fill_async’:
      glib/gmacros.h:809:26: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’}
        809 | #define MIN(a, b)  (((a) < (b)) ? (a) : (b))
            |                          ^
      gio/gbufferedinputstream.c:1075:11: note: in expansion of macro ‘MIN’
       1075 |   count = MIN (count, priv->len - in_buffer);
            |           ^~~
      gio/gbufferedinputstream.c:1078:29: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘gssize’ {aka ‘long int’}
       1078 |   if (priv->len - priv->end < count)
            |                             ^
      477d53b2
    • Emmanuel Fleury's avatar
      Fix signedness warning in gio/gfileattribute.c:escape_byte_string() · 50c85523
      Emmanuel Fleury authored
      gio/gfileattribute.c: In function ‘escape_byte_string’:
      gio/gfileattribute.c:286:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’}
        286 |   for (i = 0; i < len; i++)
            |                 ^
      gio/gfileattribute.c:299:21: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’}
        299 |       for (i = 0; i < len; i++)
            |                     ^
      50c85523
    • Emmanuel Fleury's avatar
      Fix signedness warning in gio/gicon.c:g_icon_to_string_tokenized() · c150e46b
      Emmanuel Fleury authored
      gio/gicon.c: In function ‘g_icon_to_string_tokenized’:
      gio/gicon.c:165:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’}
        165 |   for (i = 0; i < tokens->len; i++)
            |                 ^
      c150e46b
    • Emmanuel Fleury's avatar
      Fix signedness warning in gio/gfileinfo.c:g_file_info_remove_attribute() · dd995ca5
      Emmanuel Fleury authored
      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)
            |             ^
      dd995ca5
  5. 17 Dec, 2020 18 commits
  6. 16 Dec, 2020 7 commits
    • Emmanuel Fleury's avatar
      Fix missing initializer warning in gio/gcancellable.c · 9025969d
      Emmanuel Fleury authored
      gio/gcancellable.c:773:1: error: missing initializer for field ‘closure_marshal’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
        773 | };
            | ^
      In file included from glib/giochannel.h:33,
                       from glib/glib.h:54,
                       from gio/gcancellable.c:22:
      glib/gmain.h:277:23: note: ‘closure_marshal’ declared here
        277 |   GSourceDummyMarshal closure_marshal; /* Really is of type GClosureMarshal */
            |                       ^~~~~~~~~~~~~~~
      9025969d
    • Emmanuel Fleury's avatar
      Fix missing initializer warning in gio/gcontextspecificgroup.c:g_context_specific_source_new() · 058dda1b
      Emmanuel Fleury authored
      gio/gcontextspecificgroup.c: In function ‘g_context_specific_source_new’:
      gio/gcontextspecificgroup.c:77:3: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
         77 |   };
            |   ^
      In file included from glib/giochannel.h:33,
                       from glib/glib.h:54,
                       from gobject/gbinding.h:28,
                       from glib/glib-object.h:22,
                       from gio/gcontextspecificgroup.h:23,
                       from gio/gcontextspecificgroup.c:22:
      glib/gmain.h:276:19: note: ‘closure_callback’ declared here
        276 |   GSourceFunc     closure_callback;
            |                   ^~~~~~~~~~~~~~~~
      058dda1b
    • Emmanuel Fleury's avatar
      Fix missing initializer warning in gobject/tests/ifaceproperties.c:base_object_get_type() · 6ca38ccd
      Emmanuel Fleury authored
      gobject/tests/ifaceproperties.c: In function ‘base_object_get_type’:
      gobject/tests/ifaceproperties.c:321:1: error: missing initializer for field ‘value_table’ of ‘GTypeInfo’ {aka ‘const struct _GTypeInfo’}
        321 | static DEFINE_TYPE_FULL (BaseObject, base_object,
            | ^~~~~~
      In file included from gobject/gobject.h:24,
                       from gobject/gbinding.h:29,
                       from glib/glib-object.h:22,
                       from gobject/tests/ifaceproperties.c:21:
      gobject/gtype.h:1063:26: note: ‘value_table’ declared here
       1063 |   const GTypeValueTable *value_table;
            |                          ^~~~~~~~~~~
      6ca38ccd
    • Emmanuel Fleury's avatar
      Fix missing initializer warning in gobject/tests/ifaceproperties.c:test_iface_get_type() · ff5d09af
      Emmanuel Fleury authored
      gobject/tests/ifaceproperties.c: In function ‘test_iface_get_type’:
      gobject/tests/ifaceproperties.c:144:1: error: missing initializer for field ‘class_finalize’ of ‘GTypeInfo’ {aka ‘const struct _GTypeInfo’}
        144 | static DEFINE_IFACE (TestIface, test_iface, NULL, test_iface_default_init)
            | ^~~~~~
      In file included from gobject/gobject.h:24,
                       from gobject/gbinding.h:29,
                       from glib/glib-object.h:22,
                       from gobject/tests/ifaceproperties.c:21:
      gobject/gtype.h:1054:26: note: ‘class_finalize’ declared here
       1054 |   GClassFinalizeFunc     class_finalize;
            |                          ^~~~~~~~~~~~~~
      ff5d09af
    • Emmanuel Fleury's avatar
      Fix missing initializer warning in gio/inotify/inotify-kernel.c:ik_source_new() · 3b02d464
      Emmanuel Fleury authored
      gio/inotify/inotify-kernel.c: In function ‘ik_source_new’:
      gio/inotify/inotify-kernel.c:377:3: error: missing initializer for field ‘finalize’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
        377 |   };
            |   ^
      In file included from glib/giochannel.h:33,
                       from glib/glib.h:54,
                       from gio/inotify/inotify-kernel.c:30:
      glib/gmain.h:272:14: note: ‘finalize’ declared here
        272 |   void     (*finalize) (GSource    *source); /* Can be NULL */
            |              ^~~~~~~~
      3b02d464
    • Emmanuel Fleury's avatar
      Fix signedness warning in gobject/tests/signals.c:test_introspection() · 805053d0
      Emmanuel Fleury authored
      gobject/tests/signals.c: In function ‘test_introspection’:
      gobject/tests/signals.c:1180:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’}
       1180 |   for (i = 0; i < n_ids; i++)
            |                 ^
      805053d0
    • Emmanuel Fleury's avatar
      Fix signedness warnings in gobject/tests/properties.c:properties_get_property() · 176b2047
      Emmanuel Fleury authored
      gobject/tests/properties.c: In function ‘properties_get_property’:
      gobject/tests/properties.c:562:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
        562 |   for (i = 0; i < G_N_ELEMENTS (test_props); i++)
            |                 ^
      gobject/tests/properties.c:583:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
        583 |   for (i = 0; i < G_N_ELEMENTS (test_props); i++)
            |                 ^
      176b2047