Commit Graph

30791 Commits

Author SHA1 Message Date
Philip Withnall
ef57fa8a29 Merge branch 'port-gbufferedinputstream.c-comments' into 'main'
gbufferedinputstream: Port all doc comments to gi-docgen

See merge request GNOME/glib!4146
2024-07-09 19:36:55 +00:00
Philip Withnall
a7da10fea8 Merge branch 'asan-cygwin-build-fix' into 'main'
glib-private: fix build under Cygwin

See merge request GNOME/glib!4150
2024-07-09 19:25:31 +00:00
Emmanuele Bassi
a807604ef6 docs: Add source location URL
If the base URL for source location is set, gi-docgen will automatically
generate a link to the location of declarations and doc blocks in the
source.
2024-07-09 20:17:09 +01:00
Bilal Elmoussaoui
a31479316d gi: Add missing Since annotation
Fixes b32e1b63ee
2024-07-09 20:16:20 +01:00
Philip Withnall
fc01879341 Merge branch 'wip/pwithnall/macos-ci-fix' into 'main'
tests: Make an error check less specific in gsocketclient-slow

See merge request GNOME/glib!4149
2024-07-09 19:13:26 +00:00
Christoph Reiter
a49815926c glib-private: fix build under Cygwin
fb58d55187 added weak linking for ASAN,
skipping it for MinGW because weak symbols are broken there.
The same is true for Cygwin, so skip things there too.

This fixes the following build error under MSYS2:

/usr/lib/gcc/x86_64-pc-msys/13.3.0/../../../../x86_64-pc-msys/bin/ld:
    glib/msys-glib-2.0-0.dll.p/gutils.c.o:gutils.c:
        (.rdata$.refptr.__lsan_enable[.refptr.__lsan_enable]+0x0): undefined reference to `__lsan_enable'
2024-07-09 20:34:02 +02:00
Sudhanshu Tiwari
2e7e51be56 gbufferedinputstream: Port all doc comments to gi-docgen 2024-07-09 18:21:42 +01:00
Philip Withnall
325a9af5e0 Merge branch 'port-gbufferedoutputstream.c-comments' into 'main'
gbufferedoutputstream.c: Port doc comments to gi-docgen

See merge request GNOME/glib!4148
2024-07-09 17:01:46 +00:00
Philip Withnall
8d0bf4ed39
tests: Make an error check less specific in gsocketclient-slow
On Linux the error will be `G_IO_ERROR_CONNECTION_REFUSED`, but on macOS
it will be `G_IO_ERROR_TIMED_OUT`. Both errors seem reasonable to me, so
let’s not specifically require one of them.

See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4104#note_2161451

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-07-09 17:40:16 +01:00
Sudhanshu Tiwari
c48fd73189 gbufferedoutputstream.c: Port doc comments to gi-docgen 2024-07-09 18:03:03 +05:30
Sudhanshu Tiwari
a8b52cd9d6 gfilteroutputstream.c: Port all doc comments to gi-docgen 2024-07-09 17:30:32 +05:30
Philip Withnall
de71e95041 Merge branch 'wip/leoziyou/macos-network-monitor' into 'main'
GOsxNetworkMonitor: Add network monitor backend for OS X

Closes #1326

See merge request GNOME/glib!3744
2024-07-07 19:36:48 +00:00
Leo Assini
202d345a82 GOsxNetworkMonitor: Add network monitor backend for OS X 2024-07-07 19:36:48 +00:00
Philip Withnall
f24bb8dc19
gutilsprivate: Factor out g_isnan() helper
There are a couple of places in the code which use `isnan()` and have
platform-specific workarounds for it. Unify those, and extend the
workaround to work for msys2-mingw32.

It seems that msys2-mingw32 can’t automatically use `isnan()` in a wider
mode than `float`:
```
In file included from ../glib/gdatetime.c:60:
../glib/gdatetime.c: In function 'g_date_time_new':
../glib/gdatetime.c:1648:14: error: conversion from 'gdouble' {aka 'double'} to 'float' may change value [-Werror=float-conversion]
 1648 |       isnan (seconds) ||
      |              ^~~~~~~
