summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* GString: Support on-stack useg-string-on-stackMatthias Clasen2023-01-174-15/+149
| | | | | | Move the preallocation into the GString struct, and add g_string_init and g_string_clear to enable on-stack use of GString.
* tests: Fix unsafe use of GStringMatthias Clasen2023-01-171-5/+2
|
* keyfile: Fix unsafe use of GStringMatthias Clasen2023-01-171-4/+1
|
* glib-compile-schemas: Fix unsafe use of GStringMatthias Clasen2023-01-171-4/+3
|
* Merge branch 'document-gtask-brokenness' into 'main'Philip Withnall2023-01-161-0/+18
|\ | | | | | | | | GTask: Document issues See merge request GNOME/glib!3203
| * GTask: Document issuesMatthias Clasen2023-01-161-0/+18
| | | | | | | | | | | | | | | | We may not be able to fix GTasks broken design, but at least we should document it and not let users stumble into this bear trap without warning. Helps: #1346
* | Merge branch 'settings-action-per-desktop-default' into 'main'Marco Trevisan2023-01-162-4/+11
|\ \ | | | | | | | | | | | | gsettings: Support per-desktop overrides in GSettingsAction See merge request GNOME/glib!3193
| * | tests/gsettings: Check that per-desktop settings are used by GAction'sMarco Trevisan (Treviño)2023-01-141-0/+10
| | |
| * | gsettings: Slightly simplify g_settings_action_get_state()Philip Withnall2023-01-131-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | This introduces no functional changes. Suggested by Christian Persch. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | gsettings: Support per-desktop overrides in GSettingsActionPhilip Withnall2023-01-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to an oversight (I guess), per-desktop default values (which come from override files such as this one: https://github.com/endlessm/gnome-shell/blob/master/data/00_org.gnome.shell.gschema.override) were not checked when getting a GSettings value via a `GSettingsAction`. Per-desktop default values are correctly returned via all other GSettings query paths (see calls to `g_settings_schema_key_get_translated_default()`). Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | Merge branch 'issue_2883b' into 'main'Philip Withnall2023-01-161-2/+7
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Use 'write' with 'count' <= max value of its return type Closes #2883 See merge request GNOME/glib!3200
| * | | gfileutils: Use 'write' with 'count' <= max value of its return typeCCode2023-01-161-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Limit `count` so that `write` can properly report the number of written bytes. Limits: - POSIX: `SSIZE_MAX` - Windows: `INT_MAX` Fixes: #2883
* | | | Merge branch 'gstring-optimizations' into 'main'Philip Withnall2023-01-164-40/+108
|\ \ \ \ | |/ / / |/| | | | | | | | | | | Some GString optimizations See merge request GNOME/glib!3199
| * | | Try to make gtk-doc happyMatthias Clasen2023-01-141-1/+6
| | | |
| * | | markup: Use g_string_truncateMatthias Clasen2023-01-141-9/+2
| | | | | | | | | | | | | | | | | | | | We don't need a private inline helper for this anymore.
| * | | markup: Replace a g_string_insert_len callMatthias Clasen2023-01-141-1/+1
| | | | | | | | | | | | | | | | This lets us use the optimized inline call.
| * | | Improve the g_string_truncate testMatthias Clasen2023-01-141-1/+1
| | | | | | | | | | | | | | | | Test the inline version too.
| * | | string: Add an inline g_string_truncate tooMatthias Clasen2023-01-142-2/+14
| | | | | | | | | | | | | | | | | | | | This is another very commonly used GString function.
| * | | Improve the g_string_append testMatthias Clasen2023-01-141-3/+21
| | | | | | | | | | | | | | | | | | | | Test the inline versions too, and test passing -1 for len.
| * | | Improve the g_string_append_c testMatthias Clasen2023-01-141-2/+5
| | | | | | | | | | | | | | | | We should check the resulting string too.
| * | | string: Optimize g_string_append(_len)Matthias Clasen2023-01-142-8/+38
| | | | | | | | | | | | | | | | | | | | | | | | Add static inline versions of these functions that boil down to just an memcpy. ag_string_append_len is used quite a bit in GMarkup and GTK's css parser.
| * | | string: Add a G_LIKELYMatthias Clasen2023-01-141-1/+1
| | | | | | | | | | | | | | | | This is the case we optimize for.
| * | | string: Split g_string_maybe_expandMatthias Clasen2023-01-141-12/+19
| | |/ | |/| | | | | | | | | | Split off g_string_expand, and inline just the size check.
* | | Merge branch 'fix-closure-annotations' into 'main'Emmanuele Bassi2023-01-143-9/+9
|\ \ \ | | | | | | | | | | | | | | | | Fix a couple of `closure` annotations See merge request GNOME/glib!3198
| * | | Fix a couple of `closure` annotationsSebastian Dröge2023-01-133-9/+9
| | | |
* | | | Merge branch 'banjiuqingshan-main-patch-03761' into 'main'Philip Withnall2023-01-131-50/+126
|\ \ \ \ | |/ / / |/| | | | | | | | | | | gio/tests/file.c:Fix expectations when running as root See merge request GNOME/glib!3196
| * | | gio/tests/file.c: Fix expectations when running as rootbanjiuqingshan2023-01-131-50/+126
| |/ / | | | | | | | | | Includes tweaks by Philip Withnall.
* | | Merge branch 'regex-invalid-memory-access' into 'main'Marco Trevisan2023-01-122-2/+36
|\ \ \ | |/ / |/| | | | | | | | | | | | | | gregex: Prevent invalid memory access for unmatched subpatterns Closes #2881 See merge request GNOME/glib!3194
| * | gregex: Prevent invalid memory access for unmatched subpatternsPhilip Withnall2023-01-112-2/+36
| | | | | | | | | | | | | | | | | | | | | | | | Based on a test by Emmanuel Pacaud. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2881
* | | Merge branch 'badcel/revert-update-closure-annotations' into 'main'Philip Withnall2023-01-1118-61/+61
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Revert "Rename user data parameters to user_data" Closes #2827 See merge request GNOME/glib!3111
| * | Do not name callback parameters "user_data"badcel2023-01-092-21/+21
| | | | | | | | | | | | Calling a callback parameter "user_data" implicitly adds the "closure" attribute in the documentation which is wrong for callbacks.
| * | Revert "Rename all user datas in callbacks to user_data"badcel2023-01-093-13/+13
| | | | | | | | | | | | This reverts commit 1422e5f81241650c634413911e92d23495692545. The renaming of parameters implicitly introduced "closure" annotations in the documentation which are wrong on callbacks.
| * | Revert "Rename user data parameters to user_data"badcel2023-01-0916-28/+28
| | | | | | | | | | | | This reverts commit da7a31a052614edd2cc87518585ff371cbb0f204. The renaming of parameters implicitly introduced "closure" annotations in the documentation which are wrong on callbacks.
* | | Merge branch 'wip/smcv/gptrarray-null-term' into 'main'Simon McVittie2023-01-101-0/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | garray: Update NULL termination after copying array content Closes #2877 See merge request GNOME/glib!3190
| * | | garray: Update NULL termination after copying array contentSimon McVittie2023-01-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ptr_array_new(len, ., TRUE) ensures that there are at least len+1 elements in pdata, and that pdata[0] is null, but leaves the rest of pdata uninitialized. After copying the array data into pdata[1] to pdata[len-1] inclusive, we still need to make sure pdata[len] is a null terminator. Note that if len is 0, then pdata is not guaranteed to be non-null. If it's null, then we can't add null-termination to it until its size is updated. Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/2877 Signed-off-by: Simon McVittie <smcv@collabora.com>
* | | | Merge branch 'wip/smcv/rlimit-nproc-error' into 'main'Simon McVittie2023-01-101-1/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | tests: Improve error message if setting max processes to 1 fails See merge request GNOME/glib!3191
| * | | | tests: Improve error message if setting max processes to 1 failsSimon McVittie2023-01-101-1/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has historically failed on Debian autobuilders, and as a result we have had a patch for a long time that turned a failure here into a g_test_skip(). It's not clear whether this still happens, so I'm now assessing whether the patch can be dropped; but if the prlimit() call can fail for whatever reason, it would be useful for the error message to say what limit we were trying to set. Signed-off-by: Simon McVittie <smcv@collabora.com>
* | | | Merge branch 'wip/smcv/gptrarray-memcpy-nothing' into 'main'Simon McVittie2023-01-101-1/+1
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | garray: Avoid calling memcpy with no items See merge request GNOME/glib!3192
| * | | garray: Avoid calling memcpy with no itemsSimon McVittie2023-01-101-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | `memcpy(NULL, ., n)` and `memcpy(., NULL, n)` are undefined behaviour, even if *n* is zero. When len is 0 here, callers are allowed to pass in null data, and GPtrArray also does not guarantee to have allocated rarray->pdata yet. Signed-off-by: Simon McVittie <smcv@collabora.com>
* | | Merge branch 'gnumdk/cmpint_typo' into 'main'Philip Withnall2023-01-101-1/+1
|\ \ \ | |/ / |/| | | | | | | | docs: Fix return type in cmpint See merge request GNOME/glib!3189
| * | docs: Fix return type in cmpint exampleCédric Bellegarde2023-01-101-1/+1
|/ /
* | Merge branch 'fix-glib-compile-schemas-typo' into 'main'Simon McVittie2023-01-091-1/+1
|\ \ | | | | | | | | | | | | glib-compile-schemas: Fix typo in comparison function See merge request GNOME/glib!3188
| * | glib-compile-schemas: Fix typo in comparison functionPhilip Withnall2023-01-091-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | This caused schemas and override files to be sorted incorrectly. Fixes a regression introduced in commit 861e82efbc. Spotted by John Wudrick in https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3155#note_1635044. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | Merge branch 'ebassi/visibility-build-vars' into 'main'Philip Withnall2023-01-095-13/+13
|\ \ | | | | | | | | | | | | build: Don't overwrite build variables See merge request GNOME/glib!3184
| * | build: Don't overwrite build variablesEmmanuele Bassi2023-01-085-13/+13
| |/ | | | | | | | | | | | | We cannot use `gvisibility_h` for different visibility header files; you never know when you're going to refer to the variable again, and projects might end up needing to retrieve the variable contents—like, for instance, gobject-introspection using glib as a subproject.
* | Merge branch 'ebassi/glib-types-visibility' into 'main'Philip Withnall2023-01-091-0/+1
|\ \ | |/ |/| | | | | Include gobject-visibility.h in glib-types.h See merge request GNOME/glib!3185
| * Include GObject's visibility headerEmmanuele Bassi2023-01-081-0/+1
|/ | | | | | | | | The gobject-introspection build goes through the GLib types when generating the introspection data for GLib, but it does not include glib-object.h, otherwise all GObject symbols would end up inside the GLib namespace. This means we need to import the gobject-visibility.h header inside glib-types.h. Since the header is guarded by a once pragma, it doesn't really affect any legitimate user of the C API.
* 2.75.22.75.2Philip Withnall2023-01-062-1/+33
| | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Merge branch '2871-find-program-for-path-leak' into 'main'Emmanuele Bassi2023-01-061-6/+13
|\ | | | | | | | | | | | | gutils: Avoid possible leaks in g_find_program_for_path() Closes #2871 See merge request GNOME/glib!3183
| * gutils: Avoid possible leaks in g_find_program_for_path()Philip Withnall2023-01-051-6/+13
| | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2871