Commit Graph

24069 Commits

Author SHA1 Message Date
Philip Withnall
6549a36535 Merge branch 'mainloop-id-rationale' into 'main'
Document the stance on ID-based mainloop APIs

See merge request GNOME/glib!2202
2021-07-27 15:50:31 +00:00
Matthias Clasen
74f9f5d47d Document the stance on ID-based mainloop APIs
This will make it easier to reject MRs like
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2199
in the future.
2021-07-27 10:21:43 -04:00
Emmanuele Bassi
4a16a5b374 Merge branch 'ebassi/final-flag' into 'main'
Add "final" type flag

Closes #2321

See merge request GNOME/glib!1937
2021-07-27 12:03:20 +00:00
Emmanuele Bassi
39d5f34442 Fix doc stanzas for GDataInputStream properties
There's no such thing as a GDataStream.
2021-07-27 12:50:03 +01:00
Emmanuele Bassi
ef15a4e720 docs: Add new symbols 2021-07-27 12:27:53 +01:00
Emmanuele Bassi
9aacb4dd6f Add unit for the "final" GType flag
Check that we're emitting the correct set of warnings when trying to
derive a final type.
2021-07-27 12:27:53 +01:00
Emmanuele Bassi
d1861c8fda Add G_DEFINE_* macros for final types
These should match the G_DECLARE_FINAL_* macros used in a header file.
2021-07-26 20:13:32 +01:00
Emmanuele Bassi
c07dd416cf gtype: Add a "final" flag
We want to have the ability to mark types that should not be derivable
even if they are in a deeply derivable type hierarchy; in other words,
leaf nodes in the types tree.
2021-07-26 20:13:32 +01:00
Philip Withnall
808cde540a Merge branch 'source-static-name' into 'main'
Port internal uses to use g_source_set_static_name()

See merge request GNOME/glib!2198
2021-07-26 15:05:50 +00:00
Philip Withnall
ef6a551739 Merge branch 'main' into 'main'
Fix some test suite memory leaks

See merge request GNOME/glib!2195
2021-07-26 10:06:08 +00:00
Philip Withnall
8e963e0e31 Port internal uses to use g_source_set_static_name()
This should reduce allocations.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-07-26 11:01:07 +01:00
Philip Withnall
302346d4d3 Merge branch 'cheaper-source-names' into 'main'
mainloop: Add g_source_set_static_name

See merge request GNOME/glib!2196
2021-07-26 09:45:52 +00:00
Philip Withnall
1faa5cd4d0 Merge branch 'avoid-name-collisions' into 'main'
GResource compiler: Prefix static [con|de]strutors with c_name

See merge request GNOME/glib!2197
2021-07-26 09:34:19 +00:00
Chun-wei Fan
8093da7ce6 GResource compiler: Prefix static [con|de]strutors with c_name
When attempting to test Windows support for building libadwaita, since we are
using multiple GResource files, one would hit linker errors where multiple
definitions of the following symbols have been defined, when
glib-compile-resources was invoked without manual register:

resource_constructor_wrapper
resource_destructor_constructor
_arrayresource_constructor
_arrayresource_destructor

In order to avoid that, just prefix the definitions of resource_constructor
and resource_destructor, like what we do when --manual-register is used, with
what we pass in with --c-name so that we ensure that we do not end up in such
name collisions.
2021-07-26 17:05:23 +08:00
Kukuh Syafaat
5ade56decd Update Indonesian translation 2021-07-25 14:02:17 +00:00
Alexey Rubtsov
191df3abd4 Update Russian translation 2021-07-25 07:30:23 +00:00
Matthias Clasen
bb4d390577 mainloop: Add g_source_set_static_name
g_source_set_name duplicates the string, and this is
showing up as one of the more prominent sources of strdups
in GTK profiles, despite all the names we use being literals.

