Commit Graph

19942 Commits

Author SHA1 Message Date
Philip Withnall
49b807c022 gsocket: Remove (type) annotation from flags arguments
This is essentially a revert of commit
cc7f2f6b28. While those `flags` arguments
do accept values of type GSocketMsgFlags, they also accept OS-specific
flags which are not defined in GSocketMsgFlags.

The use of (type GSocketMsgFlags) makes language bindings like GJS
rightfully assert that values passed in to the argument only contain
flags from GSocketMsgFlags, which precludes the use of OS-specific
flags, and hence breaks various bits of code.

See https://gitlab.gnome.org/GNOME/gjs/issues/227#note_460136 and
https://gitlab.gnome.org/GNOME/glib/merge_requests/710#note_460249.

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

Fixes: https://gitlab.gnome.org/GNOME/gjs/issues/227
2019-03-15 10:28:14 +00:00
Philip Withnall
00c129f8eb Merge branch 'fix-network-available-check' into 'master'
Handle an UNKNOWN NetworkManager connectivity as NONE

See merge request GNOME/glib!719
2019-03-15 10:03:54 +00:00
Nirbheek Chauhan
3c44026dc4 Merge branch 'gosxappinfo-fix' into 'master'
build: install gosxappinfo.h on macOS

Closes #1725

See merge request GNOME/glib!725
2019-03-14 08:26:35 +00:00
Tom Schoonjans
32d012f5a9 build: install gosxappinfo.h on macOS
Closes #1725
2019-03-14 08:09:09 +00:00
Philip Withnall
e1ffb9ddb4 Merge branch 'examples-for-gnuc-macros' into 'master'
Provide examples for GNUC attribute macros

See merge request GNOME/glib!723
2019-03-13 16:18:55 +00:00
Simon McVittie
1e3793546d Provide examples for GNUC attribute macros
It isn't always obvious how and where to use these. Where possible I've
chosen real examples from GLib, preferring simple examples that
developers considering using these macros have hopefully already seen.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-03-13 15:45:23 +00:00
Simon McVittie
b94a0fc2b4 appinfo: Fix documentation cross-reference
g_app_info_launch_default_for_uri() should link to _async() as an alternative, not to itself.
2019-03-13 14:52:10 +00:00
Simon McVittie
8ec492ba4e Merge branch 'g-gnuc-unused-docs' into 'master'
Improve formatting of GCC attribute documentation

See merge request GNOME/glib!717
2019-03-13 14:46:03 +00:00
Simon McVittie
7f38dfcb6c Merge branch 'codegen-interface-info-fix' into 'master'
codegen: Fix use of uninitialised variable

See merge request GNOME/glib!721
2019-03-13 13:47:53 +00:00
Philip Withnall
5649255351 codegen: Fix use of uninitialised variable
If using the --interface-info-{body,header} options to gdbus-codegen,
and the first interface to be outputted has no methods, but does have
properties or signals, an uninitialised variable would be used for the
property/signal ‘since’ values.

In other situations, the ‘since’ value for a prior method would have
been incorrectly used for the properties/signals.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-13 13:13:24 +00:00
Philip Withnall
841634675c Merge branch 'lrn/gnulib-printf' into 'master'
glib: update internal gnulib from upstream

See merge request GNOME/glib!67
2019-03-13 12:53:33 +00:00
Руслан Ижбулатов
4081b0b623 Add the gnulib adaptation patch 2019-03-13 12:38:42 +00:00
Руслан Ижбулатов
8f27aa9965 glib: update internal gnulib from upstream
https://bugzilla.gnome.org/show_bug.cgi?id=795569

Related to issue #1371.
2019-03-13 12:38:42 +00:00
Philip Withnall
df62731771 Merge branch 'win32-symlink-refactoring' into 'master'
Win32 symlink code refactoring

See merge request GNOME/glib!269
2019-03-13 11:55:27 +00:00
Philip Withnall
c27eac871f Merge branch 'option' into 'master'
Introduce oss_fuzz feature option

Closes #1724

