From 6a48dacf7879f000c769635b125a033816d7c68b Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Fri, 25 Dec 2015 18:10:10 -0800 Subject: [PATCH] Fix a few compiler warnings --- moo/mooapp/mooapp.c | 2 +- moo/mooedit/mootextprint.c | 2 +- moo/mooutils/mooapp-ipc.c | 2 +- moo/mooutils/mooutils-gobject.c | 4 ++-- moo/xdgmime/xdgmimecache.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/moo/mooapp/mooapp.c b/moo/mooapp/mooapp.c index 18acf830..35dfc33f 100644 --- a/moo/mooapp/mooapp.c +++ b/moo/mooapp/mooapp.c @@ -697,7 +697,7 @@ moo_app_init_mac (G_GNUC_UNUSED MooApp *app) static void input_callback (char cmd, const char *data, - guint len, + gsize len, gpointer cb_data) { MooApp *app = cb_data; diff --git a/moo/mooedit/mootextprint.c b/moo/mooedit/mootextprint.c index 31c19b49..ba87ea0e 100644 --- a/moo/mooedit/mootextprint.c +++ b/moo/mooedit/mootextprint.c @@ -2094,7 +2094,7 @@ hf_format_chunk_new (HFFormatType type, chunk->type = type; if (string) - chunk->string = g_strndup (string, len >= 0 ? len : strlen (string)); + chunk->string = g_strndup (string, len >= 0 ? (gsize) len : strlen (string)); return chunk; } diff --git a/moo/mooutils/mooapp-ipc.c b/moo/mooutils/mooapp-ipc.c index b766819b..c1d73b69 100644 --- a/moo/mooutils/mooapp-ipc.c +++ b/moo/mooutils/mooapp-ipc.c @@ -228,7 +228,7 @@ moo_ipc_send (GObject *sender, gssize len) { GString *header; - gsize id_len; + guint id_len; g_return_if_fail (!sender || G_IS_OBJECT (sender)); g_return_if_fail (id != NULL); diff --git a/moo/mooutils/mooutils-gobject.c b/moo/mooutils/mooutils-gobject.c index 8de1dddc..a8c72d52 100644 --- a/moo/mooutils/mooutils-gobject.c +++ b/moo/mooutils/mooutils-gobject.c @@ -995,7 +995,7 @@ test_one_enum (GType enum_type, TEST_EXPECT_WARNING (0, "%s", "string to enum"); - if (!bad != _moo_value_convert (&sval, &eval)) + if ((!bad) != _moo_value_convert (&sval, &eval)) { if (!bad) TEST_FAILED_MSG ("could not convert string '%s' to enum '%s'", @@ -1047,7 +1047,7 @@ test_one_flags (GType flags_type, TEST_EXPECT_WARNING (0, "%s", "string to flags"); - if (!bad != _moo_value_convert (&sval, &eval)) + if ((!bad) != _moo_value_convert (&sval, &eval)) { if (!bad) TEST_FAILED_MSG ("could not convert string '%s' to flags type '%s'", diff --git a/moo/xdgmime/xdgmimecache.c b/moo/xdgmime/xdgmimecache.c index da81dc95..b63348b8 100644 --- a/moo/xdgmime/xdgmimecache.c +++ b/moo/xdgmime/xdgmimecache.c @@ -354,7 +354,7 @@ typedef struct { static int cache_glob_lookup_literal (const char *file_name, const char *mime_types[], - int n_mime_types) + G_GNUC_UNUSED int n_mime_types) { const char *ptr; int i, min, max, mid, cmp;