Commit Graph

22478 Commits

Author SHA1 Message Date
Matt Rose
b23811a234 add __APPLE__ to the list of operating systems that can use sysconf() to get open file limits 2020-11-17 14:42:06 -05:00
Sebastian Dröge
1b7509c09b Merge branch 'fix_warnings' into 'master'
Fix warnings

See merge request GNOME/glib!1750
2020-11-17 17:20:01 +00:00
Emmanuel Fleury
766e6325ac Fix several signedness warnings in glib/tests/timer.c
glib/tests/timer.c: In function ‘test_timeval_from_iso8601’:
glib/tests/timer.c:220:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’
  220 |   for (i = 0; i < G_N_ELEMENTS (tests); i++)
      |                 ^
glib/tests/timer.c: In function ‘test_timeval_to_iso8601’:
glib/tests/timer.c:260:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’
  260 |   for (i = 0; i < G_N_ELEMENTS (tests); i++)
      |                 ^
2020-11-17 17:25:13 +01:00
Emmanuel Fleury
4c1b068657 Extend the documentation of g_sequence_get_length()
The return value of g_sequence_get_length() is always a
positive number.
2020-11-17 17:25:13 +01:00
Emmanuel Fleury
89729bcd28 Fix several signedness warnings in glib/tests/sequence.c
glib/tests/sequence.c: In function ‘check_integrity’:
glib/tests/sequence.c:139:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’}
  139 |   g_assert (info->n_items == g_queue_get_length (info->queue));
      |                           ^~
glib/gmacros.h:941:25: note: in definition of macro ‘G_LIKELY’
  941 | #define G_LIKELY(expr) (expr)
      |                         ^~~~
glib/tests/sequence.c:139:3: note: in expansion of macro ‘g_assert’
  139 |   g_assert (info->n_items == g_queue_get_length (info->queue));
      |   ^~~~~~~~
glib/tests/sequence.c:157:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’}
  157 |   g_assert (info->n_items == g_queue_get_length (info->queue));
      |                           ^~
glib/gmacros.h:941:25: note: in definition of macro ‘G_LIKELY’
  941 | #define G_LIKELY(expr) (expr)
      |                         ^~~~
glib/tests/sequence.c:157:3: note: in expansion of macro ‘g_assert’
  157 |   g_assert (info->n_items == g_queue_get_length (info->queue));
      |   ^~~~~~~~
glib/tests/sequence.c: In function ‘run_random_tests’:
glib/tests/sequence.c:554:55: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘gint’ {aka ‘int’}
  554 |             g_assert (g_queue_get_length (seq->queue) == g_sequence_get_length (seq->sequence));
      |                                                       ^~
glib/gmacros.h:941:25: note: in definition of macro ‘G_LIKELY’
  941 | #define G_LIKELY(expr) (expr)
      |                         ^~~~
glib/tests/sequence.c:554:13: note: in expansion of macro ‘g_assert’
  554 |             g_assert (g_queue_get_length (seq->queue) == g_sequence_get_length (seq->sequence));
      |             ^~~~~~~~
glib/tests/sequence.c: In function ‘main’:
glib/tests/sequence.c:1404:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’
 1404 |   for (i = 0; i < G_N_ELEMENTS (seeds); ++i)
      |                 ^
2020-11-17 17:25:03 +01:00
Philip Withnall
053d2ae2b4 Merge branch '2046-add-shellcheck-pylint-in-ci' into 'master'
resolve "Add pylint and shellcheck CI checks"

Closes #2046

See merge request GNOME/glib!1743
2020-11-17 14:23:17 +00:00
Emmanuel Fleury
82be350f59 Fix signedness warnings in glib/tests/shell.c
glib/tests/shell.c: In function ‘main’:
glib/tests/shell.c:194:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’
  194 |   for (i = 0; i < G_N_ELEMENTS (cmdline_tests); i++)
      |                 ^
glib/tests/shell.c:201:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’
  201 |   for (i = 0; i < G_N_ELEMENTS (quote_tests); i++)
      |                 ^
glib/tests/shell.c:208:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’
  208 |   for (i = 0; i < G_N_ELEMENTS (unquote_tests); i++)
      |                 ^
