mu: Fix some compiler warnings

This commit is contained in:
Dirk-Jan C. Binnema 2020-01-01 15:43:10 +02:00
parent 80c5e25b08
commit ad63044915
6 changed files with 15 additions and 21 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -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 <djcb@djcbsoftware.nl>
** Copyright (C) 2008-2020 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** 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

View File

@ -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 <djcb@djcbsoftware.nl>
** Copyright (C) 2008-2020 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** 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 <glib.h>
#include <glib/gstdio.h>
#include <string.h>
#include <errno.h>
#include "../mu-query.h"
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "test-mu-common.h"
#include "mu-store.hh"
#include "mu-query.h"
/* tests for the command line interface, uses testdir2 */