See merge request GNOME/glib!720
2019-03-13 11:47:36 +00:00
pdknsk
92043cf077 Introduce oss_fuzz feature option 2019-03-13 11:47:36 +00:00
2932a58cd5 Handle an UNKNOWN NetworkManager connectivity as NONE
nm_conn_to_g_conn already handles UNKNOWN like NONE (returning
G_NETWORK_CONNECTIVITY_LOCAL in both cases). So in sync_properties
we should also set new_connectivity to G_NETWORK_CONNECTIVITY_LOCAL
for both NM_CONNECTIVITY_UNKNOWN and NM_CONNECTIVITY_NONE.

This has the added benefit that when NetworkManager returns the network
connectivity is UNKNOWN, we set network_available to FALSE as it should
be. Previously, there were cases in a laptop with no network access,
that g_network_monitor_get_network_available returned true, which was
wrong and is also fixed with this commit.
2019-03-12 18:39:42 +01:00
Nathan Follens
1a03ebc43a Update Dutch translation 2019-03-10 13:03:39 +00:00
Philip Withnall
3e7baaae23 Merge branch '1708-build-with-g-disable-assert' into 'master'
Fix build with G_DISABLE_ASSERT defined

Closes #1708

See merge request GNOME/glib!705
2019-03-08 19:59:36 +00:00
Philip Withnall
3d3ca9f1fe gobject: Fix various compiler warnings when compiling with G_DISABLE_ASSERT
Mostly unused variables which are only used in a g_assert() call
otherwise.

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

Helps: #1708
2019-03-08 19:46:21 +00:00
Philip Withnall
faa1d63cab glib: Fix various compiler warnings when compiling with G_DISABLE_ASSERT
Mostly unused variables which are only used in a g_assert() call
otherwise.

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

Helps: #1708
2019-03-08 19:46:21 +00:00
Philip Withnall
1b50643c99 gio: Fix various compiler warnings when compiling with G_DISABLE_ASSERT
Mostly unused variables which are only used in a g_assert() call
otherwise.

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

Helps: #1708
2019-03-08 19:46:21 +00:00
Philip Withnall
9ce76b97f1 ci: Add a build with G_DISABLE_ASSERT defined
We want GLib to build correctly with this defined, and for all its tests
to still pass.

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

Helps: #1708
2019-03-08 19:46:21 +00:00
Philip Withnall
8f2365dc8a gtestutils: Call __builtin_undefined() from g_assert_not_reached()
Both GCC and Clang treat this as a hint that the code won’t be reached,
which helps in the cases where they might not have automatically
detected it already.

It doesn’t change any behaviour of the compiled code, other than
allowing the compiler to go off into undefined behaviour.

See
https://gcc.gnu.org/onlinedocs/gcc-8.3.0/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005funreachable.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:21 +00:00
Philip Withnall
57a806b762 tests: Convert g_assert() to g_assert_*() in glib/tests/rand.c
g_assert_*() give more informative failure messages, and aren’t compiled
out when building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:21 +00:00
Philip Withnall
ba84f45f96 tests: Convert g_assert() to g_assert_*() in glib/tests/mappedfile.c
g_assert_*() give more informative failure messages, and aren’t compiled
out when building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:20 +00:00
Philip Withnall
a1aebf7437 tests: Convert g_assert() to g_assert_*() in glib/tests/mainloop.c
g_assert_*() give more informative failure messages, and aren’t compiled
out when building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:20 +00:00
Philip Withnall
3a96e7d9cb tests: Convert g_assert() to g_assert_*() in glib/tests/asyncqueue.c
g_assert_*() give more informative failure messages, and aren’t compiled
out when building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:20 +00:00
Philip Withnall
277c42ddc0 tests: Convert g_assert() to g_assert_*() in gio/tests/gsubprocess.c
g_assert_*() give more informative failure messages, and aren’t compiled
out when building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:20 +00:00
Philip Withnall
6a724d9ccd tests: Convert g_assert() to g_assert_*() in gio/tests/actions.c
g_assert_*() give more informative failure messages, and aren’t compiled
out when building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:20 +00:00
Philip Withnall
d89f18bb22 build: Add -UG_DISABLE_ASSERT when building tests
In order to allow GLib itself to be built with G_DISABLE_ASSERT defined,
we need to explicitly undefine it when building the tests, otherwise
g_test_init() turns into an abort.

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

Fixes: #1708
2019-03-08 19:46:20 +00:00
Philip Withnall
a2a17a978a gmacros: Improve documentation of GCC attributes
Link to the GCC documentation pages, and format the attribute names as
code.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:21:39 +00:00
Philip Withnall
e03a2c8633 glib: Move various documentation comments from docs.c to macros.h
Move them next to their definitions, so they’re more likely to be kept
up to date.

