summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'ebassi/task-pretty-print-ignore-gir' into 'main'HEADmainPhilip Withnall2023-05-161-0/+2
|\ | | | | | | | | Ignore g_task_print_alive_task() when introspecting GIO See merge request GNOME/glib!3435
| * Ignore g_task_print_alive_task() when introspecting GIOEmmanuele Bassi2023-05-161-0/+2
|/ | | | | The `__GTK_DOC_IGNORE__` check is not enough for g-ir-scanner: we need to check for `__GI_SCANNER__` as well.
* Merge branch 'wip/p3732/g-string-new-steal' into 'main'Philip Withnall2023-05-167-17/+98
|\ | | | | | | | | gstring: add g_string_new_take See merge request GNOME/glib!3423
| * docs: unify "dynamic memory needed" explanationsPeter Eisenmann2023-05-163-17/+26
| | | | | | | | | | All `_take` method constructors require dynamic memory, this unifies theses explanation texts.
| * gstring: add g_string_new_takePeter Eisenmann2023-05-164-0/+72
| | | | | | | | | | Adds a GString constructor that takes over ownership of an existing, dynamically allocated, string.
* | Merge branch 'fix_gdb_python_helper' into 'main'Philip Withnall2023-05-161-1/+1
|\ \ | |/ |/| | | | | gobject_gdb.py: fix regression caused by bfbe7127d5 See merge request GNOME/glib!3430
| * gobject_gdb.py: fix regression caused by bfbe7127d5Nelson Benítez León2023-05-151-1/+1
|/ | | | | | | | commit bfbe7127d5 which did a code refactor in gobject_gdb.py introduced a bug by failing to return the signal name when a signal had no 'detail', this was preventing pretty printing name for signals with no 'detail'.
* Merge branch 'wip/pwithnall/bsd-copy-file-range' into 'main'Emmanuele Bassi2023-05-152-0/+11
|\ | | | | | | | | gfile: Ensure loff_t is defined on FreeBSD See merge request GNOME/glib!3431
| * gfile: Ensure loff_t is defined on FreeBSDPhilip Withnall2023-05-152-0/+11
|/ | | | | | | | | | | | | | | | | When `copy_file_range()` support was added, I used the definition of `copy_file_range()` from Linux, which uses `loff_t` to abstract the different `off*_t` types. `loff_t` doesn’t exist on FreeBSD, so this doesn’t compile, and was caught in subsequent asynchronous CI. Define `loff_t` with a fallback value if it’s not defined, which should fix this and other uses of `loff_t` in `gfile.c` (for example, if FreeBSD ever starts declaring `splice()`). Fixes this CI failure: https://gitlab.gnome.org/GNOME/glib/-/jobs/2812302 Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Merge branch 'main' into 'main'Philip Withnall2023-05-111-40/+53
|\ | | | | | | | | glib/tests/fileutils:fix asserts when running as root See merge request GNOME/glib!3421
| * tests: Fix assertion failures when running fileutils test as roothanhuihui2023-05-111-4/+17
| |
| * tests: Move a function to allow looking at CAP_DAC_OVERRIDEhanhuihui2023-05-111-40/+40
|/ | | | | This introduces no functional changes but allows `CAP_DAC_OVERRIDE` to be used in a subsequent commit.
* Merge branch 'fix-group-comment' into 'main'Philip Withnall2023-05-102-77/+159
|\ | | | | | | | | | | | | gkeyfile: Fix group comment management Closes #104 and #2927 See merge request GNOME/glib!3380
| * gkeyfile: Fix group comment managementGaël Bonithon2023-04-202-65/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the `comment` member of the GKeyFileGroup structure, which seemed intended to distinguish comments just above a group from comments above them, separated by one or more blank lines. Indeed: * This does not seem to match any specification in the documentation, where blank lines and lines starting with `#` are indiscriminately considered comments. In particular, no distinction is made between the comment above the first group and the comment at the beginning of the file. * This distinction was only half implemented, resulting in confusion between comment above a group and comment at the end of the preceding group. Instead, the same logic is used for groups as for keys: the comment above a group is simply the sequence of key-value pairs of the preceding group where the key is null, starting from the bottom. The addition of a blank line above groups when writing, involved in bugs #104 and #2927, is kept, but: * It is now added as a comment as soon as the group is added (since a blank line is considered a comment), so that `g_key_file_get_comment()` returns the correct result right away. * It is always added if comments are not kept. * Otherwise it is only added if the group is newly created (not present in the original data), in order to really keep comments (existing and not existing). Closes: #104, #2927
| * gkeyfile: Replace g_slice_*() with g_new*()/g_free_sized()Gaël Bonithon2023-04-201-13/+13
| |
* | Merge branch 'gtk-plus' into 'main'Philip Withnall2023-05-1029-66/+64
|\ \ | | | | | | | | | | | | Rename GTK+ to GTK (mostly comments and documentation) See merge request GNOME/glib!3429
| * | tests: Fix GIO file size tests as .desktop files have changed sizePhilip Withnall2023-05-101-2/+2
| | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | Fix style-check for {gconvert,gutils,gobject}.cArnaud Rebillout2023-05-103-5/+3
| | | | | | | | | | | | Also take this chance to change a 'Glib' to 'GLib'.
| * | Rename GTK+ to GTK (mostly comments and documentation)Arnaud Rebillout2023-05-1028-60/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GTK lost it's '+' suffix back in 2019, according to <https://mail.gnome.org/archives/gtk-devel-list/2019-February/msg00000.html> This commit can be re-generated with: git grep -l GTK+ \ | grep -v -e ^NEWS -e ^glib/tests/collate.c \ | xargs sed -i 's/GTK+/GTK/g' Most of the changes are in comments and documentation.
* | | Merge branch 'main' into 'main'Philip Withnall2023-05-104-4/+100
|\ \ \ | |/ / |/| | | | | | | | | | | | | | gtestutils: Improve g_assert_cmpuint Closes #2997 See merge request GNOME/glib!3424
| * | gtestutils: Style touchupEric Blake2023-05-091-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use more modern styling to the code added in the previous patch: - split 'label: stmt; stmt;' into multiple lines - add default: label with g_assert_not_reached() [yes, it's a bit weird adding an assertion inside code that handles assertions, but we should be okay since g_assertion_message_* are not public functions and should only be used by our macros] - use <inttypes.h> for shorter format strings Note, however, that using uint64_t in gtestutils.h is not feasible, since it would require adding an '#include <stdint.h>' with potential unintended namespace pollution to older clients. Signed-off-by: Eric Blake <eblake@redhat.com>
| * | gtestutils: Improve g_assert_cmpuintEric Blake2023-05-094-4/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While x86_64 has enough precision in long double to do a round trip from guint64 to long double and back, this is platform-specific, and is a disservice to users trying to debug failing unit tests on other architectures where it loses precision for g_assert_cmp{int,uint,hex}. See also https://bugzilla.gnome.org/show_bug.cgi?id=788385 which mentions having to add casts to specifically silence the compiler on platforms where the precision loss occurs. Meanwhile, g_assert_cmpuint() does an unsigned comparison, but outputs signed values if the comparison fails, which is confusing. Fix both issues by introducing a new g_assertion_message_cmpint() function with a new 'u' numtype. For backwards compatibility, the macros still call into the older g_assertion_message_cmpnum() when not targetting 2.78, and that function still works when passed 'i' and 'x' types even though code compiled for 2.78 and later will never invoke it with numtype anything other than 'f'. Note that g_assert_cmpmem can also take advantage of the new code, even though in practice, comparison between two size_t values representing array lengths that can actually be compiled is unlikely to have ever hit the precision loss. The macros in signals.c test code does not have to worry about versioning, since it is not part of the glib library proper. Closes #2997 Signed-off-by: Eric Blake <eblake@redhat.com>
* | | Merge branch '2863-copy-file-range' into 'main'Philip Withnall2023-05-093-10/+230
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | gfile: Support copy_file_range() for file copies Closes #2863 See merge request GNOME/glib!3328
| * | | gfile: Support copy_file_range() for file copiesPhilip Withnall2023-05-092-0/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While it can’t be used in all situations, it is a little bit faster than `splice()` in some situations, basically if the file system supports copy on write. In other situations it’s no slower than `splice()`. See `man copy_file_range` for the situations where it doesn’t work. In all of these situations, it will return an error, and the GLib code will fall through and try the existing `splice()` copy code instead. From my testing of `time gio copy A B` with a 9GB file, the `splice()` code path takes 22s, and the `copy_file_range()` code path takes 20s. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2863
| * | | tests: Add a test for progress callbacks from g_file_copy()Philip Withnall2023-05-091-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This wasn’t previously tested. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #2863
| * | | gfile: Eliminate a stat() call from the file copy codePhilip Withnall2023-05-091-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The start of the `g_file_copy()` implementation stats the source file to find all the attributes to copy onto the destination file, so it makes sense to get it to store the source file size at the same time. This saves a subsequent `stat()` call on the source FD in the btrfs reflink or splice code. Every little helps. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | | Merge branch 'main' into 'main'Philip Withnall2023-05-091-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Check for linux/netlink.h buildability See merge request GNOME/glib!3422
| * | | | Check for linux/netlink.h buildabilitySamuel Thibault2023-05-091-1/+1
| | |/ / | |/| | | | | | | | | | | | | | | | | | When cross-building with a non-Linux target, linux/netlink.h will not actually be buildable, even if distributions typically put it in /usr/include and thus exposed to the cross-compiler.
* | | | Merge branch 'unixfdlist-again' into 'main'Marco Trevisan2023-05-091-1/+0
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | docs: Don’t ignore gunixfdlist.h when building docs on Windows See merge request GNOME/glib!3409
| * | | docs: Don’t ignore gunixfdlist.h when building docs on WindowsPhilip Withnall2022-05-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Since 5efb84f24, it’s available on all platforms. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | | Merge branch 'wip/p3732/timeout-seconds-once' into 'main'Philip Withnall2023-05-0910-44/+62
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | add g_timeout_add_seconds_once See merge request GNOME/glib!3383
| * | | | use g_timeout_add_seconds_once()Peter Eisenmann2023-05-026-29/+16
| | | | | | | | | | | | | | | | | | | | Use the newly added g_timeout_add_seconds_once() where appropriate.
| * | | | gtimeout: use helper for seconds_full variantPeter Eisenmann2023-05-021-15/+1
| | | | | | | | | | | | | | | | | | | | Use timeout_add_full() helper to deduplicate code
| * | | | add g_timeout_add_seconds_oncePeter Eisenmann2023-05-024-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | Add a new call combing behaviors of g_timeout_add_seconds and g_timeout_add_once.
* | | | | Merge branch 'aborting-tests-rlimit' into 'main'Marco Trevisan2023-05-092-3/+44
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | tests: Zero the rlimit in standalone tests which are expected to abort Closes #2939 See merge request GNOME/glib!3417
| * | | | tests: Zero the rlimit in standalone tests which are expected to abortPhilip Withnall2023-05-022-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should hopefully stop the kernel spending a lot of memory and disk bandwidth creating coredumps for them unnecessarily, which slows down the rest of the tests and generally wastes resources. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2939
| * | | | tests: Add copyright/licensing header to assert-msg-testPhilip Withnall2023-05-021-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is put together through git archaeology: ``` git log -- glib/tests/assert-msg-test.c tests/assert-msg-test.c ``` The following commits were too trivial to have meaningful copyright: - 8e59d8602ca5921d78245f5d2b405b517a5e7cf9 - 44c004c84e9080040ff4e0e90b322dda0561cf85 - 207b8cb8a50d68e207d28b59e588311a5cbd9772 - a1bee97d4f093db01dee834bf3292eabd5b13d17 Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1415
| * | | | tests: Reformat assert-msg-test.c to follow coding stylePhilip Withnall2023-05-021-3/+6
| |/ / / | | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | | Merge branch 'win32-network-monitor-error' into 'main'Philip Withnall2023-05-091-12/+12
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | gwin32networkmonitor: Fix returning address of local variable See merge request GNOME/glib!3425
| * | | | gwin32networkmonitor: Fix returning address of local variablePhilip Withnall2023-05-091-12/+12
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Something has changed recently which causes this error to now be emitted when building on Windows msys2-mingw32: ``` ../gio/gwin32networkmonitor.c: In function 'win_network_monitor_get_ip_info': ../gio/gwin32networkmonitor.c:92:15: error: storing the address of local variable 'prefix' in '*dest' [-Werror=dangling-pointer=] 92 | *dest = (guint8 *) &prefix.Prefix.Ipv4.sin_addr; | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` If `IP_ADDRESS_PREFIX` is defined as a scalar rather than a pointer, that could explain the problem. Change the function to always operate on a pointer to avoid any potential such issues. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | | Merge branch '116-utf8-docs' into 'main'Patrick Griffis2023-05-021-0/+30
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | docs: Document high-level UTF-8 requirements for GLib Closes #116 See merge request GNOME/glib!3414
| * | | | docs: Document high-level UTF-8 requirements for GLibPhilip Withnall2023-05-021-0/+30
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I’ve finally found the right place in the docs to put this stuff. This doesn’t auto-link this section from every string in the GLib documentation, but I think that at this point (with gtk-doc in maintenance mode, and gi-docgen not fully applied to GLib) I don’t think we can do any better. The perfect is the enemy of the good, and having this stuff documented somewhere means that someone can link to it from multiple places in future *somehow*. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #116
* | | | Merge branch 'wiki-links' into 'main'Patrick Griffis2023-05-025-14/+14
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | docs: Update various broken/redirected links and fix list formatting See merge request GNOME/glib!3419
| * | | | docs: Fix list formatting in supported-platforms.mdPhilip Withnall2023-05-021-8/+8
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | | docs: Update various broken/redirected linksPhilip Withnall2023-05-024-6/+6
|/ / / / | | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | | Merge branch 'codeowners-lb90' into 'main'Luca Bacci2023-05-021-3/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | docs: Add lb90 as a Windows maintainer See merge request GNOME/glib!3418
| * | | | docs: Add lb90 as a Windows maintainerPhilip Withnall2023-05-021-3/+3
| |/ / / | | | | | | | | | | | | | | | | | | | | They’ve been actively doing good work. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | | Merge branch '2855-test-socket-rename' into 'main'Philip Withnall2023-05-024-3/+3
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | Rename confusing socket test filenames Closes #2855 See merge request GNOME/glib!3415
| * | | Rename confusing socket test filenamesMike Salmela2023-04-294-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The gio/tests/socket-client.c doesn't use GSocketClient, which makes the filename confusing. What the file actually tests is the GSocket. Rename it to socket-testclient.c The corresponding GSocket server test file naming doesn't conflict with other class names, but rename it to socket-testserver.c for consistency. Closes #2855
* | | | Merge branch 'registry-translation' into 'main'Philip Withnall2023-05-021-2/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | gregistrysettingsbackend: Remove translatable pspec nick/blurb See merge request GNOME/glib!3407