Commit Graph

24296 Commits

Author SHA1 Message Date
Philip Withnall
942501bec7 gbitlock: Minor improvement to documentation formatting
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-03 15:15:34 +01:00
Philip Withnall
11cd751203 gbitlock: Drop unnecessary volatile qualifiers
This follows on from !1719. It drops volatile qualifiers on internal
functions in `gbitlock.c`, and casts volatile public arguments to
non-volatile versions to avoid the `g_atomic_*()` macros from
propagating the volatile qualifier.

We can’t drop the `volatile` qualifier from the public API in
`gbitlock.h`, as that would unfortunately be an API break.

Update the documentation in `gbitlock` to mention that users of the API
should not use `volatile`. See http://c.isvolatileusefulwiththreads.com/

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

Fixes: #2418
2021-06-03 15:15:21 +01:00
Philip Withnall
91759dbd63 tests: Ignore warning about use of volatile from a test for exactly that
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2418
2021-06-03 13:44:15 +01:00
Sebastian Dröge
fbcd653bd9 Merge branch '2414-wrap-code-example' into 'master'
docs: Wrap a code example more tightly to reduce minimum page width

Closes #2414

See merge request GNOME/glib!2129
2021-06-03 12:23:06 +00:00
Philip Withnall
e02b905b4b Revert "tests: Deactivate tls-bindings test suite for windows"
This reverts commit 7f2fef5c26.

There have been some changes to the gitlab-ci-win32-runner pre-clone
script which should be more successful at killing the remaining
processes after this test. See
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2008#note_1127126
2021-06-03 13:01:29 +01:00
Philip Withnall
be24b0c622 docs: Wrap a code example more tightly to reduce minimum page width
Otherwise the page has a horizontal scrollbar in Devhelp on some
machines.

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

Fixes: #2414
2021-06-03 12:52:51 +01:00
Philip Withnall
04739eb4fd Merge branch '2227-gdbus-nullability' into 'master'
gdbus: Add various missing (nullable) or (not nullable) annotations

See merge request GNOME/glib!2123
2021-06-03 09:17:28 +00:00
Philip Withnall
ac8f4a0db5 gdbus: Add various missing (nullable) or (not nullable) annotations
This is the result of checking each `Returns:` line in these files. I’ve
only considered nullability and not other (potentially missing or
incorrect) annotations.

Including suggestions by Simon McVittie.

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

Helps: #2227
2021-06-03 10:02:37 +01:00
Philip Withnall
89fe74fdc0 Merge branch 'master' into 'master'
gutils: ensure g_find_program_in_path() return an absolute path

See merge request GNOME/glib!2127
2021-06-02 12:57:46 +00:00
Luke Yue
3321fb561e tests: Add a test case for g_find_program_in_path()
Signed-off-by: Luke Yue <lukedyue@gmail.com>
2021-06-02 20:10:38 +08:00
Luke Yue
dba1fce993 gutils: ensure g_find_program_in_path() return an absolute path
Fix a possibility of returning a relative path, according to the
doc, the function should return an absolute path.

Signed-off-by: Luke Yue <lukedyue@gmail.com>
2021-06-02 20:10:38 +08:00
Philip Withnall
11c0b2e597 Merge branch 'pgriffis/pkcs11-password' into 'master'
gtlspassword: Add flags signifying PIN type for PKCS#11

See merge request GNOME/glib!2126
2021-06-02 10:06:06 +00:00
Michael Catanzaro
7a51163cf9 Merge branch 'feature/cert-info' into 'master'
tls: expose cert details on GTlsCertificate

See merge request GNOME/glib!2113
2021-06-01 20:25:21 +00:00
Patrick Griffis
e750f7a145 gtlspassword: Add flags signifying PIN type for PKCS#11
In a PKCS#11 operation there are multiple types of PINs possibly
needed and these flags add a way to expose them to the user.