2020-11-17 14:12:53 +01:00
Emmanuel Fleury
f4bfc50db3 Fix signedness warnings in glib/tests/slice.c
glib/tests/slice.c: In function ‘test_allocate’:
glib/tests/slice.c:146:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’
  146 |   for (i = 0; i < G_N_ELEMENTS(threads); i++)
      |                 ^
glib/tests/slice.c:149:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’
  149 |   for (i = 0; i < G_N_ELEMENTS(threads); i++)
      |                 ^
2020-11-17 14:12:53 +01:00
Emmanuel Fleury
fcbd9d6d75 Fix signedness warning in glib/tests/spawn-singlethread.c
glib/tests/spawn-singlethread.c: In function ‘test_spawn_async_with_fds’:
glib/tests/spawn-singlethread.c:204:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
  204 |   for (i = 0; i < G_N_ELEMENTS (tests); i++)
      |                 ^
2020-11-17 14:12:53 +01:00
Emmanuel Fleury
f5b2b8132d Fix signedness warning in glib/guri.c
glib/guri.c: In function ‘should_normalize_empty_path’:
glib/guri.c:756:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
  756 |   for (i = 0; i < G_N_ELEMENTS (schemes); ++i)
      |                 ^
2020-11-17 14:12:53 +01:00
Sebastian Dröge
c3388932fd Merge branch 'cmpstrv-null-check' into 'master'
Minor Coverity fixes

See merge request GNOME/glib!1755
2020-11-17 11:01:30 +00:00
Philip Withnall
51f322b74c tests: Add missing assertion to guard against infinite loop
Since the loop variable changed signedness, it’s now possible for there
to be an infinite loop if `get_match_count()` returns an error. Guard
against that.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Coverity CID: #1436405
2020-11-17 10:38:12 +00:00
Philip Withnall
065dea99f4 gtestutils: Drop unnecessary NULL check
The macro wrapper to `g_assertion_message_cmpstrv()` makes sure that
neither array is `NULL`, so there’s no need for a second `NULL` check.
Additionally, this check happens after the arrays have already been
dereferenced, at which point the program would have crashed if the
arrays were `NULL`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Coverity CID: #1436406, #1436407
2020-11-17 10:31:59 +00:00
Frederic Martinsons
bafc7cf1b1 Remove sanity_check script unused for years.
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-11-15 17:34:27 +01:00
Frederic Martinsons
e817a049f0 Correct shellcheck errors (and ignore world splitting when we want it)
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-11-15 17:34:27 +01:00
Frederic Martinsons
8f45fbdadd add 2 new stages: sh-check (which run shellcheck) and py-check (which run black and flake8)
The debian docker have been modified to install these tools.

Closes #2046

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-11-15 17:34:21 +01:00
Yuri Chornoivan
bb4d9e8c6d Update Ukrainian translation 2020-11-15 07:55:38 +00:00
Sebastian Dröge
728c591d76 Merge branch '1560-converter-zero-size' into 'master'
gresource: Fix handling of zero-sized compressed resource entries

Closes #1560

See merge request GNOME/glib!1752
2020-11-14 21:35:18 +00:00
Sebastian Dröge
94942bce2b Merge branch '1849-g-set-object-docs' into 'master'
gobject: Clarify documentation and annotations of g_set_object()

Closes #1849

See merge request GNOME/glib!1753
2020-11-14 21:33:46 +00:00
Philip Withnall
a65fe37e5c gobject: Clarify documentation and annotations of g_set_object()
Heavily based on changes suggested by Дилян Палаузов.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #1849
2020-11-14 20:35:09 +00:00
Philip Withnall
353020928c gresource: Fix handling of zero-sized compressed resource entries
The zlib `GConverter` can’t handle an output buffer of size 0.

Add tests.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #1560
2020-11-14 19:03:18 +00:00
Philip Withnall
e21bdf2219 Merge branch 'wip/nielsdg/g_assert_cmpstrv' into 'master'
Add g_assert_cmpstrv() test utility

Closes #2015

See merge request GNOME/glib!1732
2020-11-14 18:59:46 +00:00
Niels De Graef
6fa5c13c30 gio, glib: Use g_assert_cmpstrv where it makes sense 2020-11-14 18:17:32 +00:00
Niels De Graef
f98f2c5d0f gtestutils: Add g_assert_cmpstrv()
Add a test util function that helps asserting two string arrays are the
same, and which adds some useful information if they're not.

