From ad63044915669129e445d6dcec491310ccbae645 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Wed, 1 Jan 2020 15:43:10 +0200 Subject: [PATCH] mu: Fix some compiler warnings --- lib/mu-store.cc | 2 +- mu/mu-cmd-cfind.c | 5 ++--- mu/mu-cmd-index.c | 5 ++--- mu/mu-cmd-server.c | 9 +++++---- mu/mu-config.c | 6 ++---- mu/test-mu-cmd.c | 9 +++------ 6 files changed, 15 insertions(+), 21 deletions(-) diff --git a/lib/mu-store.cc b/lib/mu-store.cc index 244cb387..114cf57f 100644 --- a/lib/mu-store.cc +++ b/lib/mu-store.cc @@ -621,7 +621,7 @@ MuError mu_store_foreach (MuStore *store, MuStoreForeachFunc func, void *user_data, GError **err) { - g_return_val_if_fail (self, MU_ERROR); + g_return_val_if_fail (store, MU_ERROR); g_return_val_if_fail (func, MU_ERROR); try { diff --git a/mu/mu-cmd-cfind.c b/mu/mu-cmd-cfind.c index 9341b423..4157bb00 100644 --- a/mu/mu-cmd-cfind.c +++ b/mu/mu-cmd-cfind.c @@ -381,9 +381,8 @@ run_cmd_cfind (MuStore *store, gboolean color, GError **err) { - gboolean rv; - MuContacts *contacts; - ECData ecdata; + gboolean rv; + ECData ecdata; memset(&ecdata, 0, sizeof(ecdata)); diff --git a/mu/mu-cmd-index.c b/mu/mu-cmd-index.c index 9bb062a6..5f3c1125 100644 --- a/mu/mu-cmd-index.c +++ b/mu/mu-cmd-index.c @@ -255,14 +255,13 @@ cleanup_missing (MuIndex *midx, MuConfig *opts, MuIndexStats *stats, static void index_title (MuStore *store, MuConfig *opts) { - const char *blue, *green, *def; + const char *green, *def; char **addrs; int i; time_t created; - struct tm *tstamp; + struct tm *tstamp; char tbuf[40]; - blue = opts->nocolor ? "" : MU_COLOR_BLUE; green = opts->nocolor ? "" : MU_COLOR_GREEN; def = opts->nocolor ? "" : MU_COLOR_DEFAULT; diff --git a/mu/mu-cmd-server.c b/mu/mu-cmd-server.c index 70e8d952..a1279c1c 100644 --- a/mu/mu-cmd-server.c +++ b/mu/mu-cmd-server.c @@ -157,7 +157,9 @@ print_expr (const char* frm, ...) } } -static MuError + + +G_GNUC_PRINTF(2,3) static MuError print_error (MuError errcode, const char* frm, ...) { char *msg, *str; @@ -182,7 +184,7 @@ print_and_clear_g_error (GError **err) MuError rv; if (err && *err) - rv = print_error ((*err)->code, (*err)->message); + rv = print_error ((*err)->code, "%s", (*err)->message); else rv = print_error (MU_ERROR_INTERNAL, "unknown error"); @@ -1033,7 +1035,6 @@ get_checked_path (const char *path) cpath = mu_util_dir_expand(path); if (!cpath || !mu_util_check_dir (cpath, TRUE, FALSE)) { - char *err; print_error (MU_ERROR_IN_PARAMETERS, "not a readable dir: '%s'", cpath); g_free (cpath); @@ -1087,7 +1088,7 @@ cmd_index (ServerContext *ctx, GHashTable *args, GError **err) MuIndex *index; const char *argpath; char *path; - gboolean cleanup, lazy_check, contacts; + gboolean cleanup, lazy_check; index = NULL; diff --git a/mu/mu-config.c b/mu/mu-config.c index e475d90d..696366bd 100644 --- a/mu/mu-config.c +++ b/mu/mu-config.c @@ -1,7 +1,5 @@ -/* -*-Mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/ - /* -** Copyright (C) 2008-2013 Dirk-Jan C. Binnema +** Copyright (C) 2008-2020 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -172,7 +170,7 @@ config_options_group_index (void) } static void -set_group_find_defaults () +set_group_find_defaults (void) { /* note, when no fields are specified, we use * date-from-subject, and sort descending by date. If fields diff --git a/mu/test-mu-cmd.c b/mu/test-mu-cmd.c index c4c95a2c..ef131803 100644 --- a/mu/test-mu-cmd.c +++ b/mu/test-mu-cmd.c @@ -1,6 +1,6 @@ /* -*- mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- ** -** Copyright (C) 2008-2016 Dirk-Jan C. Binnema +** Copyright (C) 2008-2020 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -18,24 +18,21 @@ ** */ -#if HAVE_CONFIG_H + #include "config.h" -#endif /*HAVE_CONFIG_H*/ #include #include #include #include -#include "../mu-query.h" - #include #include #include #include "test-mu-common.h" #include "mu-store.hh" - +#include "mu-query.h" /* tests for the command line interface, uses testdir2 */