32055 Commits

Author SHA1 Message Date
Tobias Stoeckmann
980bcc4553 garray: Fix g_array_binary_search description
The g_array_binary_search function does not necessarily return the index
of the first instance within the array. If the sentence is read as "the
first encountered instance", then it would be correct but not helpful.

Drop the statement and keep the code as it is.
2025-08-13 18:07:30 +02:00
Michael Catanzaro
683633790b Merge branch '3758-memory-monitor-poll-weak-ref' into 'main'
gmemorymonitorpoll: Hold a weak ref from a source callback to the monitor

Closes #3758

See merge request GNOME/glib!4741
2025-08-12 14:48:26 -05:00
Philip Withnall
30aff12d89 gmemorymonitorpoll: Hold a weak ref from a source callback to the monitor
It’s possible for the dispatch of the timeout source to race with the
finalisation of the `GMemoryMonitorPoll`, given that the timeout is run
in the GLib worker thread.

Protect against that by holding a thread-safe weak ref on the
`GMemoryMonitor` in the callback data.

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

Fixes: #3758
2025-08-12 13:24:52 +01:00
Philip Withnall
453614325e Merge branch 'ref_unref_transfer_full' into 'main'
Annotate ref/unref functions as transfer full

See merge request GNOME/glib!4739
2025-08-12 09:08:48 +00:00
Philip Withnall
e63f6b228d Merge branch 'thaller-gobject-maintainer' into 'main'
docs: Add Thomas Haller as a co-maintainer of GObject

See merge request GNOME/glib!4738
2025-08-12 09:04:10 +00:00
Philip Withnall
1d3fde9e46 Merge branch 'array_doc' into 'main'
garray: Improve and migrate documentation to gi-docgen

See merge request GNOME/glib!4727
2025-08-12 08:51:34 +00:00
Marco Trevisan
aaf8b0565c Merge branch 'gstrfuncs_param_check' into 'main'
gstrfuncs: Check parameter validity

See merge request GNOME/glib!4740
2025-08-12 10:46:01 +02:00
Philip Withnall
05602e802e Merge branch 'main' into 'main'
Disable GMemoryMonitorPsi on Solaris

See merge request GNOME/glib!4720
2025-08-12 08:31:04 +00:00
Niveditha Rau
365c5bcfd1 Disable GMemoryMonitorPsi on Solaris
PSI doesn’t exist in the Solaris kernel, so this `GMemoryMonitor`
implementation can never be chosen at runtime on Solaris.
2025-08-12 08:31:04 +00:00
Tobias Stoeckmann
0eef9aeb77 gstrfuncs: Check parameter validity
If string operations get the length G_MAXSIZE passed (which cannot
ever be true because terminating NUL byte would not fit), return NULL
instead of triggering out of boundary writes.
2025-08-11 22:34:09 +02:00
Tobias Stoeckmann
cad84d5e27 gobject: Annotate (un)ref functions transfer full
Annotate ref and unref functions with transfer full for better
documentation and correct gir file creation.
2025-08-11 21:43:35 +02:00
Tobias Stoeckmann
3368a9cc7a ghook: Add transfer full to ref return value
Add explicitly transfer full annotation to g_hook_ref. Without it,
the gir file and generated documentations pretend that returned
value is owned by the called function (transfer none) which is not
correct.
2025-08-11 21:33:25 +02:00
Tobias Stoeckmann
2a2df6ac9f garray: Reformat docs to fully use gi-docgen
Helps: #3250
2025-08-11 21:26:42 +02:00
Tobias Stoeckmann
c6801afdad garray: Improve introspection annotations
- Set return values to transfer none if they are passed in arguments
- Add scope call annotation for parameter function
- Take ownership in free/unref functions
- Add nullable annotations where appropriate
- Index functions do not pass ownership
- Add copy-func/free-func annotations
2025-08-11 21:25:52 +02:00
Tobias Stoeckmann
10f39d97c9 garray: Fix style guide violations
- Remove periods from parameter descriptions
- Start parameter descriptions lower case
- Shorten nullable parameter descriptions
- Start parameter descriptions with a/the
- Start boolean action descriptions with if
- Start return value description with "The"
- Adjust boolean return value descriptions
- Skip type in parameter description