Fixes: #2015
2020-11-14 18:17:19 +00:00
Philip Withnall
1c290acd74 Merge branch 'gio-missing-nullable' into 'master'
gio: Add missing nullable annotations

See merge request GNOME/glib!1708
2020-11-14 15:53:55 +00:00
Sebastian Dröge
fbfb067375 Document that the get_default() functions for the various GIO modules will never return NULL 2020-11-14 17:32:41 +02:00
Sebastian Dröge
ec9fb90b2b Mark g_subprocess_get_std{in,out,err}_pipe() return value as nullable
Previously it was considered a programming error to call these on
subprocesses created without the correct flags, but for bindings this
distinction is difficult to handle automatically.

Returning NULL instead does not cause any inconsistent behaviour and
simplifies the API.
2020-11-14 17:32:41 +02:00
Philip Withnall
c97827c353 Merge branch 'fix_warnings' into 'master'
Fix signedness warnings

See merge request GNOME/glib!1699
2020-11-14 11:51:55 +00:00
Philip Withnall
332bc1708e Merge branch 'fix_more_warnings' into 'master'
Fix more warnings

See merge request GNOME/glib!1740
2020-11-14 11:44:45 +00:00
Sebastian Dröge
ddef9ba2f8 Merge branch 'instantiatable' into 'master'
gobject: Standardise on the term ‘instantiatable’

See merge request GNOME/glib!1735
2020-11-13 15:29:07 +00:00
Sebastian Dröge
e4721dfff5 Merge branch 'coverity-return-values' into 'master'
Fix minor Coverity return value warnings

See merge request GNOME/glib!1748
2020-11-13 15:24:47 +00:00
Philip Withnall
43d984464d gtestutils: Mark a return value as explicitly ignored
We can’t do anything differently based on whether removing a file fails.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Coverity CID: #1354857
2020-11-13 14:12:49 +00:00
Philip Withnall
895da99694 fuzzing: Fix minor Coverity warning about return values
ftell() could theoretically fail; handle that.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Coverity CID: #1430667
2020-11-13 14:12:18 +00:00
Emmanuel Fleury
e7c1b2a484 Fixing missing initializer warnings in glib/tests/mainloop.c
glib/tests/mainloop.c:55:1: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
   55 | };
      | ^
In file included from glib/giochannel.h:33,
                 from glib/glib.h:54,
                 from glib/tests/mainloop.c:23:
glib/gmain.h:276:19: note: ‘closure_callback’ declared here
  276 |   GSourceFunc     closure_callback;
      |                   ^~~~~~~~~~~~~~~~
glib/tests/mainloop.c:422:1: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
  422 | };
      | ^
In file included from glib/giochannel.h:33,
                 from glib/glib.h:54,
                 from glib/tests/mainloop.c:23:
glib/gmain.h:276:19: note: ‘closure_callback’ declared here
  276 |   GSourceFunc     closure_callback;
      |                   ^~~~~~~~~~~~~~~~
glib/tests/mainloop.c: In function ‘test_ready_time’:
glib/tests/mainloop.c:946:3: error: missing initializer for field ‘finalize’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
  946 |   };
      |   ^
In file included from glib/giochannel.h:33,
                 from glib/glib.h:54,
                 from glib/tests/mainloop.c:23:
glib/gmain.h:272:14: note: ‘finalize’ declared here
  272 |   void     (*finalize) (GSource    *source); /* Can be NULL */
      |              ^~~~~~~~
glib/tests/mainloop.c: In function ‘test_unref_while_pending’:
glib/tests/mainloop.c:1088:3: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
 1088 |   static GSourceFuncs funcs = { trivial_prepare, NULL, NULL, trivial_finalize };
      |   ^~~~~~
In file included from glib/giochannel.h:33,
                 from glib/glib.h:54,
                 from glib/tests/mainloop.c:23:
glib/gmain.h:276:19: note: ‘closure_callback’ declared here
  276 |   GSourceFunc     closure_callback;
      |                   ^~~~~~~~~~~~~~~~
In file included from glib/glibconfig.h:9,
                 from glib/gtypes.h:32,
                 from glib/galloca.h:32,
                 from glib/glib.h:30,
                 from glib/tests/mainloop.c:23:

glib/tests/mainloop.c: In function ‘test_source_unix_fd_api’:
glib/tests/mainloop.c:1403:3: error: missing initializer for field ‘finalize’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
 1403 |   };
      |   ^
In file included from glib/giochannel.h:33,
                 from glib/glib.h:54,
                 from glib/tests/mainloop.c:23:
glib/gmain.h:272:14: note: ‘finalize’ declared here
  272 |   void     (*finalize) (GSource    *source); /* Can be NULL */
      |              ^~~~~~~~
glib/tests/mainloop.c: At top level:
glib/tests/mainloop.c:1843:1: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
 1843 | };
      | ^
In file included from glib/giochannel.h:33,
                 from glib/glib.h:54,
                 from glib/tests/mainloop.c:23:
glib/gmain.h:276:19: note: ‘closure_callback’ declared here
  276 |   GSourceFunc     closure_callback;
      |                   ^~~~~~~~~~~~~~~~
glib/tests/mainloop.c:1919:1: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
 1919 | };
      | ^
In file included from glib/giochannel.h:33,
                 from glib/glib.h:54,
                 from glib/tests/mainloop.c:23:
glib/gmain.h:276:19: note: ‘closure_callback’ declared here
  276 |   GSourceFunc     closure_callback;
      |                   ^~~~~~~~~~~~~~~~
glib/tests/mainloop.c:2002:1: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
 2002 | };
      | ^
In file included from glib/giochannel.h:33,
                 from glib/glib.h:54,
                 from glib/tests/mainloop.c:23:
glib/gmain.h:276:19: note: ‘closure_callback’ declared here
  276 |   GSourceFunc     closure_callback;
      |                   ^~~~~~~~~~~~~~~~
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
5444b7e74d Fixing signedness warning in glib/tests/mainloop.c
glib/tests/mainloop.c: In function ‘write_bytes’:
glib/gmacros.h:809:26: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘long unsigned int’
  809 | #define MIN(a, b)  (((a) < (b)) ? (a) : (b))
      |                          ^
