Commit Graph

20247 Commits

Author SHA1 Message Date
Emmanuele Bassi
95b7a8ab10 ci: Run test coverage for MSYS2 job 2019-04-06 15:31:41 +01:00
Emmanuele Bassi
ed65996300 ci: Generate a cover report for the test suite
GitLab can show the results of a CI pipeline if the pipeline generates a
report using the JUnit XML format.

Since Meson provides a machine parseable output for `meson test`, we can
take that and turn it into XML soup.
2019-04-06 14:19:20 +01:00
Peter Bloomfield
45a3598aa2 gslice: Use a convenience macro
In magazine_cache_trim(), use the recent G_APPROX_VALUE macro to decide
when to trim the magazine chain.

See <URL:fad04d2e18 (note_471824)>.
2019-04-03 12:46:20 -04:00
Philip Withnall
9d43bfc4ed Merge branch 'cygwin-visibility' into 'master'
Use W32 visibility for Cygwin

See merge request GNOME/glib!752
2019-04-03 16:03:16 +00:00
LRN
430d584046 Merge branch 'cygwin-proc-self-cmdline' into 'master'
Check for /proc/self/cmdline

See merge request GNOME/glib!754
2019-04-03 15:38:06 +00:00
Руслан Ижбулатов
4c038a27ff Check for /proc/self/cmdline
Instead of hardcoding /proc/self/cmdline use for __linux__ only,
do a configure-time test for it.

Specifically, this enables /proc/self/cmdline use on Cygwin.

The configure-time test is very primitive (just tests that the
file exists and that it's possible to read more than one byte from it),
relying on the testsuite for more extensive checks.

The test in the testsuite is modified to always run, even on platforms
where it isn't supposed to pass. If it fails there, the testing framework
skips it. If the test unexpectedly passes, that is reported too.
2019-04-03 15:17:34 +00:00
Emmanuele Bassi
cf54fc3600 Merge branch '1737-gdbus-tool-wait' into 'master'
gdbus-tool: Fix units for `gdbus-tool wait` timeout

Closes #1737

See merge request GNOME/glib!753
2019-04-03 12:36:54 +00:00
Philip Withnall
80988146df Merge branch 'g_get_prgname-annotations' into 'master'
gutils: Add (nullable) annotation to g_get_prgname()

See merge request GNOME/glib!762
2019-04-03 12:32:42 +00:00
Philip Withnall
abde3efb34 Merge branch 'wip/oholy/trash-autofs' into 'master'
gunixmounts: Return the last matching mount for same mount path

Closes #1727

See merge request GNOME/glib!740
2019-04-03 12:23:10 +00:00
Philip Withnall
8349ceeac9 Merge branch 'use_after_free' into 'master'
Fix use-after-free triggered by gnome-session-binary

See merge request GNOME/glib!741
2019-04-03 12:01:04 +00:00
Philip Withnall
c1c26448b1 gutils: Add (nullable) annotation to g_get_prgname()
It can return NULL if no program name has been set yet (i.e.
g_set_prgname() has not been called from somewhere).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-03 12:31:44 +01:00
Philip Withnall
9976418262 Merge branch 'fix-cocoa-backend-loading' into 'master'
Properly ensure the cocoa notification backend type

See merge request GNOME/glib!760
2019-04-01 09:34:44 +00:00
Ignacio Casal Quinteiro
55870d4b42 Properly ensure the cocoa notification backend type 2019-03-29 15:52:38 +01:00
Philip Withnall
d86146df38 gdbus-tool: Fix units for gdbus-tool wait timeout
They were documented as being in seconds, but implemented as
milliseconds.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1737
2019-03-27 17:04:58 +00:00
Philip Withnall
ad614fc070 Merge branch 'cygwin-rtld_next' into 'master'
Check for RTLD_NEXT

See merge request GNOME/glib!750
2019-03-27 16:25:48 +00:00
Руслан Ижбулатов
a53ff7460e Check for RTLD_NEXT
Check for RTLD_NEXT being present, and disable the gsocketclient-slow
test if it's absent, since the shlib dependency of that test requires
RTLD_NEXT to function.

This allows the testsuite to be built on Cygwin, which behaves
exactly like UNIX, but doesn't have RTLD_NEXT.
2019-03-27 16:10:17 +00:00
Philip Withnall
d264001d79 Merge branch 'cygwin-macro' into 'master'
Set G_WITH_CYGWIN again

See merge request GNOME/glib!736
2019-03-26 22:55:56 +00:00
Philip Withnall
ad19bb8f12 Merge branch '1258-input-stream-annotations' into 'master'
ginputstream: Add missing (out) annotations to read() functions

Closes #1258

See merge request GNOME/glib!738
2019-03-26 22:53:27 +00:00
Philip Withnall
f84d10746e Merge branch 'wip/jtojnar/gsettings-cleanup' into 'master'
gio: Add missing autocleanup definition for GSettingsSchema{Key,Source}

See merge request GNOME/glib!749
2019-03-26 22:50:05 +00:00
Jan Tojnar
c940816181
gio: Add missing autocleanup definition for GSettingsSchemaKey 2019-03-26 16:40:28 +01:00
Jan Tojnar
edaae619e5
gio: Add missing autocleanup definition for GSettingsSchemaSource 2019-03-26 16:38:06 +01:00
Patrick Griffis
01d974194a Merge branch 'cocoa-notification-backend-default' into 'master'
gcocoanotificationbackend: give more priority than the gtk one

See merge request GNOME/glib!745
2019-03-26 14:30:45 +00:00
Ignacio Casal Quinteiro
1e1759d5a2 gcocoanotificationbackend: give more priority than the gtk one
On OSX both backends are built. Generally we want to use the cocoa
backend by default and in case it is not supported, i.e because
the application is not using a bundle then we should fallback
to the gtk one.
2019-03-26 10:20:25 +01:00
Stefan Sperling
052ad6098d Fix use-after-free triggered by gnome-session-binary
ostream_flush_cb() was calling flush_data_list_complete() with a single
element list with an item that had already been freed. This was observed
on OpenBSD where memory is overwritten with 0xdf during free():

    error=0x0) at ../glib-2.58.3/gio/gdbusprivate.c:1156