Deviate from the GNOME Developer Documentation
guidelines only in special cases to deliver more information:

https://developer.gnome.org/documentation/guidelines/devel-docs.html#callable-symbols
2025-08-11 21:23:37 +02:00
Tobias Stoeckmann
1c39390b57 garray: Fix typos in documentation
Fixes grammar. No functional change.
2025-08-11 21:23:33 +02:00
Philip Withnall
a812c778b7 docs: Add Thomas Haller as a co-maintainer of GObject
He’s made a lot of detailed contributions recently, and has a good
understanding of large parts of GObject.

I‘ve asked him (by private email) if he’d agree to be added to the
co-maintainers list, and he said he’d be pleased to.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-08-11 13:55:58 +01:00
Philip Withnall
537a33a49f Merge branch 'stp_types' into 'main'
systemtap: Use correct formatters/types

See merge request GNOME/glib!4736
2025-08-11 11:26:46 +00:00
Philip Withnall
435dace60d Merge branch 'stp_devel' into 'main'
build: Fix stp files for development versions

See merge request GNOME/glib!4735
2025-08-09 19:44:05 +00:00
Marco Trevisan
9742476897 Merge branch 'rg/clang-format-ref-link' into 'main'
.clang-format: update coding conventions url

Closes #3751

See merge request GNOME/glib!4737
2025-08-09 20:30:26 +02:00
Rafael Girão
11e311e425 .clang-format: update coding conventions url
Closes #3751
2025-08-09 18:32:40 +01:00
Tobias Stoeckmann
b8f9743a4d systemtap: Use correct formatters/types
Try to avoid casting variables to potentially smaller types to fit
defined probes. This can truncate values and lead to wrong results.

Also make sure that signedness matches.

Since GType can be even 128 bit on CHERI architecture, cast all these
various types used based on platform to uintmax_t which SystemTap
properly processes.
2025-08-08 23:15:38 +02:00
Philip Withnall
6812587543 2.85.3
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2.85.3
2025-08-08 17:09:19 +01:00
Philip Withnall
f6b16349fe Merge branch 'print-console' into 'main'
Add g_fputs to print UTF-8 in the right charset

Closes #3341

See merge request GNOME/glib!4618
2025-08-08 15:48:08 +00:00
Philip Withnall
5a34e64d1f Merge branch 'issue_glib2_3755' into 'main'
AIX: Removing undefined symbols which is not present in AIX platform.

Closes #3755

See merge request GNOME/glib!4732
2025-08-08 11:12:01 +00:00
Philip Withnall
037e5405d6 Merge branch 'value-docs' into 'main'
gvalue: Reformat docs to fully use gi-docgen and match style guide

See merge request GNOME/glib!4733
2025-08-08 10:58:18 +00:00
Parth Patel
483373a370 tests: Remove undefined symbols not present on AIX platform
`getpwnam_r()` and `getpwuid_r()` are not defined on AIX, so don’t
define wrappers for them in the `getpwuid-preload.c` test helper.

Fixes: #3755
2025-08-08 11:52:22 +01:00
Philip Withnall
3a216c72e2 gvalue: Clarify docs for G_VALUE_INIT and g_value_init()
It’s not particularly clear why both these exist and why you need to use
both of them when creating a `GValue` — but you do.

Try and clarify things in the documentation.

In particular, replace use of the term ‘uninitialised’ (referring to a
`GValue` which has been set to `G_VALUE_INIT` but not yet had
`g_value_init()` called on it) with ‘zero-filled (cleared)’ instead.

‘uninitialised’ doesn’t make sense to describe a variable which, in C
terms, has just been initialised by assigning `G_VALUE_INIT` to it.
‘cleared’ is a bit less overloaded as a term.

Add some code examples to hopefully make things clearer too.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-08-08 11:26:59 +01:00
Philip Withnall
8a96e53b22 gvalue: Reformat docs to fully use gi-docgen and match style guide
https://developer.gnome.org/documentation/guidelines/devel-docs.html#writing-api-references

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3250
2025-08-08 11:26:52 +01:00
Tobias Stoeckmann
20e145da59 build: Fix stp files for development versions
Development versions of glib like 2.85.2 produce library files with
names like "libglib-2.0.so.0.8502.0" whereas stable version names
are like "libglib-2.0.so.0.8400.2".