glib/tests/mainloop.c:1146:11: note: in expansion of macro ‘MIN’
 1146 |   limit = MIN (*to_write, sizeof zeros);
      |           ^~~
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
8045b77c32 Fixing missing initializer warnings in glib/tests/option-context.c
glib/tests/option-context.c: In function ‘callback_test_optional_5’:
glib/tests/option-context.c:945:5: error: missing initializer for field ‘arg_description’ of ‘GOptionEntry’ {aka ‘struct _GOptionEntry’}
  945 |     { { "dummy", 'd', 0, G_OPTION_ARG_NONE, &dummy, NULL },
      |     ^
In file included from glib/glib.h:64,
                 from glib/tests/option-context.c:23:
glib/goption.h:268:16: note: ‘arg_description’ declared here
  268 |   const gchar *arg_description;
      |                ^~~~~~~~~~~~~~~
glib/tests/option-context.c: In function ‘callback_test_optional_6’:
glib/tests/option-context.c:983:5: error: missing initializer for field ‘arg_description’ of ‘GOptionEntry’ {aka ‘struct _GOptionEntry’}
  983 |     { { "dummy", 'd', 0, G_OPTION_ARG_NONE, &dummy, NULL },
      |     ^
In file included from glib/glib.h:64,
                 from glib/tests/option-context.c:23:
glib/goption.h:268:16: note: ‘arg_description’ declared here
  268 |   const gchar *arg_description;
      |                ^~~~~~~~~~~~~~~
glib/tests/option-context.c: In function ‘callback_test_optional_7’:
glib/tests/option-context.c:1021:5: error: missing initializer for field ‘arg_description’ of ‘GOptionEntry’ {aka ‘struct _GOptionEntry’}
 1021 |     { { "dummy", 'd', 0, G_OPTION_ARG_NONE, &dummy, NULL },
      |     ^
In file included from glib/glib.h:64,
                 from glib/tests/option-context.c:23:
glib/goption.h:268:16: note: ‘arg_description’ declared here
  268 |   const gchar *arg_description;
      |                ^~~~~~~~~~~~~~~
glib/tests/option-context.c: In function ‘callback_test_optional_8’:
glib/tests/option-context.c:1059:5: error: missing initializer for field ‘arg_description’ of ‘GOptionEntry’ {aka ‘struct _GOptionEntry’}
 1059 |     { { "dummy", 'd', 0, G_OPTION_ARG_NONE, &dummy, NULL },
      |     ^
In file included from glib/glib.h:64,
                 from glib/tests/option-context.c:23:
glib/goption.h:268:16: note: ‘arg_description’ declared here
  268 |   const gchar *arg_description;
      |                ^~~~~~~~~~~~~~~
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
913d222c88 Fix ‘static’ is not at beginning of declaration in glib/tests/option-context.c
glib/tests/option-context.c:1335:1: error: ‘static’ is not at beginning of declaration
 1335 | static array_test1 (void)
      | ^~~~~~
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
75ba0e552d Fix signedness warnings in glib/tests/option-context.c
glib/tests/option-context.c: In function ‘test_group_captions’:
glib/tests/option-context.c:123:21: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’
  123 |       for (j = 0; j < G_N_ELEMENTS (test_name_base); ++j)
      |                     ^

glib/tests/option-context.c: In function ‘option_context_parse_command_line’:
glib/tests/option-context.c:2364:46: error: operand of ‘?:’ changes signedness from ‘int’ to ‘guint’ {aka ‘unsigned int’} due to unsignedness of other operand
 2364 |   return success ? argv_len - argv_new_len : -1;
      |                                              ^~
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
043cf25631 Fix missing initializer warnings in glib/tests/markup-subparser.c
In file included from glib/glib.h:60,
                 from glib/tests/markup-subparser.c:14:
glib/gmarkup.h:161:10: note: ‘text’ declared here
  161 |   void (*text)           (GMarkupParseContext *context,
      |          ^~~~
glib/tests/markup-subparser.c:335:3: error: missing initializer for field ‘error_message’ of ‘TestCase’
  335 |   { "<test/>",                  "<test></test>" },
      |   ^
glib/tests/markup-subparser.c:275:15: note: ‘error_message’ declared here
  275 |   const char *error_message;
      |               ^~~~~~~~~~~~~
glib/tests/markup-subparser.c:336:3: error: missing initializer for field ‘error_message’ of ‘TestCase’
  336 |   { "<sub><foo/></sub>",        "<sub><<{foo}{/foo}>></sub>" },
      |   ^
glib/tests/markup-subparser.c:275:15: note: ‘error_message’ declared here
  275 |   const char *error_message;
      |               ^~~~~~~~~~~~~
glib/tests/markup-subparser.c:337:3: error: missing initializer for field ‘error_message’ of ‘TestCase’
  337 |   { "<sub><foo/><bar/></sub>",  "<sub><<{foo}{/foo}{bar}{/bar}>></sub>" },
      |   ^
glib/tests/markup-subparser.c:275:15: note: ‘error_message’ declared here
  275 |   const char *error_message;
      |               ^~~~~~~~~~~~~
glib/tests/markup-subparser.c:338:3: error: missing initializer for field ‘error_message’ of ‘TestCase’
  338 |   { "<foo><bar/></foo>",        "<foo>[[{foo}{bar}{/bar}{/foo}]]</foo>" },
      |   ^
glib/tests/markup-subparser.c:275:15: note: ‘error_message’ declared here
  275 |   const char *error_message;
      |               ^~~~~~~~~~~~~
glib/tests/markup-subparser.c:339:3: error: missing initializer for field ‘error_message’ of ‘TestCase’
  339 |   { "<foo><x/><y/></foo>",      "<foo>[[{foo}{x}{/x}{y}{/y}{/foo}]]</foo>" },
      |   ^
glib/tests/markup-subparser.c:275:15: note: ‘error_message’ declared here
  275 |   const char *error_message;
      |               ^~~~~~~~~~~~~
glib/tests/markup-subparser.c:340:3: error: missing initializer for field ‘error_message’ of ‘TestCase’
  340 |   { "<foo/>",                   "<foo>[[{foo}{/foo}]]</foo>" },
      |   ^
glib/tests/markup-subparser.c:275:15: note: ‘error_message’ declared here
  275 |   const char *error_message;
      |               ^~~~~~~~~~~~~
glib/tests/markup-subparser.c:342:33: error: missing initializer for field ‘error_message’ of ‘TestCase’
  342 |                                 "<bar>[[{bar}{/bar}]]</bar>" }
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
glib/tests/markup-subparser.c:275:15: note: ‘error_message’ declared here
  275 |   const char *error_message;
      |               ^~~~~~~~~~~~~
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
2eb66a2091 Fix missing initializer warning in glib/tests/markup-subparser.c
glib/tests/markup-subparser.c:269:1: error: missing initializer for field ‘text’ of ‘GMarkupParser’ {aka ‘struct _GMarkupParser’}
  269 | };
      | ^
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
7ea05283ac Fix signedness warnings in glib/tests/markup-subparser.c
glib/tests/markup-subparser.c: In function ‘main’:
glib/tests/markup-subparser.c:362:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
  362 |          __add_tests_i < G_N_ELEMENTS (array);                          \
      |                        ^
glib/tests/markup-subparser.c:378:3: note: in expansion of macro ‘add_tests’
  378 |   add_tests (test, "/glib/markup/subparser/success", test_cases);
      |   ^~~~~~~~~
glib/tests/markup-subparser.c:362:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
  362 |          __add_tests_i < G_N_ELEMENTS (array);                          \
      |                        ^
glib/tests/markup-subparser.c:379:3: note: in expansion of macro ‘add_tests’
  379 |   add_tests (test, "/glib/markup/subparser/failure", error_cases);
      |   ^~~~~~~~~
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
24c60cee6c Fix missing initializer warnings in glib/tests/markup-collect.c
glib/gmarkup.h:154:10: note: ‘end_element’ declared here
  154 |   void (*end_element)    (GMarkupParseContext *context,
      |          ^~~~~~~~~~~
glib/tests/markup-collect.c:94:3: error: missing initializer for field ‘error_code’ of ‘struct test’
   94 |   { "<bool mb='false'/>", "<bool(1) 0 0 -1>" },
      |   ^
glib/tests/markup-collect.c:85:17: note: ‘error_code’ declared here
   85 |   GMarkupError  error_code;
      |                 ^~~~~~~~~~
glib/tests/markup-collect.c:95:3: error: missing initializer for field ‘error_code’ of ‘struct test’
   95 |   { "<bool mb='true'/>", "<bool(1) 1 0 -1>" },
      |   ^
glib/tests/markup-collect.c:85:17: note: ‘error_code’ declared here
   85 |   GMarkupError  error_code;
      |                 ^~~~~~~~~~
glib/tests/markup-collect.c:96:3: error: missing initializer for field ‘error_code’ of ‘struct test’
   96 |   { "<bool mb='t' ob='f' tri='1'/>", "<bool(1) 1 0 1>" },
      |   ^
glib/tests/markup-collect.c:85:17: note: ‘error_code’ declared here
   85 |   GMarkupError  error_code;
      |                 ^~~~~~~~~~
glib/tests/markup-collect.c:97:3: error: missing initializer for field ‘error_code’ of ‘struct test’
   97 |   { "<bool mb='y' ob='n' tri='0'/>", "<bool(1) 1 0 0>" },
      |   ^
glib/tests/markup-collect.c:85:17: note: ‘error_code’ declared here
   85 |   GMarkupError  error_code;
      |                 ^~~~~~~~~~
glib/tests/markup-collect.c:99:3: error: missing initializer for field ‘error_code’ of ‘struct test’
   99 |   { "<bool mb='y' my:attr='q'><my:tag/></bool>", "<bool(1) 1 0 -1>" },
      |   ^
glib/tests/markup-collect.c:85:17: note: ‘error_code’ declared here
   85 |   GMarkupError  error_code;
      |                 ^~~~~~~~~~
glib/tests/markup-collect.c💯3: error: missing initializer for field ‘error_code’ of ‘struct test’
  100 |   { "<bool mb='y' my:attr='q'><my:tag>some <b>text</b> is in here</my:tag></bool>", "<bool(1) 1 0 -1>" },
      |   ^
glib/tests/markup-collect.c:85:17: note: ‘error_code’ declared here
   85 |   GMarkupError  error_code;
      |                 ^~~~~~~~~~
glib/tests/markup-collect.c:111:3: error: missing initializer for field ‘error_code’ of ‘struct test’
  111 |   { "<str cm='x' am='y'/>", "<str(1) x y (null) (null)>" },
      |   ^
glib/tests/markup-collect.c:85:17: note: ‘error_code’ declared here
   85 |   GMarkupError  error_code;
      |                 ^~~~~~~~~~
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
6c74ab7fcc Fix signedness warning in glib/tests/markup-collect.c
glib/gtestutils.h:134:96: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘GMarkupError’
  134 |                                                if (!err || (err)->domain != dom || (err)->code != c) \
      |                                                                                                ^~
glib/tests/markup-collect.c:168:7: note: in expansion of macro ‘g_assert_error’
  168 |       g_assert_error (error, G_MARKUP_ERROR, test->error_code);
      |       ^~~~~~~~~~~~~~
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
93dd614562 Fixing missing initializer in glib/test/markup-collect.c
glib/tests/markup-collect.c:79:1: error: missing initializer for field ‘end_element’ of ‘GMarkupParser’ {aka ‘struct _GMarkupParser’}
   79 | static GMarkupParser parser = { start };
      | ^~~~~~

glib/tests/markup-collect.c:198:1: error: missing initializer for field ‘end_element’ of ‘GMarkupParser’ {aka ‘struct _GMarkupParser’}
  198 | };
      | ^
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
2292960690 Fix signedness warning in glib/tests/spawn-multithreaded.c
glib/tests/spawn-multithreaded.c: In function ‘multithreaded_test_run’:
glib/tests/spawn-multithreaded.c:41:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’}
   41 |   for (i = 0; i < n_threads; i++)
      |                 ^
glib/tests/spawn-multithreaded.c:49:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’}
   49 |   for (i = 0; i < n_threads; i++)
      |                 ^
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
0c81ed309e Fix missing initializer warnings in glib/tests/gvariant.c
glib/tests/gvariant.c: In function ‘test_lookup_value’:
glib/tests/gvariant.c:4353:5: error: missing initializer for field ‘value’ of ‘struct <anonymous>’
 4353 |     { "@a{ss} {'x':  'y'}",   "y"         },
      |     ^
glib/tests/gvariant.c:4350:31: note: ‘value’ declared here
 4350 |     const gchar *dict, *key, *value;
      |                               ^~~~~
glib/tests/gvariant.c:4355:5: error: missing initializer for field ‘value’ of ‘struct <anonymous>’
 4355 |     { "@a{os} {'/x': 'y'}",   "/y"        },
      |     ^
glib/tests/gvariant.c:4350:31: note: ‘value’ declared here
 4350 |     const gchar *dict, *key, *value;
      |                               ^~~~~
glib/tests/gvariant.c:4358:5: error: missing initializer for field ‘value’ of ‘struct <anonymous>’
 4358 |     { "@a{sv} {'x':  <'y'>}", "y"         }
      |     ^
glib/tests/gvariant.c:4350:31: note: ‘value’ declared here
 4350 |     const gchar *dict, *key, *value;
      |                               ^~~~~
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
43a30e4983 Fix signedness warning in glib/test/tree.c
glib/tests/tree.c: In function ‘test_tree_traverse’:
glib/tests/tree.c:394:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’
  394 |   for (i = 0; i < G_N_ELEMENTS (orders); i++)
      |                 ^
2020-11-13 10:13:49 +01:00
Emmanuel Fleury
d29270db60 Fix signedness warning in glib/tests/markup-collect.c
glib/tests/markup-collect.c: In function ‘main’:
glib/tests/markup-collect.c:227:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
  227 |   for (i = 0; i < G_N_ELEMENTS (tests); i++)
      |                 ^
2020-11-13 10:12:16 +01:00
Emmanuel Fleury
a7fdca46e7 Fix signedness warning in glib/tests/scannerapi.c
glib/tests/scannerapi.c: In function ‘test_scanner_tokens’:
glib/tests/scannerapi.c:124:17: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘gint’ {aka ‘const int’}
  124 |   for (i = 1; i < tokbuflen; i++)
      |                 ^
2020-11-13 10:12:16 +01:00
Emmanuel Fleury
cc041eb742 Fix signedness warning in glib/tests/regex.c
glib/tests/regex.c: In function ‘test_match_all’:
glib/tests/regex.c:1317:19: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’}
 1317 |   if (match_count != g_slist_length (data->expected))
      |                   ^~
2020-11-13 10:12:16 +01:00