This design exactly matches gnutls' gnutls_pin_flag_t API.
2021-06-01 14:56:56 -05:00
Philip Withnall
bc0d9376b7 Merge branch 'add_g_prefix_error_literal' into 'master'
Add g_prefix_error_literal()

Closes #663

See merge request GNOME/glib!2121
2021-06-01 19:08:16 +00:00
Emmanuel Fleury
1e90d9cd74 Add test case for g_prefix_error_literal() function 2021-06-01 19:00:37 +02:00
Ross A. Wollman
a17c28790a tls: expose cert details on GTlsCertificate
This changeset exposes

* `not-valid-before`
* `not-valid-after`
* `subject-name`
* `issuer-name`

on GTlsCertificate provided by the underlying TLS Backend.

In order to make use of these changes,
see the related [glib-networking MR][glib-networking].

This change aims to help populate more of the [`Certificate`][wk-cert]
info in the WebKit Inspector Protocol on Linux.

This changeset stems from work in Microsoft Playwright to [add more info
into its HAR capture][pw] generated from the Inspector Protocol events
and will bring feature parity across WebKit platforms.

[wk-cert]: 8afe31a018/Source/JavaScriptCore/inspector/protocol/Security.json
[pw]: https://github.com/microsoft/playwright/pull/6631
[glib-networking]: https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/156
2021-06-01 16:24:33 +00:00
Philip Withnall
94e90422b9 Merge branch 'new_patch' into 'master'
gobject: Allow passing %NULL for @data in g_object_remove_toggle_ref

Closes #817

See merge request GNOME/glib!2117
2021-06-01 14:31:13 +00:00
Yaron Shahrabani
9bb69aff63 Update Hebrew translation 2021-05-28 19:58:35 +00:00
Dan Williams
9cb1bb0fb2 Add g_prefix_error_literal()
Because sometimes you don't want a lone "%s", and you don't
want the compiler yelling at you about format strings that
don't have any format in them.

Closes #663
2021-05-28 17:15:46 +02:00
Sebastian Dröge
0d7f3e74e0 Merge branch '399-dlerror-thread-safety' into 'master'
gmodule: Add locking around dlerror() for some libc implementations

Closes #399

See merge request GNOME/glib!2122
2021-05-28 10:02:59 +00:00
Philip Withnall
483843c282 gmodule: Add locking around dlerror() for some libc implementations
Specifically, for uclibc at the moment. Other implementations may need
locking, but I haven’t checked any aside from uclibc-ng and glibc.

POSIX.1-2001 specifies that `dlerror()` is not thread-safe, but the
glibc (and likely other libc) implementation is.

Issue #399 was originally reported about eglibc, but that project has
since died and been merged back into glibc. So that’s one less thing to
worry about.

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

Fixes: #399
2021-05-28 09:58:21 +01:00
Jasper St. Pierre
edb40c7171 gobject: Allow passing %NULL for @data in g_object_remove_toggle_ref
gjs has some situations where it's not always aware of the @data that
was passed into g_object_add_toggle_ref, so allow passing %NULL to
just match on @notify.

Rebased and updated by Nitin Wartkar

Closes #817
2021-05-27 21:09:45 +05:30
Philip Withnall
73a78f7470 gmodule: Add some missing consts
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-05-27 13:46:28 +01:00
Philip Withnall
0c8740dc83 Merge branch 'fix_more_warnings' into 'master'
Fix more warnings

See merge request GNOME/glib!2106
2021-05-27 10:00:28 +00:00
Emmanuel Fleury
bf536a5ce2 Fix incompatible pointer to integer conversion warning in glib/tests/atomic.c
lib/tests/atomic.c:115:9: warning: incompatible pointer to integer conversion passing 'void *' to parameter of type 'gsize' (aka 'unsigned long')
  res = g_atomic_pointer_compare_and_exchange (&gs, NULL, NULL);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
