Commit 5d56b5d1 5d56b5d1aaa305f0ee003b99bdd85a054c76bc3e by Sergey Poznyakoff

Minor fixes to get rid of the spurious gcc warnings

1 parent f69c4bbf
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -616,7 +616,7 @@ mu_sql_authenticate (struct mu_auth_data **return_data ARG_UNUSED,
const void *key,
void *func_data ARG_UNUSED, void *call_data)
{
struct mu_auth_data *auth_data = key;
const struct mu_auth_data *auth_data = key;
char *pass = call_data;
char *sql_pass;
int rc;
......
......@@ -125,7 +125,7 @@ mu_sieve_get_message_sender (mu_message_t msg, char **ptext)
{
mu_header_t hdr = NULL;
mu_message_get_header (msg, &hdr);
if (rc = mu_header_aget_value (hdr, MU_HEADER_SENDER, &text))
if ((rc = mu_header_aget_value (hdr, MU_HEADER_SENDER, &text)))
rc = mu_header_aget_value (hdr, MU_HEADER_FROM, &text);
}
......
......@@ -64,7 +64,7 @@ build_mime (mu_sieve_machine_t mach, mu_list_t tags, mu_mime_t *pmime,
mu_message_get_body (newmsg, &body);
mu_body_get_stream (body, &stream);
if (rc = mu_memory_stream_create (&input, 0, MU_STREAM_RDWR))
if ((rc = mu_memory_stream_create (&input, 0, MU_STREAM_RDWR)))
{
mu_sieve_error (mach,
_("cannot create temporary stream: %s"),
......@@ -72,7 +72,7 @@ build_mime (mu_sieve_machine_t mach, mu_list_t tags, mu_mime_t *pmime,
return 1;
}
if (rc = mu_stream_open (input))
if ((rc = mu_stream_open (input)))
{
mu_sieve_error (mach,
_("cannot open temporary stream: %s"),
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2004,
2005 Free Software Foundation, Inc.
2005, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -84,7 +84,7 @@ sieve_code_number (long num)
}
int
sieve_code_string (char *string)
sieve_code_string (const char *string)
{
sieve_op_t op;
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2005, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -31,7 +31,7 @@ typedef union {
mu_sieve_value_t *val;
mu_list_t list;
long number;
char *string;
const char *string;
size_t pc;
size_t line;
} sieve_op_t;
......@@ -59,7 +59,7 @@ struct sieve_machine {
int debug_level; /* Debugging level */
jmp_buf errbuf; /* Target location for non-local exits */
char *identifier; /* Name of action or test being executed */
const char *identifier; /* Name of action or test being executed */
mu_mailbox_t mailbox; /* Mailbox to operate upon */
size_t msgno; /* Current message number */
......
......@@ -240,7 +240,7 @@ push_source (const char *name)
yyerror (_("recursive inclusion"));
return 1;
}
if (ctx = ctx_lookup (st.st_ino))
if ((ctx = ctx_lookup (st.st_ino)))
{
yyerror (_("recursive inclusion"));
if (ctx->prev)
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2001, 2002, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -187,7 +187,7 @@ escape_shell (int argc, char **argv, compose_env_t *env)
int
escape_command (int argc, char **argv, compose_env_t *env)
{
struct mail_command_entry *entry;
const struct mail_command_entry *entry;
int status;
if (escape_check_args (argc, argv))
......
......@@ -209,7 +209,7 @@ argcv_unquote_copy (char *dst, const char *src, size_t n)
case '"':
if (!expect_delim)
{
char *p;
const char *p;
for (p = src+i+1; *p && *p != src[i]; p++)
if (*p == '\\')
......
......@@ -582,8 +582,8 @@ mu_temp_file_stream_create (mu_stream_t *stream, const char *dir)
fs->tempfile = 1;
if (!dir)
fs->filename = dir;
else if ((fs->filename = strdup(dir)) == NULL)
fs->filename = NULL;
else if ((fs->filename = strdup (dir)) == NULL)
{
free (fs);
return ENOMEM;
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -31,7 +31,7 @@
static regex_t *re_prefix;
int
mu_unre_set_regex (char *str, int caseflag, char **errp)
mu_unre_set_regex (const char *str, int caseflag, char **errp)
{
int rc;
int flags = REG_EXTENDED;
......
......@@ -1350,7 +1350,7 @@ char *
__argp_base_name (const char *arg)
{
char *p = strrchr (arg, '/');
return p ? p + 1 : arg;
return (char *)(p ? p + 1 : arg);
}
/* A locale-independent version of strftime */
......
......@@ -255,7 +255,7 @@ push_source (const char *name, int fail)
free (filename);
return 1;
}
if (ctx = ctx_lookup (st.st_ino))
if ((ctx = ctx_lookup (st.st_ino)))
{
ali_parse_error (_("recursive inclusion"));
if (ctx->prev)
......
......@@ -359,7 +359,6 @@ mh_alias_get_address (char *name, mu_address_t *paddr, int *incl)
{
mu_iterator_t itr;
mu_list_t list;
const char *domain = NULL;
if (incl)
*incl = 0;
......
......@@ -564,7 +564,7 @@ mh_spawnp (const char *prog, const char *file)
xargv[i++] = (char*) file;
xargv[i++] = NULL;
rc = mu_spawnvp (xargv[0], (const char**) xargv, &status);
rc = mu_spawnvp (xargv[0], xargv, &status);
free (xargv);
mu_argcv_free (argc, argv);
......
......@@ -265,7 +265,7 @@ invoke (char *compname, char *defval, int argc, char **argv,
if (extra1)
xargv[i++] = extra1;
xargv[i++] = NULL;
rc = mu_spawnvp (xargv[0], (const char **) xargv, &status);
rc = mu_spawnvp (xargv[0], xargv, &status);
free (xargv);
return rc ? rc : check_exit_status (progname, status);
}
......
......@@ -105,7 +105,7 @@ mh_alias_expand (char *str, mu_address_t *paddr, int *incl)
{
int status;
mu_argcv_string (argc, argv, &buf);
if (status = mu_address_create (paddr, buf))
if ((status = mu_address_create (paddr, buf)))
mu_error (_("Bad address `%s': %s"), buf, mu_strerror (status));
free (buf);
}
......
......@@ -1623,7 +1623,8 @@ store_handler (mu_message_t msg, msg_part_t part, char *type, char *encoding,
}
if (!name
&& mu_header_aget_value (hdr, MU_HEADER_CONTENT_TYPE, &val) == 0) {
&& mu_header_aget_value (hdr, MU_HEADER_CONTENT_TYPE, &val) == 0)
{
if (mu_argcv_get (val, "=", NULL, &argc, &argv) == 0)
{
int i;
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -48,6 +48,8 @@ init_disptab ()
return 0;
}
/* FIXME: See comment 'For dynamic loading' below */
#if 0
static int
add_disptab (mu_sql_dispatch_t *tab)
{
......@@ -64,6 +66,7 @@ add_disptab (mu_sql_dispatch_t *tab)
sql_disptab[sql_disptab_next] = tab;
return sql_disptab_next++;
}
#endif
int
mu_sql_interface_index (char *name)
......@@ -75,9 +78,10 @@ mu_sql_interface_index (char *name)
for (i = 1; i < sql_disptab_next; i++)
if (sql_disptab[i] && (!name || strcmp (sql_disptab[i]->name, name) == 0))
return i;
// FIXME
// if (name && mu_sql_load_ext (name, "dispatch_tab", &tab))
// return add_disptab (tab);
/* FIXME: For dynamic loading
if (name && mu_sql_load_ext (name, "dispatch_tab", &tab))
return add_disptab (tab);
*/
return 0;
}
......