Merge branch 'fix_more_warnings' into 'master'

Fix more warnings

See merge request GNOME/glib!1891
This commit is contained in:
Philip Withnall 2021-01-30 22:34:40 +00:00
commit ede8900f4e
8 changed files with 16 additions and 13 deletions

View File

@ -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;

View File

@ -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;
@ -775,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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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++)
{

View File

@ -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++)
@ -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;
@ -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));

View File

@ -2162,7 +2162,9 @@ GSourceFuncs trivial_source_funcs = {
NULL, /* prepare */
NULL, /* check */
trivial_source_dispatch,
NULL
NULL, /* finalize */
NULL, /* closure */
NULL /* marshal */
};
static void