glib/gatomic.h:225:34: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
                                 (newval), FALSE,                            \
                                 ^~~~~~~~
2021-05-27 10:16:52 +02:00
Emmanuel Fleury
2b4bf535f1 Fix discard qualifier warning in glib/tests/atomic.c
glib/tests/atomic.c:132:18: warning: passing 'typeof (*(cspp)) *' (aka 'const int *const *') to parameter of type 'const gint **' (aka 'const int **') discards qualifiers
  g_assert_true (g_atomic_pointer_get (cspp) == csp);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
glib/gatomic.h:117:38: note: expanded from macro 'g_atomic_pointer_get'
    __atomic_load (gapg_temp_atomic, (&(gapg_temp_newval)), __ATOMIC_SEQ_CST); \
                                     ^~~~~~~~~~~~~~~~~~~~~
2021-05-27 10:16:52 +02:00
Emmanuel Fleury
a369efd207 Fix missing initializer warning in tests/slice-threadinit.c
tests/slice-threadinit.c:34:30: warning: missing field 'sample' initializer
} pages[N_PAGES] = { { NULL, }, };
                             ^
2021-05-27 10:16:52 +02:00
Emmanuel Fleury
aace697d7e Fix missing initializer warning in gio/tests/gdbus-exit-on-close.c
gio/tests/gdbus-exit-on-close.c:52:14: warning: missing field 'bug' initializer
      { NULL }
             ^
2021-05-27 10:16:52 +02:00
Emmanuel Fleury
652a7b7db1 Fix missing initializer warnings in gio/tests/socket.c
gio/tests/socket.c:505:36: warning: missing field 'size' initializer
    GOutputVector v[7] = { { NULL, }, };
                                   ^
gio/tests/socket.c:630:37: warning: missing field 'vectors' initializer
    GOutputMessage m[3] = { { NULL, }, };
                                    ^
gio/tests/socket.c:631:37: warning: missing field 'vectors' initializer
    GInputMessage im[3] = { { NULL, }, };
                                    ^
gio/tests/socket.c:632:36: warning: missing field 'size' initializer
    GOutputVector v[7] = { { NULL, }, };
                                   ^
gio/tests/socket.c:633:36: warning: missing field 'size' initializer
    GInputVector iv[7] = { { NULL, }, };
                                   ^
gio/tests/socket.c:871:32: warning: missing field 'vectors' initializer
    GInputMessage im = { NULL, };
                               ^
gio/tests/socket.c:872:31: warning: missing field 'size' initializer
    GInputVector iv = { NULL, };
                              ^
2021-05-27 10:16:52 +02:00
Emmanuel Fleury
bee07cebcd Fix missing initializer warning in gobject/gtype.c
gobject/gtype.c:1103:55: warning: missing field 'value_free' initializer
          static const GTypeValueTable zero_vtable = { NULL, };
                                                             ^
2021-05-27 10:16:52 +02:00
Philip Withnall
4575c70a6b Merge branch 'strv_builder_add_many' into 'master'
gstrvbuilder: add addv and add_many to the API

See merge request GNOME/glib!2112
2021-05-26 12:41:19 +00:00
alex-tee
232b40da7b gstrvbuilder: add addv and add_many to the API 2021-05-26 12:41:18 +00:00
Xavier Claessens
090d65712d glib_typeof: Move definition to its own header
It is cleaner to define glib_typeof() in a header included after
gversionmacros.h so we can use GLIB_VERSION_MIN_REQUIRED directly
instead of doing it everywhere glib_typeof() is used.
2021-05-17 12:07:30 -04:00
Peter Bloomfield
955307208f gapplication: Guard g_application_mark_busy()
The `GApplication` must be registered before calling
`g_application_mark_busy()`. Document that, and add a guard.

The same is true for `g_application_unmark_busy()`, but the existing
documentation and guard for `busy_count > 0` are enough.
2021-05-17 11:50:12 -04:00
Philip Withnall
d64d46dc42 Merge branch 'macos-static-libintl' into 'master'
meson: Fix detection of static libintl on macOS