Add a variant that avoids the overhead.
2021-07-24 11:26:40 -04:00
GOUJON Évan
6e46edea5b gobject/tests/param: Fix a memory leak 2021-07-23 22:21:33 +02:00
GOUJON Évan
5e356d90b2 glib/tests/spawn-path-search: Fix memory leaks 2021-07-23 22:21:28 +02:00
GOUJON Évan
dd69955e58 gio/tests/async-splice-output-stream: Fix a memory leak 2021-07-23 22:21:23 +02:00
GOUJON Évan
d129395fe2 g_system_thread_new: Free a memory leak on error path 2021-07-23 22:21:11 +02:00
GOUJON Évan
bd779c96e9 glib/gtestutils: Introduce and use a test_cleanup function 2021-07-23 22:20:54 +02:00
GOUJON Évan
353f0b5235 glib/gtestutils: Introduce and use a g_test_suite_free function 2021-07-23 22:16:44 +02:00
GOUJON Évan
f0c0d8b67c glib/gtestutils: Introduce and use a g_test_case_free function 2021-07-23 22:10:08 +02:00
GOUJON Évan
0786031804 g_test_run: Introduce a clean up path once test suite ran 2021-07-23 22:05:52 +02:00
Rafael Fontenelle
7888358150 Update Brazilian Portuguese translation 2021-07-23 15:03:08 +00:00
Philip Withnall
950bbe7984 Merge branch 'DarkTrick-main-patch-15325' into 'main'
Update GValue doc: How to use GBoxed with GValue

See merge request GNOME/glib!2179
2021-07-22 12:37:43 +00:00
DarkTrick
94644e9b59 Update GValue doc: How to use GBoxed with GValue 2021-07-22 13:21:35 +01:00
Philip Withnall
38ccaf79c8 Merge branch 'DarkTrick-main-patch-85279' into 'main'
g_boxed_type_register_static, G_DEFINE_BOXED_TYPE: added correlating information

See merge request GNOME/glib!2188
2021-07-22 12:16:41 +00:00
DarkTrick
ea365b7ea6 g_boxed_type_register_static: added reference to G_DEFINE_BOXED_TYPE 2021-07-22 12:16:41 +00:00
Hugo Carvalho
1a2e7b3a40 Update Portuguese translation 2021-07-22 10:35:08 +00:00
Philip Withnall
3029f9a05b Merge branch 'fix_more_warnings' into 'main'
Fix more warnings

See merge request GNOME/glib!2192
2021-07-21 21:07:27 +00:00
Philip Withnall
e74c955335 Merge branch 'g_mod' into 'main'
API: Add g_module_open_full()

Closes #203

See merge request GNOME/glib!2169
2021-07-21 21:07:06 +00:00
Philip Withnall
be012a8067 giomodule: Port to new g_module_open_full() API
Port all existing calls in GLib to the new API so that they can receive
more detailed error information (although none of them actually make use
of it at the moment).

This also serves to test the new API better through use.

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

Helps: #203
2021-07-21 21:54:35 +01:00
nitinosiris
ee589aaa32 API: Add g_module_open_full()
g_module_open_full() is wrapper around g_module_open() function
which returns a GError in case of failure.

Closes #203
2021-07-21 21:45:51 +01:00
Emmanuel Fleury
5e0bcbf8fe Fix signedness warning in glib/grand.c
glib/grand.c:271:17: warning: comparison of integer expressions of different signedness: 'gint' {aka 'int'} and 'long long unsigned int'
   for (i = 0; i < G_N_ELEMENTS (seed); i++)
                 ^
2021-07-21 13:49:48 +02:00
Emmanuel Fleury
28dcec03e1 Fix cast from pointer to integer of different size warnings in glib/gthread-win32.c
glib/gthread-win32.c: In function 'g_private_get_impl':
glib/gthread-win32.c:310:16: warning: cast from pointer to integer of different size
   DWORD impl = (DWORD) key->p;
                ^