1156          g_mutex_lock (&f->mutex);
(gdb) p /x *f
$74 = {mutex = {p = 0xdfdfdfdfdfdfdfdf, i = {0xdfdfdfdf, 0xdfdfdfdf}},
  cond = { p = 0xdfdfdfdfdfdfdfdf, i = {0xdfdfdfdf, 0xdfdfdfdf}},
  number_to_wait_for = 0xdfdfdfdfdfdfdfdf, error = 0x0}

This happened because the thread freeing the element didn't properly wait
for the asynchronous flush operation to finish.
Gnome's developer docs say: "g_cond_wait() must always be used in a loop"
https://developer.gnome.org/glib/stable/glib-Threads.html#g-cond-wait
2019-03-25 07:44:13 +01:00
Руслан Ижбулатов
9ca7ac782e Set G_WITH_CYGWIN again
This macro was lost during meson migration. Set it again.

Also explain that Cygwin maintainers applied patches[0] to glib that
simply marked all G_PLATFORM_WIN32-protected code as !defined(G_WITH_CYGWIN),
i.e. they did not want that code to compile.
Instead of altering ifdef guards all over the place, we'll just
not define G_PLATFORM_WIN32 for Cygwin anymore.

[0]: 3a873fdd1b/2.36.3-not-win32.patch
2019-03-22 14:44:53 +00:00
Sebastian Dröge
ecad5cd522 Merge branch '1732-gai_strerror-locale' into 'master'
gresolver: Convert encoding of gai_strerror() return value

Closes #1732