See merge request GNOME/glib!2109
2021-05-17 14:07:44 +00:00
Philip Withnall
f71faad46b Merge branch 'th/gdbus-doc-unsubscribe-idle' into 'master'
gdbus: document completion after idle action for g_dbus_connection_signal_unsubscribe()

See merge request GNOME/glib!2050
2021-05-17 10:49:38 +00:00
Philip Withnall
62571c71b5 Merge branch 'Docs' into 'master'
docs: Improved documentation of GNotification

Closes #2405

See merge request GNOME/glib!2102
2021-05-17 10:30:55 +00:00
Nitin Wartkar
e727a69a8b docs: Improved documentation of GNotification 2021-05-17 10:30:54 +00:00
Philip Withnall
b4522e680c Merge branch 'helper-getters' into 'master'
docs: Improved the docs of helper getters optimization in g_file_info.c

Closes #310

See merge request GNOME/glib!2107
2021-05-17 09:29:13 +00:00
nitinosiris
69be87dda1 docs: Improved the docs of helper getters optimization in g_file_info.c
g_file_info_get_name() gives result faster than g_file_info_get_attribute_byte_string()

Closes #310
2021-05-17 14:26:17 +05:30
Jonas Hahnfeld
c6ce891376 meson: Fix detection of static libintl on macOS
If libintl is built statically on macOS, linking it requires passing
"-framework CoreFoundation" to satisfy symbol dependencies. Use the
available osx_ldflags already detected earlier in the process.
2021-05-16 11:58:26 +02:00
Philip Withnall
c3b11c64ee Merge branch 'test-F_DUPFD_CLOEXEC' into 'master'
glib spawn-singlethread test only if F_DUPFD_CLOEXEC is defined

See merge request GNOME/glib!2108
2021-05-14 18:51:49 +00:00
Claes Nästén
d3207660bb glib spawn-singlethread test only if F_DUPFD_CLOEXEC is defined
F_DUPFD_CLOEXEC is not available on Solaris 10, no need to fail the
build instead skip the test as on non Unix platforms already.
2021-05-14 20:24:10 +02:00
Philip Withnall
e944cf8b1c Merge branch 'bookmarkfile-crash' into 'master'
gbookmarkfile: Don't crash if we're not visited

See merge request GNOME/glib!1514
2021-05-13 22:33:40 +00:00
Philip Withnall
87e994ef48 Merge branch '1036-dbus-proxy-docs' into 'master'
gdbusproxy: Recommend it is not used for stateless services

Closes #1036

See merge request GNOME/glib!386
2021-05-13 22:25:21 +00:00
Emmanuele Bassi
2910ffd383 Merge branch 'test-bug-numbers' into 'master'
tests: Drop use of g_test_bug_base()

See merge request GNOME/glib!2104
2021-05-13 21:56:15 +00:00
Philip Withnall
447f727284 tests: Use a temporary file in the bookmarkfile tests
Rather than always writing to `out.xbel` in the build directory, which
could cause issues when running tests in parallel, or expecting the
tests to not touch the build directory.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-05-13 22:53:38 +01:00
Matthias Clasen
f3e65b1af7 gbookmarkfile: Don't crash if we're not visited
Rewrite bookmark_item_dump to not crash if any of
the timestamps is NULL. Also, avoid some of the gratitious
extra string copying.

Tweaked by Philip Withnall to pass the unit tests.
2021-05-13 22:50:34 +01:00
Philip Withnall
43c28fcd5a gdbusproxy: Recommend it is not used for stateless services
For the reasons given in the new bit of documentation, GDBusProxy should
not be used for connecting to stateless D-Bus services which may be
restarted at any point.

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

https://gitlab.gnome.org/GNOME/glib/issues/1036
2021-05-13 22:24:26 +01:00