Commit Graph

27100 Commits

Author SHA1 Message Date
Matthias Clasen
e03a96e934 actiongroup: Add a compiler warning
Warn when the boolean return isn't used, since we may not initialize
the out arguments in the FALSE case. Update all internal callers to
use the return value. They were already safe, but users outside GLib
may not be.
2023-04-07 08:44:29 -04:00
Philip Withnall
adcf017eb4 Merge branch 'gwin32-avoid-g-return-macro' into 'main'
gwin32: Avoid use of function call with side effect in g_return_* macro

See merge request GNOME/glib!3365
2023-04-06 13:51:38 +00:00
Kleis Auke Wolthuizen
86ef92d548 gwin32: Avoid use of function call with side effect in g_return_* macro
This ensures that _g_win32_call_rtl_version is always called,
regardless of whether G_DISABLE_CHECKS is defined or not.
2023-04-06 15:19:35 +02:00
Marco Trevisan
9ec6695a72 Merge branch 'drop-gitignore' into 'main'
build: Drop old .gitignore files from test directories

See merge request GNOME/glib!3333
2023-04-05 14:29:13 +00:00
Marco Trevisan
66d9ab7808 Merge branch '2952-pollable-docs' into 'main'
gpollable: Clarify that can_poll() must be called before other methods

Closes #2952

See merge request GNOME/glib!3348
2023-04-05 14:27:07 +00:00
Marco Trevisan
218daa079e Merge branch '2960-debug-controller-docs' into 'main'
gdebugcontrollerdbus: Fix incorrect paragraph on auth in documentation

Closes #2960

See merge request GNOME/glib!3354
2023-04-05 14:24:50 +00:00
Marco Trevisan
34dc240322 Merge branch '2864-gvalue-docs' into 'main'
gvalue: Fix a typo in a function name in an example in the docs

Closes #2864

See merge request GNOME/glib!3349
2023-04-05 14:17:48 +00:00
Marco Trevisan
913f206b30 Merge branch 'make_clang_happier' into 'main'
Make clang++ happier when using G_STATIC_ASSERT

See merge request GNOME/glib!3357
2023-04-05 14:16:06 +00:00
Philip Withnall
a6f31f3ede Merge branch 'fix-issue-2972' into 'main'
GWin32AppInfo: Fix g_str_has_prefix() check

Closes #2972

See merge request GNOME/glib!3359
2023-04-05 14:09:53 +00:00
Luca Bacci
65e2413dd5 GWin32AppInfo: Fix g_str_has_prefix() check
Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2972
2023-04-05 13:50:23 +02:00
Albert Astals Cid
925d2b3b1f Make clang++ happier when using G_STATIC_ASSERT
clang++ says it supports _Static_assert but then will
complain that it's a C11 extension and that you should not use
it in C++ code (which imho is fair enough)

So try to detect a C++ compiler first and then the C compiler,
similarly to what is done for the G_NORETURN case
2023-04-01 11:35:25 +02:00
Alexander Shopov
4263cd8cbb Update Bulgarian translation 2023-03-31 10:00:41 +00:00
Philip Withnall
eb94540f4c Merge branch 'sam/goptioncontext-docs' into 'main'
Link goption documentation to GOptionContext type

Closes #2953

See merge request GNOME/glib!3350
2023-03-29 14:21:25 +00:00
Philip Withnall
224e4e53e2 gdebugcontrollerdbus: Fix incorrect paragraph on auth in documentation
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2960
2023-03-29 14:05:43 +01:00
Boyuan Yang
c051fc483f Update Chinese (China) translation 2023-03-26 19:14:34 +00:00
Sam Thursfield
2d216d4d8c Link goption documentation to GOptionContext type
This makes the goption overview visible in the gi-docgen docs as part of
the GOptionContext type. Previously it was not visible anywhere.

Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2953
2023-03-23 14:01:45 +00:00
Philip Withnall
3504385eba gvalue: Fix a typo in a function name in an example in the docs
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2864
2023-03-23 12:24:33 +00:00
Philip Withnall
e2d06873f9 gpollable: Clarify that can_poll() must be called before other methods
Both `GPollableInputStream` and `GPollableOutputStream` are dynamic
interfaces, in that their implementation on a class may only be
functional if certain prerequisites are met at runtime. For example,
a `GConverterInputStream` is only pollable if its base stream is
pollable, and that’s determined at runtime rather than compile time.

As such, both interfaces have a `can_poll()` method. If that method
returns `FALSE`, the behaviour of all other methods on the interface is
undefined.

That was mentioned in the documentation for `can_poll()`, but not any of
the other documentation for the interfaces, which made it a bit hard to
find.