See merge request GNOME/glib!739
2019-03-22 13:57:39 +00:00
Philip Withnall
89416debb0 gresolver: Convert encoding of gai_strerror() return value
It returns a string in the libc locale, which is not necessarily UTF-8.
Convert that to UTF-8 before returning it to the caller.

Spotted by Tomasz Miąsko.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1732
2019-03-22 13:32:14 +00:00
Philip Withnall
3a32c75876 ginputstream: Add missing (out) annotations to read() functions
This is a reversion of the reversion of commit
c192595268, after more discussion on the
issue.

Fixes: #1258
2019-03-22 13:20:41 +00:00
Ondrej Holy
bc52235efc gunixmounts: Return the last matching mount for same mount path
More mounts can have same mount path, but only the last one is
accessible. Thus we should always return the last matching mount from
g_unix_mount_at() and g_unix_mount_for(). This should also solve
problems with g_file_trash() on automounted filesystems, which are
caused by the recently added mount checks.

Closes: https://gitlab.gnome.org/GNOME/glib/issues/1727
2019-03-22 12:41:47 +01:00
Michael Catanzaro
abeac84105 Merge branch 'gai_strerror-thread-safety' into 'master'
gresolver: Don’t use gai_strerror() on Windows, as it isn’t threadsafe

See merge request GNOME/glib!737
2019-03-21 14:37:18 +00:00
Philip Withnall
3a11213b68 gresolver: Don’t use gai_strerror() on Windows, as it isn’t threadsafe
Instead, use WSAGetLastError().

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1732
2019-03-21 11:51:37 +00:00
Руслан Ижбулатов
8758604579 Use W32 visibility for Cygwin
Cygwin is still subject to W32 visibility mechanics.
2019-03-20 21:10:58 +00:00
Emmanuele Bassi
ff47bb0e53 Merge branch 'wip/tintou/autoptr-right-function' into 'master'
docs: Use the right g_autoptr function when using an auxiliary function

See merge request GNOME/glib!735
2019-03-20 14:39:44 +00:00
Corentin Noël
5350f1271e docs: Use the right g_autoptr function when using an auxiliary function 2019-03-20 14:39:44 +00:00
Philip Withnall
c8692fffe0 Merge branch 'fix-warnings-glib' into 'master'
Fix warnings glib

See merge request GNOME/glib!680
2019-03-19 11:02:38 +00:00
Philip Withnall
10278fd808 Merge branch 'meson' into 'master'
meson: do a build-time check for strlcpy before attempting runtime check

See merge request GNOME/glib!724
2019-03-19 10:57:58 +00:00
Philip Withnall
114921ccd9 Merge branch 'dbus-address-tests' into 'master'
Improve gdbus-address parsing tests

See merge request GNOME/glib!730
2019-03-19 10:53:44 +00:00
Philip Withnall
fcbfa0c65f Merge branch 'enotsock' into 'master'
GIO: Convert ENOTSOCK to G_IO_ERROR_INVALID_ARGUMENT

Closes #1728

See merge request GNOME/glib!731
2019-03-19 09:03:13 +00:00
Emmanuel Fleury
fad04d2e18 Fixing signedness warning in glib/gslice.c
In file included from glib/glibconfig.h:9,
                 from glib/gslice.c:20:
glib/gslice.c: In function ‘magazine_cache_trim’:
glib/gmacros.h:354:25: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
 #define ABS(a)    (((a) < 0) ? -(a) : (a))
                         ^
glib/gslice.c:643:10: note: in expansion of macro ‘ABS’
   while (ABS (stamp - magazine_chain_uint_stamp (current)) >= allocator->config.working_set_msecs)
          ^~~
