Commit Graph

22699 Commits

Author SHA1 Message Date
Sebastian Dröge
bb3f366101 Merge branch 'fix_more_warnings' into 'master'
Fix more warnings

See merge request GNOME/glib!1818
2020-12-17 13:25:26 +00:00
Emmanuel Fleury
872763dbf0 Fix signedness warning in gio/gfileinfo.c:g_file_info_finalize()
gio/gfileinfo.c: In function ‘g_file_info_finalize’:
gio/gfileinfo.c:327:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’}
  327 |   for (i = 0; i < info->attributes->len; i++)
      |                 ^
2020-12-17 14:07:19 +01:00
Emmanuel Fleury
f606e3350e Fix signedness warning in gio/gdatainputstream.c:scan_for_chars()
gio/gdatainputstream.c: In function ‘scan_for_chars’:
gio/gdatainputstream.c:879:40: error: comparison of integer expressions of different signedness: ‘int’ and ‘gsize’ {aka ‘long unsigned int’}
  879 |   for (i = 0; checked < available && i < peeked; i++)
      |                                        ^
2020-12-17 14:07:19 +01:00
Emmanuel Fleury
f2b8921df8 Fix signedness warning in gio/gdatainputstream.c:scan_for_newline()
gio/gdatainputstream.c: In function ‘scan_for_newline’:
gio/gdatainputstream.c:654:40: error: comparison of integer expressions of different signedness: ‘int’ and ‘gsize’ {aka ‘long unsigned int’}
  654 |   for (i = 0; checked < available && i < peeked; i++)
      |                                        ^
2020-12-17 14:07:19 +01:00
Emmanuel Fleury
fc8062d906 Fix signedness warning in gio/gliststore.c:
gio/gliststore.c: In function ‘g_list_store_insert’:
gio/gliststore.c:272:30: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘gint’ {aka ‘int’}
  272 |   g_return_if_fail (position <= g_sequence_get_length (store->items));
      |                              ^~
2020-12-17 14:07:19 +01:00
Emmanuel Fleury
3c461d2396 Fix signedness warning in gio/gliststore.c:g_list_store_splice()
gio/gliststore.c: In function ‘g_list_store_splice’:
gio/gliststore.c:482:21: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’}
  482 |       for (i = 0; i < n_additions; i++)
      |                     ^
2020-12-17 14:07:19 +01:00
Sebastian Dröge
114b1ecd98 Merge branch 'fuzzing-key-file-flags' into 'master'
fuzzing: Add more parsing flags to the GKeyFile test

See merge request GNOME/glib!1817
2020-12-17 12:55:20 +00:00
Philip Withnall
0c83f05be8 fuzzing: Add more parsing flags to the GKeyFile test
To increase the coverage.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-17 12:42:54 +00:00
Sebastian Dröge
b108072d9e Merge branch 'fuzzing-uri-flags' into 'master'
fuzzing: Add more GUriFlags to the URI parsing test

See merge request GNOME/glib!1816
2020-12-17 12:13:56 +00:00
Philip Withnall
486a2cadbb fuzzing: Add more GUriFlags to the URI parsing test
Widen the amount of test coverage.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-17 12:03:18 +00:00
Sebastian Dröge
6723633fd7 Merge branch 'fix_more_warnings' into 'master'
Fix more warnings

See merge request GNOME/glib!1815
2020-12-17 08:53:08 +00:00
Emmanuel Fleury
9025969df6 Fix missing initializer warning in gio/gcancellable.c
gio/gcancellable.c:773:1: error: missing initializer for field ‘closure_marshal’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
  773 | };
      | ^
In file included from glib/giochannel.h:33,
                 from glib/glib.h:54,
                 from gio/gcancellable.c:22:
glib/gmain.h:277:23: note: ‘closure_marshal’ declared here
  277 |   GSourceDummyMarshal closure_marshal; /* Really is of type GClosureMarshal */
      |                       ^~~~~~~~~~~~~~~
2020-12-16 23:59:25 +01:00
Emmanuel Fleury
058dda1b63 Fix missing initializer warning in gio/gcontextspecificgroup.c:g_context_specific_source_new()
gio/gcontextspecificgroup.c: In function ‘g_context_specific_source_new’:
gio/gcontextspecificgroup.c:77:3: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
   77 |   };
      |   ^
In file included from glib/giochannel.h:33,
                 from glib/glib.h:54,
                 from gobject/gbinding.h:28,
                 from glib/glib-object.h:22,
                 from gio/gcontextspecificgroup.h:23,
                 from gio/gcontextspecificgroup.c:22:
glib/gmain.h:276:19: note: ‘closure_callback’ declared here
  276 |   GSourceFunc     closure_callback;
      |                   ^~~~~~~~~~~~~~~~
2020-12-16 23:59:25 +01:00
Emmanuel Fleury
6ca38ccdd4 Fix missing initializer warning in gobject/tests/ifaceproperties.c:base_object_get_type()
gobject/tests/ifaceproperties.c: In function ‘base_object_get_type’:
gobject/tests/ifaceproperties.c:321:1: error: missing initializer for field ‘value_table’ of ‘GTypeInfo’ {aka ‘const struct _GTypeInfo’}
  321 | static DEFINE_TYPE_FULL (BaseObject, base_object,
      | ^~~~~~
In file included from gobject/gobject.h:24,
                 from gobject/gbinding.h:29,
                 from glib/glib-object.h:22,
                 from gobject/tests/ifaceproperties.c:21:
gobject/gtype.h:1063:26: note: ‘value_table’ declared here
 1063 |   const GTypeValueTable *value_table;
      |                          ^~~~~~~~~~~
2020-12-16 23:59:17 +01:00
Emmanuel Fleury
ff5d09af5e Fix missing initializer warning in gobject/tests/ifaceproperties.c:test_iface_get_type()
gobject/tests/ifaceproperties.c: In function ‘test_iface_get_type’:
gobject/tests/ifaceproperties.c:144:1: error: missing initializer for field ‘class_finalize’ of ‘GTypeInfo’ {aka ‘const struct _GTypeInfo’}
  144 | static DEFINE_IFACE (TestIface, test_iface, NULL, test_iface_default_init)
      | ^~~~~~
In file included from gobject/gobject.h:24,
                 from gobject/gbinding.h:29,
                 from glib/glib-object.h:22,
                 from gobject/tests/ifaceproperties.c:21:
gobject/gtype.h:1054:26: note: ‘class_finalize’ declared here
 1054 |   GClassFinalizeFunc     class_finalize;
      |                          ^~~~~~~~~~~~~~
2020-12-16 23:57:08 +01:00
Emmanuel Fleury
3b02d4641e Fix missing initializer warning in gio/inotify/inotify-kernel.c:ik_source_new()
gio/inotify/inotify-kernel.c: In function ‘ik_source_new’:
gio/inotify/inotify-kernel.c:377:3: error: missing initializer for field ‘finalize’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’}
  377 |   };
      |   ^
In file included from glib/giochannel.h:33,
                 from glib/glib.h:54,
                 from gio/inotify/inotify-kernel.c:30:
glib/gmain.h:272:14: note: ‘finalize’ declared here
  272 |   void     (*finalize) (GSource    *source); /* Can be NULL */
      |              ^~~~~~~~
2020-12-16 23:26:34 +01:00
Emmanuel Fleury
805053d09b Fix signedness warning in gobject/tests/signals.c:test_introspection()
gobject/tests/signals.c: In function ‘test_introspection’:
gobject/tests/signals.c:1180:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’}
 1180 |   for (i = 0; i < n_ids; i++)
      |                 ^
2020-12-16 23:26:34 +01:00
Emmanuel Fleury
176b204754 Fix signedness warnings in gobject/tests/properties.c:properties_get_property()
gobject/tests/properties.c: In function ‘properties_get_property’:
gobject/tests/properties.c:562:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
  562 |   for (i = 0; i < G_N_ELEMENTS (test_props); i++)
      |                 ^
gobject/tests/properties.c:583:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
  583 |   for (i = 0; i < G_N_ELEMENTS (test_props); i++)
      |                 ^
2020-12-16 23:26:34 +01:00
Philip Withnall
db70edb6ec Merge branch 'fix_more_warnings' into 'master'
Fix more warnings

See merge request GNOME/glib!1773
2020-12-16 11:45:41 +00:00
Emmanuel Fleury
8fb696e003 Fix missing initializer warning in gobject/tests/dynamictests.c:test_module_get_type()
gobject/tests/dynamictests.c: In function ‘test_module_get_type’:
gobject/tests/dynamictests.c:97:7: error: missing initializer for field ‘value_table’ of ‘GTypeInfo’ {aka ‘const struct _GTypeInfo’}
   97 |       };
      |       ^
In file included from gobject/gobject.h:24,
                 from gobject/gbinding.h:29,
                 from glib/glib-object.h:22,
                 from gobject/tests/dynamictests.c:23:
gobject/gtype.h:1063:26: note: ‘value_table’ declared here
 1063 |   const GTypeValueTable *value_table;
      |                          ^~~~~~~~~~~