Mention it more widely.

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

Fixes: #2952
2023-03-23 12:08:08 +00:00
Marco Trevisan
bd63436fad Merge branch 'default-branch-docs' into 'main'
docs: Drop section about default branch renaming from README.md

See merge request GNOME/glib!3345
2023-03-22 15:09:58 +00:00
Marco Trevisan
0be2555704 Merge branch 'drop-check-abis' into 'main'
tools: Drop check-abis.sh script

See merge request GNOME/glib!3344
2023-03-22 13:13:07 +00:00
Philip Withnall
9970ee1c97 docs: Drop section about default branch renaming from README.md
It’s been there for 2 years (since commit d81165216d), people have
probably got the message by now.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-22 12:53:05 +00:00
Philip Withnall
180713772f
2.76.1
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-22 11:28:01 +00:00
Philip Withnall
077b87aa9c tools: Drop check-abis.sh script
It hasn’t been used for years, and isn’t really needed since we changed
to explicitly exporting symbols (using `GLIB_AVAILABLE_IN_*`) rather than
implicitly exporting them unless they were hidden.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-22 10:44:01 +00:00
Danial Behzadi
babd275330 Update Persian translation 2023-03-22 10:34:36 +00:00
Philip Withnall
2aaa3250c9 Merge branch '2907-revert-gfileinfo-criticals' into 'main'
gfileinfo: Temporarily downgrade missing attribute criticals to debugs

See merge request GNOME/glib!3338
2023-03-21 16:15:37 +00:00
Philip Withnall
4cad66580b gfileinfo: Temporarily downgrade missing attribute criticals to debugs
This partially reverts ed8e86a7d4.

The change to add the criticals (commit ed8e86a7d4) is correct, but
landed too late in the cycle. Let’s downgrade the criticals to debugs
for now, to stop applications seeing a lot of new criticals in their
output. Those criticals are particularly disruptive for command line
applications and unit tests.

Early in the next cycle, the debugs will be re-upgraded to criticals.
This will give applications a whole additional cycle to fix their
ambiguous use of API.

It turned out that a lot of applications have latent bugs around
calling `g_file_info_get_*()` without checking whether an attribute
is set first, and were hence relying on the ‘unknown’ return value
also being an appropriate default for them.

This was compounded by the fact that several non-local GVFS backends
were not setting `GFileInfo` attributes all the time, which caused the
‘missing attribute’ code path to be hit more frequently. For example,
they would only call `g_file_info_set_is_hidden()` with a true value and
never bother with a false one.

It was further compounded by the fact that, while this change landed for
the 2.75.4 release, there did not seem to be extensive integration
testing of that release, and distributions and downstreams went straight
to 2.76.0. That meant we missed the window between 2.75.4 and 2.76.0 to
change, fix or revert this behaviour. GLib relies on distros and
downstreams doing integration testing of unstable releases. We test with
downstream GNOME as part of gnome-build-meta, but do not have the
resources to do integration testing for everybody.

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

See: #2907
See: #2932
See: #2934
See: #2945
See: #2948
2023-03-21 15:01:10 +00:00
Philip Withnall
2630b7d2d5 Merge branch '352-file-enumerator-docs' into 'main'
gfileenumerator: Clarify termination condition for next_files_async()

Closes #352

See merge request GNOME/glib!3339
2023-03-21 14:58:45 +00:00
Marco Trevisan
076e656f30 Merge branch 'strfuncs-check-results' into 'main'
tests: Check a few results in strfuncs tests

See merge request GNOME/glib!3330
2023-03-21 14:52:59 +00:00
Marco Trevisan
8d0c92e65e Merge branch '159-strstr-len-docs' into 'main'
gstrfuncs: Clarify haystack_len behaviour of g_strstr_len()

Closes #159

See merge request GNOME/glib!3331
2023-03-21 14:52:16 +00:00
Marco Trevisan
fc5fc89841 Merge branch '2948-gio-is-hidden' into 'main'
gio: Add some missing file info attribute checks in gio-list and gio-tree

Closes #2948

See merge request GNOME/glib!3336
2023-03-21 14:47:47 +00:00
Philip Withnall
a046492a19 gfileenumerator: Add an example of using next_files_async() to the docs
This is written in pseudocode C which omits all the callback boilerplate
for the async calls. This should hopefully make the overall structure of
the loop more obvious.

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

Helps: #352
2023-03-21 14:07:08 +00:00
Owen Taylor
67a9367598 gfileenumerator: Clarify termination condition for next_files_async()
As suggested on #352 by Owen Taylor (commit put together by Philip
Withnall, but in Owen’s name as it’s his wording).

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