2019-03-17 19:05:35 +01:00
Emmanuel Fleury
e9f57495c6 Fix various signedness warnings in glib/ghash.c
To conform to a better signedness schema, this patch change
GHashTable.size field from gint to gsize (and change accordingly the
tests with it).
2019-03-17 19:05:35 +01:00
Emmanuel Fleury
a7aac03ead Fixing various warnings in glib/gvariant-parser.c
glib/gvariant-parser.c: In function ‘number_get_value’:
glib/gvariant-parser.c:1924:46: error: operand of ?: changes signedness from ‘int’ to ‘guint64’ {aka ‘long unsigned int’} due to unsignedness of other operand [-Werror=sign-compare]
       return g_variant_new_int16 (negative ? -((gint16) abs_val) : abs_val);
                                             ^~~~~~~~~~~~~~~~~~~
glib/gvariant-parser.c:1934:46: error: operand of ?: changes signedness from ‘int’ to ‘guint64’ {aka ‘long unsigned int’} due to unsignedness of other operand [-Werror=sign-compare]
       return g_variant_new_int32 (negative ? -((gint32) abs_val) : abs_val);
                                              ^~~~~~~~~~~~~~~~~~~
glib/gvariant-parser.c:1944:46: error: operand of ?: changes signedness from ‘long int’ to ‘guint64’ {aka ‘long unsigned int’} due to unsignedness of other operand [-Werror=sign-compare]
       return g_variant_new_int64 (negative ? -((gint64) abs_val) : abs_val);
                                                  ^~~~~~~~~~~~~~~~~~~
glib/gvariant-parser.c:1954:47: error: operand of ?: changes signedness from ‘int’ to ‘guint64’ {aka ‘long unsigned int’} due to unsignedness of other operand [-Werror=sign-compare]
       return g_variant_new_handle (negative ? -((gint32) abs_val) : abs_val);
                                                   ^~~~~~~~~~~~~~~~~~~
glib/gvariant-parser.c: In function ‘g_variant_parse_error_print_context’:
glib/gvariant-parser.c:2785:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
       if (point >= strlen (source_str))
                 ^~
2019-03-17 19:05:35 +01:00
Emmanuel Fleury
357c3db942 Fixing various warning in glib/gvarianttypeinfo.c
glib/gvarianttypeinfo.c:115:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 'b' */ { fixed_aligned(1) },   /* boolean */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c:117:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 'd' */ { fixed_aligned(8) },   /* double */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c:120:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 'g' */ { unaligned        },   /* signature string */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c:121:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 'h' */ { fixed_aligned(4) },   /* file handle (int32) */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c:122:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 'i' */ { fixed_aligned(4) },   /* int32 */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c:127:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 'n' */ { fixed_aligned(2) },   /* int16 */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c:128:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 'o' */ { unaligned        },   /* object path string */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c:130:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 'q' */ { fixed_aligned(2) },   /* uint16 */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c:132:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 's' */ { unaligned        },   /* string */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c:133:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 't' */ { fixed_aligned(8) },   /* uint64 */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c:134:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 'u' */ { fixed_aligned(4) },   /* uint32 */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c:135:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 'v' */ { aligned(8)       },   /* variant */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c:137:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 'x' */ { fixed_aligned(8) },   /* int64 */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c:138:13: error: missing initializer for field ‘container_class’ of ‘GVariantTypeInfo’ {aka ‘const struct _GVariantTypeInfo’} [-Werror=missing-field-initializers]
   /* 'y' */ { fixed_aligned(1) },   /* byte */
             ^
glib/gvarianttypeinfo.c:69:10: note: ‘container_class’ declared here
   guchar container_class;
          ^~~~~~~~~~~~~~~
glib/gvarianttypeinfo.c: In function ‘tuple_info_free’:
glib/gvarianttypeinfo.c:368:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   for (i = 0; i < tuple_info->n_members; i++)
                 ^
glib/gvarianttypeinfo.c: In function ‘tuple_set_base_info’:
glib/gvarianttypeinfo.c:641:16: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
       if (m->i == -1 && m->type_info->fixed_size)
                ^~