This doesn’t modify any of the documentation comments at all.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:10:32 +00:00
Simon McVittie
f3610f14c4 Merge branch '1712-gdbus-proxy-flaky' into 'master'
Minor improvements to gdbus-proxy test

Closes #1712

See merge request GNOME/glib!715
2019-03-07 15:12:30 +00:00
Philip Withnall
49642bfeb2 glib.supp: Add a calloc() variant of an existing suppression
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-07 13:58:11 +00:00
Philip Withnall
3d4a168715 tests: Fix some larger memory leaks in gdbus-proxy
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-07 13:57:38 +00:00
Philip Withnall
938f716c2f tests: Fix a minor memory leak in gdbus-proxy
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-07 13:04:12 +00:00
Philip Withnall
196e333ec2 tests: Use g_assert_*() instead of g_assert() in gdbus-proxy
g_assert_*() give more informative error messages on failure, and can’t
be disabled by G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-07 13:03:40 +00:00
Matthias Clasen
23a99f71cc Merge branch '1177-quark-not-cxx-globals-docs' into 'master'
gquark: Document that some functions can’t initialise C++ globals

Closes #1177

See merge request GNOME/glib!714
2019-03-07 12:10:19 +00:00
Sebastian Dröge
aedd484b92 Merge branch '682-object-set-data-docs' into 'master'
gobject: Mention quark memory usage for g_object_set_data()

Closes #682

See merge request GNOME/glib!713
2019-03-07 11:50:27 +00:00
Philip Withnall
a66ae5cda3 gquark: Document that some functions can’t initialise C++ globals
Any function which requires g_quark_init() to have been called first
cannot be called before the library constructors have finished running.
In particular, this means that g_quark_from_static_string() or
g_intern_static_string() can’t be used to initialize C++ globals.

Do this, rather than adding a conditional call to g_quark_init() to all
these functions, because such a call was previously removed from the
functions to improve performance (quarks are used a lot in the
implementation of GObject for properties and signals). That’s the reason
why g_quark_init() was originally moved out to a library constructor.

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

Fixes: #1177
2019-03-07 11:12:01 +00:00
Philip Withnall
b8a58b7cae Merge branch 'fix-comment-gwin32' into 'master'
gwin32: Fix comment for g_win32_veh_handler

See merge request GNOME/glib!712
2019-03-07 11:03:30 +00:00
Philip Withnall
2a570dc5af gobject: Mention quark memory usage for g_object_set_data()
g_object_set_data() should only ever be used with a small, bounded set
of keys, or the memory usage of the quark lookup table will grow
unbounded. Document that.

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

Fixes: #682
2019-03-07 10:56:47 +00:00
Andrea Azzarone
7bc21392e1 gwin32: Fix comment for g_win32_veh_handler 2019-03-07 10:38:24 +00:00
Sebastian Dröge
c9c88a4b22 Merge branch 'fix-gjs-issue-227' into 'master'
socket: Fix annotation for flags in g_socket_receive_message

Closes gjs#227

See merge request GNOME/glib!710
2019-03-06 20:34:15 +00:00
Andrea Azzarone
d1cb974932 socket: Fix annotation for flags in g_socket_receive_message
Closes: https://gitlab.gnome.org/GNOME/gjs/issues/227
2019-03-06 18:16:52 +00:00
Philip Withnall
62bd79b6a2 Merge branch 'tdr' into 'master'
Fix data races in task test and gmenumodel test

See merge request GNOME/glib!706
2019-03-06 13:53:24 +00:00
Tomasz Miąsko
330f8999a8 tests: Fix data race in task test
Ensure that all tasks have already completed before accessing buf array
from main thread to avoid conflicting data access from multiple threads.
2019-03-06 14:21:13 +01:00
Emmanuele Bassi
7644b6a368 Merge branch 'api-tags' into 'master'
Bump release version for 2.62 series

See merge request GNOME/glib!709
2019-03-06 12:30:12 +00:00
Philip Withnall
6761bb2f57 build: Factor out common gtkdoc flags
Those lists were getting very long. We can’t quite entirely automate the
list generation since Meson doesn’t have a range() function, but we can
at least combine three of them into one.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-06 11:59:03 +00:00