Fixes: #352
2023-03-21 13:56:52 +00:00
Philip Withnall
2953c08261 gfileinfo: Zero GTimeVal when failing g_file_info_get_modification_time()
Before commit ed8e86a7d4, this function would have silently returned a
zero-valued `GTimeVal` if the correct attributes weren’t present.

That partially regressed in commit ed8e86a7d4, which made it return with
a critical warning, but without zeroing the `GTimeVal`. The critical
warning can be ignored by users (it doesn’t abort the process unless
`G_DEBUG=fatal-criticals` is set), but the change in behaviour of
zeroing the `GTimeVal` could cause bugs.

See: #2907

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-21 12:15:50 +00:00
Philip Withnall
2029d7e900 gpollfilemonitor: Add missing attribute checks for g_file_info_get_size()
Missed from the fixes for #2907.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-21 12:15:50 +00:00
Philip Withnall
4ba3470269 gio: Add some missing file info attribute checks in gio-list and gio-tree
Further fallout from #2907.

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

Fixes: #2948
2023-03-21 12:15:50 +00:00
Philip Withnall
23a009b2cb Merge branch '919-variant-dict-lookup-docs' into 'main'
gvariant: Document failure behaviour of g_variant_dict_lookup() better

Closes #919

See merge request GNOME/glib!3334
2023-03-21 12:07:20 +00:00
Philip Withnall
7d090d1510 gvariant: Document failure behaviour of g_variant_dict_lookup() better
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #919
2023-03-20 12:16:54 +00:00
Philip Withnall
3d7e88a77d build: Drop old .gitignore files from test directories
They just listed built files. Since the move to Meson, these are all
kept in a separate build directory, not the source tree, so don’t need
to be ignored.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-20 12:09:02 +00:00
Philip Withnall
7dfde773f6 gstrfuncs: Clarify haystack_len behaviour of g_strstr_len()
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #159
2023-03-20 11:55:53 +00:00
Philip Withnall
5fdacf78e2 tests: Check a few results in strfuncs tests
This fixes some written-but-never-read warnings from `scan-build`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-20 10:43:25 +00:00
Emmanuele Bassi
e979fd9a15 Merge branch '2943-g-test-init-docs' into 'main'
gtestutils: Clarify docs about calling g_test_init() before anything

Closes #2943

See merge request GNOME/glib!3327
2023-03-17 11:29:29 +00:00
Philip Withnall
045bc7adde gtestutils: Clarify docs about calling g_test_init() before anything
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2943
2023-03-17 11:03:09 +00:00
Philip Withnall
98a567ce7f Merge branch 'queue-test' into 'main'
tests: Reduce number of iterations in queue test

See merge request GNOME/glib!3324
2023-03-16 17:45:22 +00:00
Philip Withnall
790fbfab4c Merge branch 'xry111/issue2936' into 'main'
gstrfuncs: Improve inline version of g_strdup() to avoid breaking C++ code

Closes #2936

See merge request GNOME/glib!3322
2023-03-16 12:13:10 +00:00
Philip Withnall
9d7c796f1e Merge branch 'fix-monitor-root-directory-fail' into 'main'
inotify: Avoid empty root directory string

See merge request GNOME/glib!3241
2023-03-16 12:12:01 +00:00
Philip Withnall
eff90c09f5 tests: Simplify a helper function in queue test
Remove an unnecessary intermediate variable.

This introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-16 12:05:07 +00:00
Philip Withnall
ea852e2683 tests: Fix signed/unsigned comparisons and assignments in queue test
This introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-16 12:05:07 +00:00
Philip Withnall
2d89f84267 tests: Reduce number of iterations in queue test
Unless `-m thorough` is passed to the tests, reduce the number of
iterations in the random test.

This one test case takes the bulk of the time to run the `queue` test
suite, and is sometimes causing timeouts when running on CI
(particularly under valgrind). Reduce it to a fifth.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-16 12:05:07 +00:00
Philip Withnall
1f6a4d60d4 tests: Add copyright/licensing header to queue tests
This is put together through git archaeology:
```
git log glib/tests/queue.c
git log -- tests/queue-test.c
```

The following commits were too trivial to have meaningful copyright:
 - 8f02fac4ad
 - d81ac5339f
 - 29f2ced8eb
 - 1a2c5e155d
 - 8a90f5e9f6
 - 45dae4b506
 - 2aa71ab63b
 - 3a74ad128e

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

Helps: #1415
2023-03-16 12:05:07 +00:00
Philip Withnall
8b25142cb2 tests: Use g_assert_*() rather than g_assert() in queue tests
It won’t get compiled out with `G_DISABLE_ASSERT`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-16 12:05:07 +00:00