2019-03-17 19:05:34 +01:00
Emmanuel Fleury
3f3a7472b3 Fixing signedness in glib/gvariant.c
glib/gvariant.c: In function ‘g_variant_new_strv’:
glib/gvariant.c:1563:17: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘gssize’ {aka ‘long int’} [-Werror=sign-compare]
   for (i = 0; i < length; i++)
                 ^
glib/gvariant.c: In function ‘g_variant_new_objv’:
glib/gvariant.c:1699:17: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘gssize’ {aka ‘long int’} [-Werror=sign-compare]
   for (i = 0; i < length; i++)
                 ^
glib/gvariant.c: In function ‘g_variant_new_bytestring_array’:
glib/gvariant.c:1939:17: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘gssize’ {aka ‘long int’} [-Werror=sign-compare]
   for (i = 0; i < length; i++)
                 ^
2019-03-17 19:05:34 +01:00
Emmanuel Fleury
9023483d36 Fixing signedness in glib/gvariant-core.c
glib/gvariant-core.c: In function ‘g_variant_ensure_size’:
glib/gvariant-core.c:339:19: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘long int’ [-Werror=sign-compare]
   if (value->size == (gssize) -1)
                   ^~
2019-03-17 19:05:34 +01:00
Emmanuel Fleury
b673ac48cc Fixing missing initializer in glib/giounix.c
^~~
glib/giounix.c:111:1: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’} [-Werror=missing-field-initializers]
 };
 ^
In file included from glib/giochannel.h:33,
                 from glib/glib.h:54,
                 from glib/gprintf.h:21,
                 from glib/gstdio.h:22,
                 from glib/giounix.c:43:
glib/gmain.h:262:19: note: ‘closure_callback’ declared here
   GSourceFunc     closure_callback;
                   ^~~~~~~~~~~~~~~~
2019-03-17 19:05:34 +01:00
Emmanuel Fleury
5dd02cc6f5 Fixing signedness in glib/gthread-posix.c
In file included from glib/glibconfig.h:9,
                 from glib/gtypes.h:32,
                 from glib/gatomic.h:27,
                 from glib/gthread.h:32,
                 from glib/gthread-posix.c:42:
glib/gthread-posix.c: In function ‘g_system_thread_new’:
glib/gmacros.h:348:26: error: comparison of integer expressions of different signedness: ‘long int’ and ‘gulong’ {aka ‘long unsigned int’} [-Werror=sign-compare]
 #define MAX(a, b)  (((a) > (b)) ? (a) : (b))
                          ^
glib/gthread-posix.c:1169:22: note: in expansion of macro ‘MAX’
         stack_size = MAX (min_stack_size, stack_size);
                      ^~~
glib/gmacros.h:348:35: error: operand of ?: changes signedness from ‘long int’ to ‘gulong’ {aka ‘long unsigned int’} due to unsignedness of other operand [-Werror=sign-compare]
 #define MAX(a, b)  (((a) > (b)) ? (a) : (b))
                                   ^~~
glib/gthread-posix.c:1169:22: note: in expansion of macro ‘MAX’
         stack_size = MAX (min_stack_size, stack_size);
                      ^~~
2019-03-17 19:05:34 +01:00
Emmanuel Fleury
c3d0440aa2 Fixing signedness in glib/gtester.c
glib/gtester.c: In function ‘main’:
glib/gtester.c:705:19: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
   for (ui = 1; ui < argc; ui++)
                   ^
2019-03-17 19:05:34 +01:00
Emmanuel Fleury
125a1e1f30 Fixing missing initializer in glib-unix.c
glib/glib-unix.c:314:1: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’} [-Werror=missing-field-initializers]
 };
 ^
In file included from glib/giochannel.h:33,
                 from glib/glib.h:54,
                 from glib/glib-unix.h:33,
                 from glib/glib-unix.c:29:
glib/gmain.h:262:19: note: ‘closure_callback’ declared here
   GSourceFunc     closure_callback;
                   ^~~~~~~~~~~~~~~~