2020-12-16 10:56:32 +01:00
Emmanuel Fleury
34cb225543 Fix missing initializer warning in gobject/gparam.c:g_param_type_register_static()
gobject/gparam.c: In function ‘g_param_type_register_static’:
gobject/gparam.c:1434:3: error: missing initializer for field ‘value_table’ of ‘GTypeInfo’ {aka ‘struct _GTypeInfo’}
 1434 |   };
      |   ^
In file included from gobject/gvalue.h:26,
                 from gobject/gparam.h:26,
                 from gobject/gparam.c:26:
gobject/gtype.h:1063:26: note: ‘value_table’ declared here
 1063 |   const GTypeValueTable *value_table;
      |                          ^~~~~~~~~~~
2020-12-16 10:56:32 +01:00
Emmanuel Fleury
dd16d1e879 Fix missing initializer warning in gobject/gtypemodule.c:g_type_module_get_type()
gobject/gtypemodule.c: In function ‘g_type_module_get_type’:
gobject/gtypemodule.c:154:7: error: missing initializer for field ‘value_table’ of ‘GTypeInfo’ {aka ‘const struct _GTypeInfo’}
  154 |       };
      |       ^
In file included from gobject/gtypeplugin.h:24,
                 from gobject/gtypemodule.c:22:
gobject/gtype.h:1063:26: note: ‘value_table’ declared here
 1063 |   const GTypeValueTable *value_table;
      |                          ^~~~~~~~~~~
2020-12-16 10:56:32 +01:00
Emmanuel Fleury
12ec1eb062 Fix missing initializer warning in gobject/gtypeplugin.c:g_type_plugin_get_type()
gobject/gtypeplugin.c: In function ‘g_type_plugin_get_type’:
gobject/gtypeplugin.c:91:7: error: missing initializer for field ‘class_init’ of ‘GTypeInfo’ {aka ‘const struct _GTypeInfo’}
   91 |       };
      |       ^
In file included from gobject/gtypeplugin.h:24,
                 from gobject/gtypeplugin.c:20:
gobject/gtype.h:1053:26: note: ‘class_init’ declared here
 1053 |   GClassInitFunc         class_init;
      |                          ^~~~~~~~~~
2020-12-16 10:56:32 +01:00
Emmanuel Fleury
cc7540909f Fix signedness warning in gobject/gtype.c:iface_node_has_available_offset_L()
gobject/gtype.c: In function ‘iface_node_has_available_offset_L’:
gobject/gtype.c:1288:42: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘int’
 1288 |   if (G_ATOMIC_ARRAY_DATA_SIZE (offsets) <= offset)
      |                                          ^~
2020-12-16 10:56:24 +01:00
Sebastian Dröge
c257049751 Merge branch 'codegen-flake8-warnings' into 'master'
gdbus-codegen: Ignore some flake8 warnings

See merge request GNOME/glib!1813
2020-12-15 10:05:25 +00:00
Philip Withnall
b207965697 gdbus-codegen: Ignore some flake8 warnings
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-15 09:43:35 +00:00
Sebastian Dröge
7d96944c98 Merge branch '2227-more-annotations' into 'master'
Add more missing nullable annotations

See merge request GNOME/glib!1811
2020-12-15 09:31:53 +00:00
Daniel Mustieles
b7e03e37db Updated Spanish translation 2020-12-15 10:27:47 +01:00
Philip Withnall
b66ae5a87e gdbuserror: Add missing (transfer) and (nullable) return annotations
This commit only looks at the `Returns:` lines in the documentation, and
has examined all of them in the file. Function arguments have not been
checked.

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

Helps: #2227
2020-12-15 09:14:39 +00:00
Philip Withnall
eb8d1c4826 gdbusconnection: Improve documentation formatting slightly
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-15 09:14:20 +00:00
Philip Withnall
06b5e3e54c gdbusconnection: Add missing (transfer) and (nullable) return annotations
This commit only looks at the `Returns:` lines in the documentation, and
has examined all of them in the file. Function arguments have not been
checked.

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

Helps: #2227
2020-12-15 09:13:22 +00:00
Philip Withnall
b19782e26b gdbusaddress: Add missing (transfer) and (nullable) return annotations
This commit only looks at the `Returns:` lines in the documentation, and
has examined all of them in the file. Function arguments have not been
checked.

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

Helps: #2227
2020-12-15 09:11:50 +00:00
Philip Withnall
f4766f2034 gcredentials: Improve documentation formatting slightly
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-15 09:10:19 +00:00
Philip Withnall
2a76f01698 gcredentials: Add missing (transfer) and (nullable) return annotations
This commit only looks at the `Returns:` lines in the documentation, and
has examined all of them in the file. Function arguments have not been
checked.

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