The produced stp files for SystemTap work for stable versions but not
for development versions.

Fix this by passing the correct variables into LT_CURRENT and
LT_REVISION.
2025-08-07 22:38:29 +02:00
Philip Withnall
02744716ef Merge branch 'docs-clarify' into 'main'
gspawn: Improve docstring for g_spawn_async()

See merge request GNOME/glib!4734
2025-08-07 18:16:15 +00:00
Luca Bacci
515c277fa1 Tests: Add test for g_utf8_to_utf16_make_valid 2025-08-07 19:14:51 +02:00
Luca Bacci
b972407445 Tests: Add test for g_win32_error_message_in_place 2025-08-07 19:14:51 +02:00
Luca Bacci
5fda2637d8 Tests: Add test for g_win32_handle_is_console_output 2025-08-07 19:14:50 +02:00
Luca Bacci
e284ec1749 tests: Add test for g_fputs 2025-08-07 19:14:50 +02:00
Luca Bacci
02c63162a4 Use g_fputs in g_printf, g_fprintf 2025-08-07 19:14:50 +02:00
Luca Bacci
a3a98500ac Use g_fputs in g_log_writer_standard_streams 2025-08-07 19:14:50 +02:00
Luca Bacci
d26c0f1907 Add g_log_writer_format_fields variant for UTF-8 (internal) 2025-08-07 19:14:50 +02:00
Luca Bacci
b080c5f051 Use g_fputs in g_print
Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/3341
2025-08-07 19:14:50 +02:00
Luca Bacci
f26173963a Add g_fputs() utility function
Like g_print, expects UTF-8 and outputs in the right charset.
2025-08-07 19:14:50 +02:00
Luca Bacci
7faaac9265 Move strdup_convert() to dedicated source file
And thus rename to g_print_convert()
2025-08-07 19:14:50 +02:00
Luca Bacci
734b998eea Add error handling functions for Windows
Import some Windows-specific error handling functions from GTK. See:

 * https://gitlab.gnome.org/GNOME/gtk/-/blob/4.18.0/gdk/win32/gdkmain-win32.c?ref_type=tags#L110
 * https://gitlab.gnome.org/GNOME/gtk/-/blob/4.18.0/gdk/win32/gdkprivate-win32.h?ref_type=tags#L141
2025-08-07 19:14:50 +02:00
Luca Bacci
7f2a587746 Add g_win32_file_stream_is_console_output() 2025-08-07 19:14:50 +02:00
Luca Bacci
4e39a7c08c Add g_win32_handle_is_console_output()
Private function that checks whether a HANDLE refers to a console
screen buffer.
2025-08-07 19:14:50 +02:00
Luca Bacci
c4be7824d5 Add g_utf8_to_utf16_make_valid() with backtrack functionality 2025-08-07 19:14:42 +02:00
Stefan Hansson
f0f4f31206 gspawn: Improve docstring for g_spawn_async()
Based on my reading of the docs, g_spawn_async_with_pipes_and_fds()
seems to have a much more comprehensive explanation of itself than
g_spawn_async_with_pipes(). As such, it makes sense to me to refer to it
rather than the latter when suggesting where to go for further reading.

Signed-off-by: Stefan Hansson <newbyte@postmarketos.org>
2025-08-07 18:33:17 +02:00
Philip Withnall
a1a48126b1 Merge branch 'faccessat-openbsd' into 'main'
glocalfile: Disable faccessat()-based query_exists on OpenBSD

See merge request GNOME/glib!4731
2025-08-07 11:28:25 +00:00
Antoine Jacoutot
ff47c01818 glocalfile: Disable faccessat()-based query_exists on OpenBSD 2025-08-07 11:28:25 +00:00
Philip Withnall
ebe003c1b7 Merge branch 'wip/kabus/filenamecompleter-test' into 'main'
Add a basic GFilenameCompleter test

See merge request GNOME/glib!4726
2025-08-05 15:02:31 +00:00
Khalid Abu Shawarib
7a38cbc1dc gio/filenamecompleter: Use platform-specific directory separator 2025-08-05 17:36:41 +03:00