diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2021-02-10 20:01:08 +0000 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2021-02-10 20:01:08 +0000 |
commit | efe49e46cfd8f5d36c55c7036d4e1852570b958b (patch) | |
tree | 706505bf9c26a47fa153955cebaa118f6c3593d4 | |
parent | 206ebfbff60bd6be5208a8a25f7cb912a3d27311 (diff) | |
parent | bdcd7eca3b0db3fddcb2d17be85c3e06ec4447dd (diff) | |
download | glib-efe49e46cfd8f5d36c55c7036d4e1852570b958b.tar.gz |
Merge branch 'fix_more_warnings' into 'master'
Fix more warnings
See merge request GNOME/glib!1938
-rw-r--r-- | fuzzing/fuzz_dbus_message.c | 2 | ||||
-rw-r--r-- | gio/gio-tool-monitor.c | 3 | ||||
-rw-r--r-- | gio/gio-tool-tree.c | 2 | ||||
-rw-r--r-- | gio/gio-tool.c | 2 | ||||
-rw-r--r-- | gio/glib-compile-resources.c | 2 | ||||
-rw-r--r-- | gio/glib-compile-schemas.c | 8 | ||||
-rw-r--r-- | gio/gsettings-mapping.c | 8 | ||||
-rw-r--r-- | gio/gvdb/gvdb-builder.c | 2 |
8 files changed, 15 insertions, 14 deletions
diff --git a/fuzzing/fuzz_dbus_message.c b/fuzzing/fuzz_dbus_message.c index bccb2ba3e..1030d8df0 100644 --- a/fuzzing/fuzz_dbus_message.c +++ b/fuzzing/fuzz_dbus_message.c @@ -1,6 +1,6 @@ #include "fuzz.h" -const static GDBusCapabilityFlags flags = G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING; +static const GDBusCapabilityFlags flags = G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING; int LLVMFuzzerTestOneInput (const unsigned char *data, size_t size) diff --git a/gio/gio-tool-monitor.c b/gio/gio-tool-monitor.c index f2ffb3387..73ee1b12e 100644 --- a/gio/gio-tool-monitor.c +++ b/gio/gio-tool-monitor.c @@ -45,7 +45,8 @@ static const GOptionEntry entries[] = { N_("Report moves and renames as simple deleted/created events"), NULL }, { "mounts", 'm', 0, G_OPTION_ARG_NONE, &mounts, N_("Watch for mount events"), NULL }, - { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &watch_default }, + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &watch_default, + NULL, NULL }, { NULL } }; diff --git a/gio/gio-tool-tree.c b/gio/gio-tool-tree.c index e63752edb..2327c4549 100644 --- a/gio/gio-tool-tree.c +++ b/gio/gio-tool-tree.c @@ -52,7 +52,7 @@ sort_info_by_name (GFileInfo *a, GFileInfo *b) } static void -do_tree (GFile *f, int level, guint64 pattern) +do_tree (GFile *f, unsigned int level, guint64 pattern) { GFileEnumerator *enumerator; GError *error = NULL; diff --git a/gio/gio-tool.c b/gio/gio-tool.c index ff82c638e..e60d56751 100644 --- a/gio/gio-tool.c +++ b/gio/gio-tool.c @@ -149,7 +149,7 @@ char * attribute_flags_to_string (GFileAttributeInfoFlags flags) { GString *s; - int i; + gsize i; gboolean first; struct { guint32 mask; diff --git a/gio/glib-compile-resources.c b/gio/glib-compile-resources.c index f3675c152..74373e5b0 100644 --- a/gio/glib-compile-resources.c +++ b/gio/glib-compile-resources.c @@ -550,7 +550,7 @@ parse_resource_file (const gchar *filename, gboolean collect_data, GHashTable *files) { - GMarkupParser parser = { start_element, end_element, text }; + GMarkupParser parser = { start_element, end_element, text, NULL, NULL }; ParseState state = { 0, }; GMarkupParseContext *context; GError *error = NULL; diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c index 788812048..cfea042f8 100644 --- a/gio/glib-compile-schemas.c +++ b/gio/glib-compile-schemas.c @@ -363,7 +363,7 @@ key_state_set_range (KeyState *state, { 'd', "-inf", "inf" }, }; gboolean type_ok = FALSE; - gint i; + gsize i; if (state->minimum) { @@ -705,7 +705,7 @@ key_state_serialise (KeyState *state) guint32 *words; gpointer data; gsize size; - gint i; + gsize i; data = state->strinfo->str; size = state->strinfo->len; @@ -1770,7 +1770,7 @@ static GHashTable * parse_gschema_files (gchar **files, gboolean strict) { - GMarkupParser parser = { start_element, end_element, text }; + GMarkupParser parser = { start_element, end_element, text, NULL, NULL }; ParseState state = { 0, }; const gchar *filename; GError *error = NULL; @@ -2173,7 +2173,7 @@ main (int argc, char **argv) { "targetdir", 0, 0, G_OPTION_ARG_FILENAME, &targetdir, N_("Where to store the gschemas.compiled file"), N_("DIRECTORY") }, { "strict", 0, 0, G_OPTION_ARG_NONE, &strict, N_("Abort on any errors in schemas"), NULL }, { "dry-run", 0, 0, G_OPTION_ARG_NONE, &dry_run, N_("Do not write the gschema.compiled file"), NULL }, - { "allow-any-name", 0, 0, G_OPTION_ARG_NONE, &allow_any_name, N_("Do not enforce key name restrictions") }, + { "allow-any-name", 0, 0, G_OPTION_ARG_NONE, &allow_any_name, N_("Do not enforce key name restrictions"), NULL }, /* These options are only for use in the gschema-compile tests */ { "schema-file", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME_ARRAY, &schema_files, NULL, NULL }, diff --git a/gio/gsettings-mapping.c b/gio/gsettings-mapping.c index 8c64b02a5..4db9724fe 100644 --- a/gio/gsettings-mapping.c +++ b/gio/gsettings-mapping.c @@ -62,7 +62,7 @@ g_settings_set_mapping_int (const GValue *value, } else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_UINT64)) { - if (0 <= l && l <= G_MAXUINT64) + if (0 <= l && (guint64) l <= G_MAXUINT64) variant = g_variant_new_uint64 ((guint64) l); } else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_HANDLE)) @@ -117,7 +117,7 @@ g_settings_set_mapping_float (const GValue *value, } else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_UINT64)) { - if (0 <= l && l <= G_MAXUINT64) + if (0 <= l && (guint64) l <= G_MAXUINT64) variant = g_variant_new_uint64 ((guint64) l); } else if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_HANDLE)) @@ -221,7 +221,7 @@ g_settings_get_mapping_int (GValue *value, else if (G_VALUE_HOLDS_UINT64 (value)) { g_value_set_uint64 (value, l); - return (0 <= l && l <= G_MAXUINT64); + return (0 <= l && (guint64) l <= G_MAXUINT64); } else if (G_VALUE_HOLDS_DOUBLE (value)) { @@ -266,7 +266,7 @@ g_settings_get_mapping_float (GValue *value, else if (G_VALUE_HOLDS_UINT64 (value)) { g_value_set_uint64 (value, l); - return (0 <= l && l <= G_MAXUINT64); + return (0 <= l && (guint64) l <= G_MAXUINT64); } else if (G_VALUE_HOLDS_DOUBLE (value)) { diff --git a/gio/gvdb/gvdb-builder.c b/gio/gvdb/gvdb-builder.c index 918ee43fd..64d8201dc 100644 --- a/gio/gvdb/gvdb-builder.c +++ b/gio/gvdb/gvdb-builder.c @@ -463,7 +463,7 @@ static GString * file_builder_serialise (FileBuilder *fb, struct gvdb_pointer root) { - struct gvdb_header header; + struct gvdb_header header = { { 0, 0 }, { 0 }, { 0 }, { { 0 }, { 0 } } }; GString *result; memset (&header, 0, sizeof (header)); |