Merge branch 'fix_more_warnings' into 'master'

Fix more warnings

See merge request GNOME/glib!1877
This commit is contained in:
Philip Withnall 2021-01-13 11:50:52 +00:00
commit 5f11206237
5 changed files with 14 additions and 12 deletions

View File

@ -1142,7 +1142,7 @@ desktop_file_dir_unindexed_setup_search (DesktopFileDir *dir)
{
/* Index the interesting keys... */
gchar **implements;
gint i;
gsize i;
for (i = 0; i < G_N_ELEMENTS (desktop_key_match_category); i++)
{
@ -1221,7 +1221,7 @@ static gboolean
array_contains (GPtrArray *array,
const gchar *str)
{
gint i;
guint i;
for (i = 0; i < array->len; i++)
if (g_str_equal (array->pdata[i], str))
@ -1545,7 +1545,7 @@ desktop_file_dir_get_implementations (DesktopFileDir *dir,
static void
desktop_file_dirs_lock (void)
{
gint i;
guint i;
const gchar *user_config_dir = g_get_user_config_dir ();
g_mutex_lock (&desktop_file_dir_lock);
@ -2771,6 +2771,7 @@ g_desktop_app_info_launch_uris_with_spawn (GDesktopAppInfo *info,
char *sn_id = NULL;
char **wrapped_argv;
int i;
gsize j;
const gchar * const wrapper_argv[] =
{
"/bin/sh",
@ -2834,8 +2835,8 @@ g_desktop_app_info_launch_uris_with_spawn (GDesktopAppInfo *info,
* resurrected). */
wrapped_argv = g_new (char *, argc + G_N_ELEMENTS (wrapper_argv) + 1);
for (i = 0; i < G_N_ELEMENTS (wrapper_argv); i++)
wrapped_argv[i] = g_strdup (wrapper_argv[i]);
for (j = 0; j < G_N_ELEMENTS (wrapper_argv); j++)
wrapped_argv[j] = g_strdup (wrapper_argv[j]);
for (i = 0; i < argc; i++)
wrapped_argv[i + G_N_ELEMENTS (wrapper_argv)] = g_steal_pointer (&argv[i]);

View File

@ -649,7 +649,8 @@ g_file_monitor_source_new (gpointer instance,
static GSourceFuncs source_funcs = {
NULL, NULL,
g_file_monitor_source_dispatch,
g_file_monitor_source_finalize
g_file_monitor_source_finalize,
NULL, NULL
};
GFileMonitorSource *fms;
GSource *source;

View File

@ -476,7 +476,7 @@ g_memory_input_stream_seek (GSeekable *seekable,
return FALSE;
}
if (absolute < 0 || absolute > priv->len)
if (absolute < 0 || (gsize) absolute > priv->len)
{
g_set_error_literal (error,
G_IO_ERROR,

View File

@ -175,7 +175,7 @@ g_socket_control_message_deserialize (int level,
GSocketControlMessage *message;
GType *message_types;
guint n_message_types;
int i;
guint i;
/* Ensure we know about the built in types */
#ifndef G_OS_WIN32

View File

@ -256,7 +256,7 @@ static void
child_setup (gpointer user_data)
{
ChildData *child_data = user_data;
gint i;
guint i;
gint result;
int errsv;
@ -268,7 +268,7 @@ child_setup (gpointer user_data)
* have been created O_CLOEXEC.
*/
for (i = 0; i < 3; i++)
if (child_data->fds[i] != -1 && child_data->fds[i] != i)
if (child_data->fds[i] != -1 && child_data->fds[i] != (gint) i)
{
do
{
@ -451,7 +451,7 @@ initable_init (GInitable *initable,
{
GSubprocess *self = G_SUBPROCESS (initable);
#ifdef G_OS_UNIX
ChildData child_data = { { -1, -1, -1 }, 0 };
ChildData child_data = { { -1, -1, -1 }, 0, NULL, NULL, NULL };
#endif
gint *pipe_ptrs[3] = { NULL, NULL, NULL };
gint pipe_fds[3] = { -1, -1, -1 };
@ -584,7 +584,7 @@ initable_init (GInitable *initable,
#endif
s = g_snprintf (self->identifier, sizeof self->identifier, "%"G_GUINT64_FORMAT, identifier);
g_assert (0 < s && s < sizeof self->identifier);
g_assert (0 < s && (gsize) s < sizeof self->identifier);
}
/* Start attempting to reap the child immediately */