Helps: #2227
2020-12-15 09:09:59 +00:00
Sebastian Dröge
784f968895 Merge branch '2227-more-nullables' into 'master'
glib: Add more missing return value annotations

See merge request GNOME/glib!1801
2020-12-15 08:22:00 +00:00
Philip Withnall
2e99579268 Merge branch 'dm' into 'master'
gfileinfo: Add missing preconditions to g_file_info_get_attribute_data()

See merge request GNOME/glib!1810
2020-12-14 17:42:55 +00:00
oucaijun
f49831ccb4 gfileinfo: Add missing preconditions to g_file_info_get_attribute_data() 2020-12-14 09:41:00 +08:00
Sebastian Dröge
4fb3b6aa37 Merge branch 'asyncqueue-test-timing' into 'master'
tests: Be more lenient with timing checks on asyncqueue pops

See merge request GNOME/glib!1808
2020-12-13 09:18:21 +00:00
Sebastian Dröge
cb0f6ad08f Merge branch 'py-style-fix' into 'master'
python: Reformat some files to keep style-check-diff happy

See merge request GNOME/glib!1807
2020-12-13 09:17:39 +00:00
Sebastian Dröge
06511b16fa Merge branch 'timeout-test-fix' into 'master'
tests: Add some rounding tolerance in timeout test

See merge request GNOME/glib!1806
2020-12-13 09:17:18 +00:00
Sebastian Dröge
18f8a8b25f Merge branch '1568-initially-unowned-docs' into 'master'
docs: Mention GInitiallyUnowned when introducing refcounts

Closes #1568

See merge request GNOME/glib!1798
2020-12-12 20:48:42 +00:00
Philip Withnall
e7f9ae61dc docs: Mention GInitiallyUnowned when introducing refcounts
For completeness.

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

Fixes: #1568
2020-12-12 18:47:00 +00:00
Philip Withnall
c58f308aed tests: Be more lenient with timing checks on asyncqueue pops
On heavily loaded CI machines it seems to be taking about 1.3s between
one `g_get_monotonic_time()` call and the next. Allow that.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-12 18:41:50 +00:00
Philip Withnall
ff56386788 tests: Add some rounding tolerance in timeout test
Occasionally this test fails in CI with the message:
```
assertion failed: (current_time / 1000000 - last_time / 1000000 == 1)
```

The way this calculation is done at the moment, a difference of 1001ms
between `current_time` and `last_time` can result in failure, if the
times are close to a multiple to 1000ms.

Change it to only truncate the result after doing the subtraction, and
add a 500ms tolerance to account for scheduling delays in the test. (For
example, the `test_func()` could be called, then descheduled before it
gets to call `g_get_monotonic_time()`.

Additionally, change the test to use `g_assert_cmpint()` so that future
failures provide more useful debug information.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-12 18:41:08 +00:00
Philip Withnall
39f33412db python: Reformat some files to keep style-check-diff happy
The version of `black` on the CI server wanted these changes. Make them
to keep the `style-check-diff` CI job from constantly failing.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-12 18:40:57 +00:00
Philip Withnall
0755ff97be gchecksum: Drop preconditions for checksum_type being valid
Instead, return `NULL` if the checksum type is unsupported. This may
come in useful if we have to withdraw support for a particular checksum
type in future, due to it being broken.

These semantics were already in place for the return value of
`g_checksum_new()` — see commit 877cc60f and bug
comment https://bugzilla.gnome.org/show_bug.cgi?id=501853#c6.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-12 18:30:22 +00:00
Philip Withnall
3fef049472 gchecksum: Add missing (transfer) and (nullable) return annotations
This commit only looks at the `Returns:` lines in the documentation, and
has examined all of them in the file. Function arguments have not been
checked.

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

Helps: #2227
2020-12-12 18:30:22 +00:00
Philip Withnall
da83d711d6 gbookmarkfile: Add missing (transfer) and (nullable) return annotations
This commit only looks at the `Returns:` lines in the documentation, and
has examined all of them in the file. Function arguments have not been
checked.

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

Helps: #2227
2020-12-12 18:30:22 +00:00
Philip Withnall
7c3891afe9 gasyncqueue: Add missing (transfer) and (nullable) return annotations
This commit only looks at the `Returns:` lines in the documentation, and
has examined all of them in the file. Function arguments have not been
checked.

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

Helps: #2227
2020-12-12 18:30:22 +00:00
Philip Withnall
f53b3f3a16 garray: Add missing (transfer) and (nullable) return annotations
This commit only looks at the `Returns:` lines in the documentation, and
has examined all of them in the file. Function arguments have not been
checked.

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

Helps: #2227
2020-12-12 18:30:22 +00:00