Commit Graph

32174 Commits

Author SHA1 Message Date
two
98a3dcb7e0 Merge branch glib:main into utf8-gir-fix 2025-08-19 21:13:09 +00:00
Michael Catanzaro
8df43f04ae Merge branch 'tests-printf-enhancements' into 'main'
tests/printf: Use proper compare helper for unsigned types

See merge request GNOME/glib!4747
2025-08-19 12:13:14 -05:00
Luca Bacci
d1dd177fe8 tests/printf: Use proper compare helper for unsigned types 2025-08-19 18:55:20 +02:00
Philip Withnall
aded48134d Merge branch 'revert-use-g-fputs-in-g-printf' into 'main'
Revert "Use g_fputs in g_printf, g_fprintf"

Closes #3761

See merge request GNOME/glib!4746
2025-08-19 16:19:18 +00:00
Luca Bacci
bb96c606ae tests/printf: Produce strings with embedded null characters
See #3761
2025-08-19 17:51:00 +02:00
Philip Withnall
e07cd77b37 Merge branch 'gmain-docs' into 'main'
gmain: Reformat docs to fully use gi-docgen and match style guide

See merge request GNOME/glib!4714
2025-08-19 14:30:45 +00:00
Philip Withnall
be12b1a200 gmain: 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-19 15:01:39 +01:00
Zhou Qiankang
9c1226223c tests/gio: skip Unix socket-mock tests on Windows
Signed-off-by: Zhou Qiankang <wszqkzqk@qq.com>
2025-08-19 21:31:13 +08:00
Philip Withnall
b6c2a877e2 gmain: Add (not nullable) to g_main_context_ref_thread_default()
This might be the default, but let’s be explicit about it, since the
non-nullability of the return value is explicitly mentioned in the prose
of the documentation.

This contrasts with the `(nullable)` on the return value of
`g_main_context_get_thread_default()`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-08-19 12:54:12 +01:00
Philip Withnall
1778e412a4 gmain: Add a couple of missing (nullable) annotations
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-08-19 12:54:06 +01:00
Philip Withnall
33c009676f gmain: Add missing (transfer full) annotations to constructors
These might be the implicit default for constructors, but it’s clearer
to be explicit about them.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-08-19 12:54:00 +01:00
two
3ecbd2f4ab gutf8: add introspection type for end parameter of validate* fn's
actually @pwithnall thought about how to fix it, i just tested and committed it

Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/3743
2025-08-19 11:14:31 +00:00
Luca Bacci
8a7365c0b3 Revert "Use g_fputs in g_printf, g_fprintf"
This reverts commit 02c63162a4
and sets the glib/print test as can_fail on Windows.

Fixes #3761
2025-08-19 11:05:09 +02:00
Philip Withnall
c4daaf9c93 Merge branch 'garray_binsearch_doc' into 'main'
garray: Fix g_array_binary_search description

See merge request GNOME/glib!4742
2025-08-18 15:24:13 +00:00
Philip Withnall
f00f68dcd4 Merge branch 'mimeapps-respect-symlinks' into 'main'
glib: respect symlinks when updating mimeapps.list

Closes #3579

See merge request GNOME/glib!4673
2025-08-18 13:44:23 +00:00
Rafael Girão
ce3a5dbbbe glib: respect symlinks when updating mimeapps.list
In the case where mimeapps.list is a symlink, gio-issued updates would
overwrite the file, destroying the symlink in the process.

Instead, this approach recursively follows mimeapps.list symlinks
and overwites the contents of the final file instead.

Closes #3579
2025-08-18 13:44:23 +00:00
Tobias Stoeckmann
aff998caf1 garray: extend test_array_binary_search
Add invalid input to highlight that arrays which are not absolutely
sorted according to the comparison function are not supported.
2025-08-14 19:14:09 +02:00
Philip Withnall
2c08654b62 Merge branch 'main' into 'main'
Update Russian translation

See merge request GNOME/glib!4743
2025-08-14 12:53:22 +00:00
jtux270
4ab57c1920 Update Russian translation 2025-08-14 15:10:12 +03:00
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