2019-03-17 19:05:34 +01:00
Emmanuel Fleury
165a922a95 Fixing various warnings in glib/gstring.c
In file included from glib/glibconfig.h:9,
                 from glib/gtypes.h:32,
                 from glib/gstring.h:32,
                 from glib/gstring.c:37:
glib/gstring.c: In function ‘g_string_insert_len’:
glib/gstring.c:441:31: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
     g_return_val_if_fail (pos <= string->len, string);
                               ^~
glib/gmacros.h:455:25: note: in definition of macro ‘G_LIKELY’
 #define G_LIKELY(expr) (expr)
                         ^~~~
glib/gstring.c:441:5: note: in expansion of macro ‘g_return_val_if_fail’
     g_return_val_if_fail (pos <= string->len, string);
     ^~~~~~~~~~~~~~~~~~~~
glib/gstring.c:458:15: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
       if (pos < string->len)
               ^
glib/gstring.c:462:18: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘gssize’ {aka ‘long int’} [-Werror=sign-compare]
       if (offset < pos)
                  ^
In file included from glib/glibconfig.h:9,
                 from glib/gtypes.h:32,
                 from glib/gstring.h:32,
                 from glib/gstring.c:37:
glib/gmacros.h:351:26: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘long unsigned int’ [-Werror=sign-compare]
 #define MIN(a, b)  (((a) < (b)) ? (a) : (b))
                          ^
glib/gstring.c:464:22: note: in expansion of macro ‘MIN’
           precount = MIN (len, pos - offset);
                      ^~~
glib/gmacros.h:351:35: error: operand of ?: changes signedness from ‘gssize’ {aka ‘long int’} to ‘long unsigned int’ due to unsignedness of other operand [-Werror=sign-compare]
 #define MIN(a, b)  (((a) < (b)) ? (a) : (b))
                                   ^~~
glib/gstring.c:464:22: note: in expansion of macro ‘MIN’
           precount = MIN (len, pos - offset);
                      ^~~
glib/gstring.c:469:15: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
       if (len > precount)
               ^
glib/gstring.c:481:15: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
       if (pos < string->len)
               ^
In file included from glib/glibconfig.h:9,
                 from glib/gtypes.h:32,
                 from glib/gstring.h:32,
                 from glib/gstring.c:37:
glib/gstring.c: In function ‘g_string_insert_c’:
glib/gstring.c:782:31: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
     g_return_val_if_fail (pos <= string->len, string);
                               ^~
glib/gmacros.h:455:25: note: in definition of macro ‘G_LIKELY’
 #define G_LIKELY(expr) (expr)
                         ^~~~
glib/gstring.c:782:5: note: in expansion of macro ‘g_return_val_if_fail’
     g_return_val_if_fail (pos <= string->len, string);
     ^~~~~~~~~~~~~~~~~~~~
glib/gstring.c:785:11: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   if (pos < string->len)
           ^
In file included from glib/glibconfig.h:9,
                 from glib/gtypes.h:32,
                 from glib/gstring.h:32,
                 from glib/gstring.c:37:
glib/gstring.c: In function ‘g_string_insert_unichar’:
glib/gstring.c:857:31: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
     g_return_val_if_fail (pos <= string->len, string);
                               ^~
glib/gmacros.h:455:25: note: in definition of macro ‘G_LIKELY’
 #define G_LIKELY(expr) (expr)
                         ^~~~
glib/gstring.c:857:5: note: in expansion of macro ‘g_return_val_if_fail’
     g_return_val_if_fail (pos <= string->len, string);
     ^~~~~~~~~~~~~~~~~~~~
glib/gstring.c:860:11: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   if (pos < string->len)
           ^
In file included from glib/glibconfig.h:9,
                 from glib/gtypes.h:32,
                 from glib/gstring.h:32,
                 from glib/gstring.c:37:
glib/gstring.c: In function ‘g_string_erase’:
glib/gstring.c:969:29: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   g_return_val_if_fail (pos <= string->len, string);
                             ^~
glib/gmacros.h:455:25: note: in definition of macro ‘G_LIKELY’
 #define G_LIKELY(expr) (expr)
                         ^~~~
glib/gstring.c:969:3: note: in expansion of macro ‘g_return_val_if_fail’
   g_return_val_if_fail (pos <= string->len, string);
   ^~~~~~~~~~~~~~~~~~~~
glib/gstring.c:975:39: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
       g_return_val_if_fail (pos + len <= string->len, string);
                                       ^~
glib/gmacros.h:455:25: note: in definition of macro ‘G_LIKELY’
 #define G_LIKELY(expr) (expr)
                         ^~~~
glib/gstring.c:975:7: note: in expansion of macro ‘g_return_val_if_fail’
       g_return_val_if_fail (pos + len <= string->len, string);
       ^~~~~~~~~~~~~~~~~~~~
glib/gstring.c:977:21: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
       if (pos + len < string->len)
                     ^
2019-03-17 19:05:34 +01:00
Emmanuel Fleury
9f44506d28 Fixing various warnings in glib/gtimezone.c
glib/gtimezone.c: In function ‘g_time_zone_unref’:
glib/gtimezone.c:241:29: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
           for (idx = 0; idx < tz->t_info->len; idx++)
                             ^
In file included from glib/glibconfig.h:9,
                 from glib/gtypes.h:32,
                 from glib/gtimezone.h:27,
                 from glib/gtimezone.c:24:
glib/gtimezone.c: In function ‘init_zone_from_iana_info’:
glib/gtimezone.c:578:34: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
       g_assert (trans.info_index < gtz->t_info->len);
                                  ^
glib/gmacros.h:455:25: note: in definition of macro ‘G_LIKELY’
 #define G_LIKELY(expr) (expr)
                         ^~~~
glib/gtimezone.c:578:7: note: in expansion of macro ‘g_assert’
       g_assert (trans.info_index < gtz->t_info->len);
       ^~~~~~~~
glib/gtimezone.c: In function ‘find_relative_date’:
glib/gtimezone.c:859:22: error: comparison of integer expressions of different signedness: ‘GDateWeekday’ {aka ‘enum <anonymous>’} and ‘gint’ {aka ‘int’} [-Werror=sign-compare]
       if (first_wday > wday)
                      ^
glib/gtimezone.c: In function ‘init_zone_from_rules’:
glib/gtimezone.c:938:19: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
   for (ri = 0; ri < rules_num - 1; ri++)
                   ^
glib/gtimezone.c:958:19: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
   for (ri = 0; ri < rules_num - 1; ri++)
                   ^
glib/gtimezone.c: In function ‘g_time_zone_adjust_time’:
glib/gtimezone.c:1792:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
   for (i = 0; i <= intervals; i++)
                 ^~
glib/gtimezone.c:1825:39: error: comparison of integer expressions of different signedness: ‘gboolean’ {aka ‘int’} and ‘GTimeType’ {aka ‘enum <anonymous>’} [-Werror=sign-compare]
       else if (interval_isdst (tz, i) != type)
                                       ^~
glib/gtimezone.c:1832:22: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
           else if (i < intervals &&
                      ^
glib/gtimezone.c: In function ‘g_time_zone_find_interval’:
glib/gtimezone.c:1881:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
   for (i = 0; i <= intervals; i++)
                 ^~
glib/gtimezone.c:1900:35: error: comparison of integer expressions of different signedness: ‘gboolean’ {aka ‘int’} and ‘GTimeType’ {aka ‘enum <anonymous>’} [-Werror=sign-compare]
   else if (interval_isdst (tz, i) != type)
                                   ^~
glib/gtimezone.c:1905:18: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
       else if (i < intervals && time_ >= interval_local_start (tz, i + 1))
                  ^
2019-03-17 19:05:34 +01:00