cc1.exe: all warnings being treated as errors
```

See: https://gitlab.gnome.org/pwithnall/glib/-/jobs/4022715

Using it in float mode on all platforms should not change behaviour, as
a conversion from `(double) NAN` to `float` should still give `NAN`.

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

Helps: #3405
2024-07-07 17:53:19 +01:00
Emmanuele Bassi
fc72d920cd Merge branch 'packaging-version' into 'main'
codegen: Drop unused import

See merge request GNOME/glib!4143
2024-07-07 14:09:42 +00:00
Philip Withnall
3993d8db52
codegen: Drop unused import
This should have been dropped in commit
38faeca62e but somehow that didn’t happen
and somehow it wasn’t caught by the CI until afterwards.

Fixes: https://gitlab.gnome.org/GNOME/glib/-/jobs/4049254

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-07-07 13:48:46 +01:00
Philip Withnall
8320085557 Merge branch 'andyholmes/resolver-ownership' into 'main'
gthreadedresolver: ref-sink returned records in lookup_records()

Closes #3393

See merge request GNOME/glib!4110
2024-07-05 06:26:51 +00:00
Andy Holmes
cdcb179808
tests: ensure DNS records are full-reference variants
For each test expected to return valid DNS records, test that the
record variants are not floating references.

Also add an test which checks this explicitly for a simple TXT record.
2024-07-04 17:37:44 -07:00
Philip Withnall
7878938e9a Merge branch 'pr/fix_some_windows_testsuite_failures' into 'main'
tests: fix some Windows testsuite failures

Closes #3370

See merge request GNOME/glib!4125
2024-07-04 19:35:47 +00:00
Benoit Pierre
caf7f8ef49 tests: fix some Windows testsuite failures
Add test dependencies on the 2 spawn helpers required on Windows.
2024-07-04 19:35:47 +00:00
Andy Holmes
da3510575e
gthreadedresolver: ref-sink returned records in lookup_records()
The return value to `lookup_records()` methods is set as `transfer full`
but the code path in `g_resolver_records_from_res_query()` doesn't
sink the GVariant.

Add the `g_variant_ref_sink()` call when prepending the record, so
the list hold a full reference on each records.

closes #3393
2024-07-04 12:06:12 -07:00
Philip Withnall
b29f249544 Merge branch 'async_queue_copy_free_func' into 'main'
GAsyncQueue: Add copy-func and free-func annotations

See merge request GNOME/glib!4131
2024-07-04 13:11:31 +00:00
Philip Withnall
70784b99b1 Merge branch 'wsign-conversion' into 'main'
gqsort: Add g_sort_array() and deprecate g_qsort_with_data()

See merge request GNOME/glib!4127
2024-07-04 12:33:38 +00:00
Philip Withnall
22d699943d Merge branch 'menu-model-diagram' into 'main'
Docs: Replace Gio.MenuModel diagram with SVG

See merge request GNOME/glib!4140
2024-07-04 11:55:11 +00:00
Philip Withnall
f953212cc5
tests: Add a test for g_value_array_sort_with_data()
It’s deprecated, but I was modifying it anyway and it didn’t have any
coverage, so let’s add a simple test (as suggested by Michael
Catanzaro).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-07-04 12:34:20 +01:00
FeRD (Frank Dana)
f4d944119c Menu model example: Update diagram
- Add licensing tags
- Tweak spacing, colors, line thicknesses
- Create light-mode version
- Use `<picture>` tag to include appropriate version for each media
  color scheme.
2024-07-04 12:13:53 +01:00
FeRD (Frank Dana)
85c8a7c0d8 Docs: Replace Gio.MenuModel diagram with SVG
Recreate the `menu-model.png` diagram in SVG, with box outlines and
connectors recolored from black to white. This will allow the diagram
to show up better in the dark documentation theme.
2024-07-04 12:13:53 +01:00
Philip Withnall
41d34f4976 Merge branch 'erniGH/remove-distutils' into 'main'
replace package.version.Version by internal code

See merge request GNOME/glib!4133
2024-07-04 11:04:39 +00:00
Ernesto de Gracia Herranz
38faeca62e replace package.version.Version by internal code
This drops the dependency on the Python `packaging` module.

Signed-off-by: Ernesto de Gracia Herranz <ernestodgh@jfrog.com>
2024-07-04 11:04:38 +00:00
Philip Withnall
047010a278 Merge branch 'typed-callbacks-gsourcefuncs' into 'main'
gmain: Refactor GSourceFuncs into typed callbacks

Closes #2765

See merge request GNOME/glib!4139
2024-07-04 10:40:20 +00:00
Gary Li
964abbd07d gmain: Refactor GSourceFuncs into typed callbacks
Refactor and document them into typed callbacks, which is preferred over older gtk-doc descriptions for function pointer fields.

Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2765
2024-07-04 10:40:20 +00:00
Philip Withnall
5de4d59c31 Merge branch 'correct-gtype-macro-comment' into 'main'
gobject: Fix macro name in comment; improve style

See merge request GNOME/glib!4138
2024-07-03 10:43:18 +00:00
Philip Withnall
e0d5d0f3d1 Merge branch 'python-linting' into 'main'
codegen: resolve pylint import issues

See merge request GNOME/glib!4137
2024-07-03 08:22:21 +00:00
Robert Royals
04b79f91e8 gobject: Fix macro name in comment; improve style
Comment referenced non-existent macro:
    G_DEFINE_TYPE_WITH_CODE_AND_PRELUDE
but it should be:
    _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE
2024-07-03 08:09:31 +01:00
Yegor Yefremov
b89dba22cd codegen: resolve pylint import issues
Remove unused imports and reorder other imports so that
the standard ones are coming first.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2024-07-02 12:35:09 +02:00
Philip Withnall
7f8201d7af Merge branch 'gtype-macro-remove-variable' into 'main'
gobject: Remove unused variable from macro

See merge request GNOME/glib!4136
2024-07-01 20:56:46 +00:00
Robert Royals
14b3d5da90 gobject: Remove unused variable from macro
Remove TYPE_PARENT variable from the
    _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE
macro definition.
2024-07-01 18:39:48 +01:00
Philip Withnall
1b41818f50 Merge branch 'port-gasyncresult.c-comments' into 'main'
gasyncresult: Port all doc comments to gi-docgen

See merge request GNOME/glib!4128
2024-07-01 13:44:42 +00:00
Philip Withnall
9e498da9bb Merge branch 'gsocketclient-test-fix' into 'main'
Fix gsocketclient-slow test on FreeBSD

See merge request GNOME/glib!4130
2024-07-01 13:35:40 +00:00
badcel
2ebcff9349
GAsyncQueue: Add copy-func and free-func annotations 2024-06-30 21:32:33 +02:00
Gleb Popov
6daebde9a6 Fix gsocketclient-slow test on FreeBSD
The "port" variable ends up being 0 even after successful g_socket_bind.
Use g_socket_get_local_address() to actually get a correct port number.
2024-06-30 15:37:22 +03:00
Sudhanshu Tiwari
f08952d5fe gasyncresult.h: Port all doc comments to gi-docgen 2024-06-29 00:14:35 +05:30
Sudhanshu Tiwari
62acd02c49 gasyncresult.c: Port all doc comments to gi-docgen 2024-06-29 00:11:30 +05:30
Philip Withnall
4d31fe6b7d
gnulib: Disable -Wfloat-conversion by default
gnulib doesn’t work with it, and if we try and enable it then mingw
versions of `signbit()` start causing problems.

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

Helps: #3405
2024-06-28 16:34:08 +01:00
Philip Withnall
7b435dfa7c
garray: Fix g_ptr_array_insert() with indices > G_MAXINT
While an index greater than `G_MAXINT` can’t be passed to
`g_ptr_array_insert()`, `-1` can be — and if that’s done with an array
which has more than `G_MAXINT` elements in it, the new element will be
inserted part-way through the array rather than being appended.

Spotted by building with `-Wsign-conversion`.

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

Helps: #3405
2024-06-28 15:27:25 +01:00
Philip Withnall
b32e1b63ee
gqsort: Add g_sort_array() and deprecate g_qsort_with_data()
The latter only accepts a `gint` as the number of elements in the array,
which means that its use in `GArray` (and related array implementations)
truncates at least half the potential array size.

So, introduce a replacement for it which uses `size_t` for the number of
elements. This is inline with what `qsort()` (or `qsort_r()`) actually
does. Unfortunately we can’t directly use `qsort_r()` because it’s not
guaranteed to be a stable sort.

This fixes some `-Wsign-conversion` warnings (when building GLib with
that enabled).

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

Helps: #3405
2024-06-28 15:27:18 +01:00
Philip Withnall
692a50b78e
build: Enable -Wfloat-conversion by default
GLib now compiles without emitting any float conversion warnings, so
let’s keep it that way.

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

Helps: #3405
2024-06-28 14:44:01 +01:00
Philip Withnall
e35cfef509
performance: Add explicit casts for some double → other numeric type conversions
If we enable `-Wfloat-conversion`, these warn about a possible loss of
precision due to an implicit conversion from `double` to some other
numeric type.

The warning is correct: there is a possible loss of precision here. In
these instances, we don’t care, as the floating point arithmetic is
being done to do some imprecise scaling or imprecise timing. A loss of
precision is not a problem.

So, add an explicit cast to squash the warning.

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

Helps: #3405
2024-06-28 14:43:26 +01:00
Philip Withnall
b7153f5072
performance: Fix signedness of ints throughout
The tests were using a lot of signed `int`s when actually the values
being handled were always non-negative. Use `unsigned int` consistently
throughout.

Take the opportunity to move declarations of loop iterator variables
into the loops.

This introduces no functional changes.

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

Helps: #3405
2024-06-28 14:41:48 +01:00
Philip Withnall
6129f6f244
tests: Use correct numeric comparison assertions in param tests
There were various places where (signed or unsigned) integer assertions
were being used to compare `double` or `float` values, resulting in an
implicit integer conversion.

This causes a warning when building with `-Wfloat-conversion`.

Improve the specificity of the tests by using the most-specific numeric
assertions through all `param` tests.

For the conversion tests, this means using the assertion function
associated with the target type, not the source type.

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

Helps: #3405
2024-06-28 14:38:22 +01:00