From f885d80ea371819a53a11b16f267874ad1925a3e Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 17 Nov 2020 11:31:25 +0100 Subject: [PATCH 01/10] Fix missing initializer warning in gio/gtask.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gio/gtask.c:2153:1: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’} 2153 | }; | ^ --- gio/gtask.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gio/gtask.c b/gio/gtask.c index 3540e6553..2b4720de8 100644 --- a/gio/gtask.c +++ b/gio/gtask.c @@ -2162,7 +2162,9 @@ GSourceFuncs trivial_source_funcs = { NULL, /* prepare */ NULL, /* check */ trivial_source_dispatch, - NULL + NULL, /* finalize */ + NULL, /* closure */ + NULL /* marshal */ }; static void From 8236b66a5dbbf6afd0a75f40cd90d7ae9a392970 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 17 Nov 2020 11:38:12 +0100 Subject: [PATCH 02/10] Fix signedness warning in gio/gnetworkmonitornetlink.c:remove_network() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gio/gnetworkmonitornetlink.c: In function ‘remove_network’: gio/gnetworkmonitornetlink.c:272:21: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’} 272 | for (i = 0; i < nl->priv->dump_networks->len; i++) | ^ --- gio/gnetworkmonitornetlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gnetworkmonitornetlink.c b/gio/gnetworkmonitornetlink.c index 20db55188..53eab3364 100644 --- a/gio/gnetworkmonitornetlink.c +++ b/gio/gnetworkmonitornetlink.c @@ -267,7 +267,7 @@ remove_network (GNetworkMonitorNetlink *nl, if (nl->priv->dump_networks) { GInetAddressMask **dump_networks = (GInetAddressMask **)nl->priv->dump_networks->pdata; - int i; + guint i; for (i = 0; i < nl->priv->dump_networks->len; i++) { From 887f59ebc06549a07988680cf95bd14396894f1a Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 17 Nov 2020 11:47:20 +0100 Subject: [PATCH 03/10] Fix missing initializer in gio/gactiongroupexporter.c:g_dbus_connection_export_action_group() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gio/gactiongroupexporter.c: In function ‘g_dbus_connection_export_action_group’: gio/gactiongroupexporter.c:542:3: error: missing initializer for field ‘get_property’ of ‘GDBusInterfaceVTable’ {aka ‘const struct _GDBusInterfaceVTable’} 542 | }; | ^ --- gio/gactiongroupexporter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gactiongroupexporter.c b/gio/gactiongroupexporter.c index 17111ffb8..8453723f5 100644 --- a/gio/gactiongroupexporter.c +++ b/gio/gactiongroupexporter.c @@ -538,7 +538,7 @@ g_dbus_connection_export_action_group (GDBusConnection *connection, GError **error) { const GDBusInterfaceVTable vtable = { - org_gtk_Actions_method_call + org_gtk_Actions_method_call, NULL, NULL, { 0 } }; GActionGroupExporter *exporter; guint id; From cd540a228aa42e7c4eda26f27be0443fb39f2ab7 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 17 Nov 2020 11:50:59 +0100 Subject: [PATCH 04/10] Fix signedness warning in gio/gsocketlistener.c:add_sources() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gio/gsocketlistener.c: In function ‘add_sources’: gio/gsocketlistener.c:612:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’} 612 | for (i = 0; i < listener->priv->sockets->len; i++) | ^ --- gio/gsocketlistener.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gsocketlistener.c b/gio/gsocketlistener.c index d11f10ae4..6fd685ba4 100644 --- a/gio/gsocketlistener.c +++ b/gio/gsocketlistener.c @@ -606,7 +606,7 @@ add_sources (GSocketListener *listener, GSocket *socket; GSource *source; GList *sources; - int i; + guint i; sources = NULL; for (i = 0; i < listener->priv->sockets->len; i++) From a68fbcc0022a7dfdf0f104de54aca0b08cf9e1fd Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 17 Nov 2020 11:51:48 +0100 Subject: [PATCH 05/10] Fix signedness warning in gio/gsocketlistener.c:g_socket_listener_set_backlog() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gio/gsocketlistener.c: In function ‘g_socket_listener_set_backlog’: gio/gsocketlistener.c:993:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’} 993 | for (i = 0; i < listener->priv->sockets->len; i++) | ^ --- gio/gsocketlistener.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gsocketlistener.c b/gio/gsocketlistener.c index 6fd685ba4..a4fa59f53 100644 --- a/gio/gsocketlistener.c +++ b/gio/gsocketlistener.c @@ -983,7 +983,7 @@ g_socket_listener_set_backlog (GSocketListener *listener, int listen_backlog) { GSocket *socket; - int i; + guint i; if (listener->priv->closed) return; From 5af79a84e3e22aa77e784152ae6caacc9679d484 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 17 Nov 2020 11:52:33 +0100 Subject: [PATCH 06/10] Fix signedness warning in gio/gsocketlistener.c:g_socket_listener_close() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gio/gsocketlistener.c: In function ‘g_socket_listener_close’: gio/gsocketlistener.c:1019:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’} 1019 | for (i = 0; i < listener->priv->sockets->len; i++) | ^ --- gio/gsocketlistener.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gsocketlistener.c b/gio/gsocketlistener.c index a4fa59f53..bdf1608dc 100644 --- a/gio/gsocketlistener.c +++ b/gio/gsocketlistener.c @@ -1009,7 +1009,7 @@ void g_socket_listener_close (GSocketListener *listener) { GSocket *socket; - int i; + guint i; g_return_if_fail (G_IS_SOCKET_LISTENER (listener)); From 7d81742339af74df071ffccfec7a53eea4962634 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 17 Nov 2020 12:08:03 +0100 Subject: [PATCH 07/10] Fix missing initializer warning in gio/gmenuexporter.c:g_dbus_connection_export_menu_model() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gio/gmenuexporter.c: In function ‘g_dbus_connection_export_menu_model’: gio/gmenuexporter.c:787:3: error: missing initializer for field ‘get_property’ of ‘GDBusInterfaceVTable’ {aka ‘const struct _GDBusInterfaceVTable’} 787 | }; | ^ --- gio/gmenuexporter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gmenuexporter.c b/gio/gmenuexporter.c index f319b886b..a212b29f3 100644 --- a/gio/gmenuexporter.c +++ b/gio/gmenuexporter.c @@ -783,7 +783,7 @@ g_dbus_connection_export_menu_model (GDBusConnection *connection, GError **error) { const GDBusInterfaceVTable vtable = { - g_menu_exporter_method_call, + g_menu_exporter_method_call, NULL, NULL, { 0 } }; GMenuExporter *exporter; guint id; From cf5a6cfe3a6419ff20bbec92c4a77a28cc0627d6 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 17 Nov 2020 12:27:35 +0100 Subject: [PATCH 08/10] Fix several warnings in gio/gapplicationimpl-dbus.c:g_application_impl_attempt_primary() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gio/gapplicationimpl-dbus.c: In function ‘g_application_impl_attempt_primary’: gio/gapplicationimpl-dbus.c:364:3: error: ‘static’ is not at beginning of declaration 364 | const static GDBusInterfaceVTable vtable = { | ^~~~~ gio/gapplicationimpl-dbus.c:368:3: error: missing initializer for field ‘padding’ of ‘GDBusInterfaceVTable’ {aka ‘const struct _GDBusInterfaceVTable’} 368 | }; | ^ --- gio/gapplicationimpl-dbus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gio/gapplicationimpl-dbus.c b/gio/gapplicationimpl-dbus.c index 263001b8e..23c280396 100644 --- a/gio/gapplicationimpl-dbus.c +++ b/gio/gapplicationimpl-dbus.c @@ -361,10 +361,11 @@ g_application_impl_attempt_primary (GApplicationImpl *impl, GCancellable *cancellable, GError **error) { - const static GDBusInterfaceVTable vtable = { + static const GDBusInterfaceVTable vtable = { g_application_impl_method_call, g_application_impl_get_property, - NULL /* set_property */ + NULL, /* set_property */ + { 0 } }; GApplicationClass *app_class = G_APPLICATION_GET_CLASS (impl->app); GBusNameOwnerFlags name_owner_flags; From 579e9e49c55f61910046f460c4640b49437d1077 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 17 Nov 2020 12:29:48 +0100 Subject: [PATCH 09/10] Fix several warnings in gio/gapplicationimpl-dbus.c:g_application_impl_command_line() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gio/gapplicationimpl-dbus.c: In function ‘g_application_impl_command_line’: gio/gapplicationimpl-dbus.c:772:3: error: ‘static’ is not at beginning of declaration 772 | const static GDBusInterfaceVTable vtable = { | ^~~~~ gio/gapplicationimpl-dbus.c:774:3: error: missing initializer for field ‘get_property’ of ‘GDBusInterfaceVTable’ {aka ‘const struct _GDBusInterfaceVTable’} 774 | }; | ^ --- gio/gapplicationimpl-dbus.c | 4 ++-- gio/gkeyfilesettingsbackend.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gio/gapplicationimpl-dbus.c b/gio/gapplicationimpl-dbus.c index 23c280396..5604b9260 100644 --- a/gio/gapplicationimpl-dbus.c +++ b/gio/gapplicationimpl-dbus.c @@ -776,8 +776,8 @@ g_application_impl_command_line (GApplicationImpl *impl, const gchar * const *arguments, GVariant *platform_data) { - const static GDBusInterfaceVTable vtable = { - g_application_impl_cmdline_method_call + static const GDBusInterfaceVTable vtable = { + g_application_impl_cmdline_method_call, NULL, NULL, { 0 } }; const gchar *object_path = "/org/gtk/Application/CommandLine"; GMainContext *context; diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c index 039ff06b6..60f0cc921 100644 --- a/gio/gkeyfilesettingsbackend.c +++ b/gio/gkeyfilesettingsbackend.c @@ -362,7 +362,7 @@ g_keyfile_settings_backend_write_tree (GSettingsBackend *backend, GTree *tree, gpointer origin_tag) { - WriteManyData data = { G_KEYFILE_SETTINGS_BACKEND (backend) }; + WriteManyData data = { G_KEYFILE_SETTINGS_BACKEND (backend), 0 }; gboolean success; GError *error = NULL; From 0c49122949a3772b5a13585140bc2685c3f6f073 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 17 Nov 2020 19:03:17 +0100 Subject: [PATCH 10/10] Fix signedness warning in gio/gdatainputstream.c:read_data() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gio/gdatainputstream.c: In function ‘read_data’: gio/gdatainputstream.c:313:35: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} 313 | g_warn_if_fail (res == size); | ^~ --- gio/gdatainputstream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gdatainputstream.c b/gio/gdatainputstream.c index 4440eb41f..676c6ae22 100644 --- a/gio/gdatainputstream.c +++ b/gio/gdatainputstream.c @@ -310,7 +310,7 @@ read_data (GDataInputStream *stream, res = g_input_stream_read (G_INPUT_STREAM (stream), buffer, size, NULL, NULL); - g_warn_if_fail (res == size); + g_warn_if_fail (res >= 0 && (gsize) res == size); return TRUE; }