glib/gthread-win32.c:315:14: warning: cast from pointer to integer of different size
       impl = (DWORD) key->p;
              ^
glib/gthread-win32.c: In function 'SetThreadName':
glib/gthread-win32.c:596:60: warning: passing argument 4 of 'RaiseException' from incompatible pointer type
    RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (DWORD *) &info);
                                                            ^~~~~~~~~~~~~~~
2021-07-21 13:49:48 +02:00
Emmanuele Bassi
92540e76d7 Merge branch 'language-names-suppressions' into 'main'
glib.supp: Expand match kinds for g_get_language_names() suppressions

See merge request GNOME/glib!2193
2021-07-20 15:41:41 +00:00
Philip Withnall
a2216f8caa glib.supp: Expand match kinds for g_get_language_names() suppressions
See https://discourse.gnome.org/t/how-to-correct-read-ini-files-using-glib/6987/10

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-07-20 16:26:11 +01:00
Yuri Chornoivan
5a458f11a0 Update Ukrainian translation 2021-07-19 16:04:35 +00:00
Philip Withnall
bdbe65dd40 Merge branch 'nsec-typo' into 'main'
glocalfileinfo: Fix usec/nsec confusion with filetimes on Windows

See merge request GNOME/glib!2182
2021-07-14 10:45:47 +00:00
Philip Withnall
1c673dd078 Merge branch 'DarkTrick-main-patch-46211' into 'main'
Clarify GValue documentation

See merge request GNOME/glib!2178
2021-07-12 10:40:33 +00:00
DarkTrick
80189ca892 Clarify GValue documentation 2021-07-12 10:40:33 +00:00
Philip Withnall
8a4816f119 Merge branch 'fix-detection-of-trash-folders' into 'main'
Fix for issue "gio trash doesnt recognize existing trash directory ..."

Closes #2439

See merge request GNOME/glib!2185
2021-07-12 10:19:25 +00:00
markus
648994dba4 glocalfile: Fix the global trash dir detection
The `g_file_trash` function fails with the `Unable to find or create trash
directory` error when the global `.Trash` directory exists. This is because
the commit 7f2af262 introduced the `gboolean success` variable to signalize
the detection of the trash folder, but didn't set it in all code branches.
Since for a time this variable was not initialized the bug wasn't visible
when the trash folder existed. The bug became effective after the `success`
variable was initialized with `FALSE` by the commit c983ded0. Let's explicitly
set the `success` variable in all branches to fix the global trash dir
detection.

Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2439
2021-07-12 11:08:25 +01:00
Philip Withnall
cd93c350a2 Merge branch 'fix/gclosure-invoke-type-annotation' into 'main'
gclosure: Fix the invoke() return_value annotation

See merge request GNOME/glib!2181
2021-07-09 11:52:07 +00:00
Philip Withnall
b5556a2c68 gspawn: Use CLOSE_RANGE_CLOEXEC if available
It’s a new flag added to `close_range()` in kernel 5.11, which will
allow us to speed up setting `CLOEXEC` on ranges of file descriptors.

This currently happens in some situations when executing a new binary
with `GSpawn`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-07-09 12:40:47 +01:00
Philip Withnall
cfe8a0bd75 Merge branch 'main' into 'main'
correctly use 3 parameters for close_range

See merge request GNOME/glib!2180
2021-07-09 11:23:56 +00:00
Philip Withnall
7e8163b30b glocalfileinfo: Fix usec/nsec confusion with filetimes on Windows
The function which calls `SetFileTime()` works with seconds and
nanosecond, but the functions which call it are doing so with seconds
and microseconds.

Fix them so they convert to nanoseconds first.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-07-09 12:00:31 +01:00
Philip Withnall
dda45b0493 glocalfileinfo: Fix a typo in a file time utility function
The code appears to be dealing with time in units of 100ns, not 100µs,
so name the variable accordingly.

The rest of the arithmetic in that function appears consistent and
correct.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-07-09 11:52:23 +01:00