diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-06-27 13:07:56 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-06-27 13:07:56 +0000 |
commit | 5d56b5d1aaa305f0ee003b99bdd85a054c76bc3e (patch) | |
tree | 15eb57ba400aca64732e4e08fda33efde7b42846 | |
parent | f69c4bbf9ce09628798d38e10ae23e15e895b3ec (diff) | |
download | mailutils-5d56b5d1aaa305f0ee003b99bdd85a054c76bc3e.tar.gz mailutils-5d56b5d1aaa305f0ee003b99bdd85a054c76bc3e.tar.bz2 |
Minor fixes to get rid of the spurious gcc warnings
-rw-r--r-- | auth/sql.c | 4 | ||||
-rw-r--r-- | libsieve/actions.c | 2 | ||||
-rw-r--r-- | libsieve/extensions/vacation.c | 4 | ||||
-rw-r--r-- | libsieve/prog.c | 4 | ||||
-rw-r--r-- | libsieve/sieve.h | 6 | ||||
-rw-r--r-- | libsieve/sieve.l | 2 | ||||
-rw-r--r-- | mail/escape.c | 4 | ||||
-rw-r--r-- | mailbox/argcv.c | 2 | ||||
-rw-r--r-- | mailbox/file_stream.c | 4 | ||||
-rw-r--r-- | mailbox/munre.c | 4 | ||||
-rw-r--r-- | mailbox/mutil.c | 2 | ||||
-rw-r--r-- | mh/mh_alias.l | 2 | ||||
-rw-r--r-- | mh/mh_alias.y | 1 | ||||
-rw-r--r-- | mh/mh_init.c | 2 | ||||
-rw-r--r-- | mh/mh_whatnow.c | 2 | ||||
-rw-r--r-- | mh/mh_whom.c | 2 | ||||
-rw-r--r-- | mh/mhn.c | 45 | ||||
-rw-r--r-- | sql/sql.c | 12 |
18 files changed, 54 insertions, 50 deletions
diff --git a/auth/sql.c b/auth/sql.c index be25f3474..aac226900 100644 --- a/auth/sql.c +++ b/auth/sql.c @@ -1,5 +1,5 @@ /* 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; diff --git a/libsieve/actions.c b/libsieve/actions.c index 0fb9d359c..e241447e6 100644 --- a/libsieve/actions.c +++ b/libsieve/actions.c @@ -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); } diff --git a/libsieve/extensions/vacation.c b/libsieve/extensions/vacation.c index d141c377d..a0de330a4 100644 --- a/libsieve/extensions/vacation.c +++ b/libsieve/extensions/vacation.c @@ -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"), diff --git a/libsieve/prog.c b/libsieve/prog.c index 6a5d5ed16..cf7817d60 100644 --- a/libsieve/prog.c +++ b/libsieve/prog.c @@ -1,6 +1,6 @@ /* 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; diff --git a/libsieve/sieve.h b/libsieve/sieve.h index ba0269543..58ac4d64b 100644 --- a/libsieve/sieve.h +++ b/libsieve/sieve.h @@ -1,5 +1,5 @@ /* 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 */ diff --git a/libsieve/sieve.l b/libsieve/sieve.l index 6369652d9..f3e2f5d4b 100644 --- a/libsieve/sieve.l +++ b/libsieve/sieve.l @@ -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) diff --git a/mail/escape.c b/mail/escape.c index a07d196bf..b204f1cae 100644 --- a/mail/escape.c +++ b/mail/escape.c @@ -1,5 +1,5 @@ /* 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)) diff --git a/mailbox/argcv.c b/mailbox/argcv.c index a24f94c8d..eef3aa255 100644 --- a/mailbox/argcv.c +++ b/mailbox/argcv.c @@ -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 == '\\') diff --git a/mailbox/file_stream.c b/mailbox/file_stream.c index 851ac08a1..c04290089 100644 --- a/mailbox/file_stream.c +++ b/mailbox/file_stream.c @@ -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; diff --git a/mailbox/munre.c b/mailbox/munre.c index 60a76f2fe..5d16aa5a4 100644 --- a/mailbox/munre.c +++ b/mailbox/munre.c @@ -1,5 +1,5 @@ /* 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; diff --git a/mailbox/mutil.c b/mailbox/mutil.c index 23c5e3670..373a2fc0c 100644 --- a/mailbox/mutil.c +++ b/mailbox/mutil.c @@ -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 */ diff --git a/mh/mh_alias.l b/mh/mh_alias.l index a11f51fc2..b94f72780 100644 --- a/mh/mh_alias.l +++ b/mh/mh_alias.l @@ -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) diff --git a/mh/mh_alias.y b/mh/mh_alias.y index 00ce4a526..f4e42c52e 100644 --- a/mh/mh_alias.y +++ b/mh/mh_alias.y @@ -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; diff --git a/mh/mh_init.c b/mh/mh_init.c index cf6ace406..994ae6fc6 100644 --- a/mh/mh_init.c +++ b/mh/mh_init.c @@ -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); diff --git a/mh/mh_whatnow.c b/mh/mh_whatnow.c index ff6875cea..09746c297 100644 --- a/mh/mh_whatnow.c +++ b/mh/mh_whatnow.c @@ -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); } diff --git a/mh/mh_whom.c b/mh/mh_whom.c index b005e6167..131b64941 100644 --- a/mh/mh_whom.c +++ b/mh/mh_whom.c @@ -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,30 +1623,31 @@ 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) { - if (mu_argcv_get (val, "=", NULL, &argc, &argv) == 0) - { - int i; - - for (i = 0; i < argc; i++) - { - if ((strcmp (argv[i], "filename") == 0 - || strcmp (argv[i], "name") == 0) - && ++i < argc - && argv[i][0] == '=' - && ++i < argc) - { - name = normalize_path (dir, argv[i]); - break; - } - } - mu_argcv_free (argc, argv); - } - free (val); - } + && mu_header_aget_value (hdr, MU_HEADER_CONTENT_TYPE, &val) == 0) + { + if (mu_argcv_get (val, "=", NULL, &argc, &argv) == 0) + { + int i; + + for (i = 0; i < argc; i++) + { + if ((strcmp (argv[i], "filename") == 0 + || strcmp (argv[i], "name") == 0) + && ++i < argc + && argv[i][0] == '=' + && ++i < argc) + { + name = normalize_path (dir, argv[i]); + break; + } + } + mu_argcv_free (argc, argv); + } + free (val); + } } } - + if (!name) { char *fname = mhn_store_command (msg, part, prefix); @@ -1,5 +1,5 @@ /* 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; } |