Minor fixes to get rid of the spurious gcc warnings
Showing
18 changed files
with
33 additions
and
29 deletions
1 | /* GNU Mailutils -- a suite of utilities for electronic mail | 1 | /* GNU Mailutils -- a suite of utilities for electronic mail |
2 | Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. | 2 | Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Lesser General Public | 5 | 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, | ... | @@ -616,7 +616,7 @@ mu_sql_authenticate (struct mu_auth_data **return_data ARG_UNUSED, |
616 | const void *key, | 616 | const void *key, |
617 | void *func_data ARG_UNUSED, void *call_data) | 617 | void *func_data ARG_UNUSED, void *call_data) |
618 | { | 618 | { |
619 | struct mu_auth_data *auth_data = key; | 619 | const struct mu_auth_data *auth_data = key; |
620 | char *pass = call_data; | 620 | char *pass = call_data; |
621 | char *sql_pass; | 621 | char *sql_pass; |
622 | int rc; | 622 | int rc; | ... | ... |
... | @@ -125,7 +125,7 @@ mu_sieve_get_message_sender (mu_message_t msg, char **ptext) | ... | @@ -125,7 +125,7 @@ mu_sieve_get_message_sender (mu_message_t msg, char **ptext) |
125 | { | 125 | { |
126 | mu_header_t hdr = NULL; | 126 | mu_header_t hdr = NULL; |
127 | mu_message_get_header (msg, &hdr); | 127 | mu_message_get_header (msg, &hdr); |
128 | if (rc = mu_header_aget_value (hdr, MU_HEADER_SENDER, &text)) | 128 | if ((rc = mu_header_aget_value (hdr, MU_HEADER_SENDER, &text))) |
129 | rc = mu_header_aget_value (hdr, MU_HEADER_FROM, &text); | 129 | rc = mu_header_aget_value (hdr, MU_HEADER_FROM, &text); |
130 | } | 130 | } |
131 | 131 | ... | ... |
... | @@ -64,7 +64,7 @@ build_mime (mu_sieve_machine_t mach, mu_list_t tags, mu_mime_t *pmime, | ... | @@ -64,7 +64,7 @@ build_mime (mu_sieve_machine_t mach, mu_list_t tags, mu_mime_t *pmime, |
64 | mu_message_get_body (newmsg, &body); | 64 | mu_message_get_body (newmsg, &body); |
65 | mu_body_get_stream (body, &stream); | 65 | mu_body_get_stream (body, &stream); |
66 | 66 | ||
67 | if (rc = mu_memory_stream_create (&input, 0, MU_STREAM_RDWR)) | 67 | if ((rc = mu_memory_stream_create (&input, 0, MU_STREAM_RDWR))) |
68 | { | 68 | { |
69 | mu_sieve_error (mach, | 69 | mu_sieve_error (mach, |
70 | _("cannot create temporary stream: %s"), | 70 | _("cannot create temporary stream: %s"), |
... | @@ -72,7 +72,7 @@ build_mime (mu_sieve_machine_t mach, mu_list_t tags, mu_mime_t *pmime, | ... | @@ -72,7 +72,7 @@ build_mime (mu_sieve_machine_t mach, mu_list_t tags, mu_mime_t *pmime, |
72 | return 1; | 72 | return 1; |
73 | } | 73 | } |
74 | 74 | ||
75 | if (rc = mu_stream_open (input)) | 75 | if ((rc = mu_stream_open (input))) |
76 | { | 76 | { |
77 | mu_sieve_error (mach, | 77 | mu_sieve_error (mach, |
78 | _("cannot open temporary stream: %s"), | 78 | _("cannot open temporary stream: %s"), | ... | ... |
1 | /* GNU Mailutils -- a suite of utilities for electronic mail | 1 | /* GNU Mailutils -- a suite of utilities for electronic mail |
2 | Copyright (C) 1999, 2000, 2001, 2002, 2004, | 2 | Copyright (C) 1999, 2000, 2001, 2002, 2004, |
3 | 2005 Free Software Foundation, Inc. | 3 | 2005, 2006 Free Software Foundation, Inc. |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Lesser General Public | 6 | modify it under the terms of the GNU Lesser General Public |
... | @@ -84,7 +84,7 @@ sieve_code_number (long num) | ... | @@ -84,7 +84,7 @@ sieve_code_number (long num) |
84 | } | 84 | } |
85 | 85 | ||
86 | int | 86 | int |
87 | sieve_code_string (char *string) | 87 | sieve_code_string (const char *string) |
88 | { | 88 | { |
89 | sieve_op_t op; | 89 | sieve_op_t op; |
90 | 90 | ... | ... |
1 | /* GNU Mailutils -- a suite of utilities for electronic mail | 1 | /* GNU Mailutils -- a suite of utilities for electronic mail |
2 | Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc. | 2 | Copyright (C) 1999, 2000, 2001, 2002, 2005, 2006 Free Software Foundation, Inc. |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Lesser General Public | 5 | modify it under the terms of the GNU Lesser General Public |
... | @@ -31,7 +31,7 @@ typedef union { | ... | @@ -31,7 +31,7 @@ typedef union { |
31 | mu_sieve_value_t *val; | 31 | mu_sieve_value_t *val; |
32 | mu_list_t list; | 32 | mu_list_t list; |
33 | long number; | 33 | long number; |
34 | char *string; | 34 | const char *string; |
35 | size_t pc; | 35 | size_t pc; |
36 | size_t line; | 36 | size_t line; |
37 | } sieve_op_t; | 37 | } sieve_op_t; |
... | @@ -59,7 +59,7 @@ struct sieve_machine { | ... | @@ -59,7 +59,7 @@ struct sieve_machine { |
59 | 59 | ||
60 | int debug_level; /* Debugging level */ | 60 | int debug_level; /* Debugging level */ |
61 | jmp_buf errbuf; /* Target location for non-local exits */ | 61 | jmp_buf errbuf; /* Target location for non-local exits */ |
62 | char *identifier; /* Name of action or test being executed */ | 62 | const char *identifier; /* Name of action or test being executed */ |
63 | 63 | ||
64 | mu_mailbox_t mailbox; /* Mailbox to operate upon */ | 64 | mu_mailbox_t mailbox; /* Mailbox to operate upon */ |
65 | size_t msgno; /* Current message number */ | 65 | size_t msgno; /* Current message number */ | ... | ... |
... | @@ -240,7 +240,7 @@ push_source (const char *name) | ... | @@ -240,7 +240,7 @@ push_source (const char *name) |
240 | yyerror (_("recursive inclusion")); | 240 | yyerror (_("recursive inclusion")); |
241 | return 1; | 241 | return 1; |
242 | } | 242 | } |
243 | if (ctx = ctx_lookup (st.st_ino)) | 243 | if ((ctx = ctx_lookup (st.st_ino))) |
244 | { | 244 | { |
245 | yyerror (_("recursive inclusion")); | 245 | yyerror (_("recursive inclusion")); |
246 | if (ctx->prev) | 246 | if (ctx->prev) | ... | ... |
1 | /* GNU Mailutils -- a suite of utilities for electronic mail | 1 | /* GNU Mailutils -- a suite of utilities for electronic mail |
2 | Copyright (C) 1999, 2001, 2002, 2005 Free Software Foundation, Inc. | 2 | Copyright (C) 1999, 2001, 2002, 2005, 2006 Free Software Foundation, Inc. |
3 | 3 | ||
4 | GNU Mailutils is free software; you can redistribute it and/or modify | 4 | GNU Mailutils is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by | 5 | 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) | ... | @@ -187,7 +187,7 @@ escape_shell (int argc, char **argv, compose_env_t *env) |
187 | int | 187 | int |
188 | escape_command (int argc, char **argv, compose_env_t *env) | 188 | escape_command (int argc, char **argv, compose_env_t *env) |
189 | { | 189 | { |
190 | struct mail_command_entry *entry; | 190 | const struct mail_command_entry *entry; |
191 | int status; | 191 | int status; |
192 | 192 | ||
193 | if (escape_check_args (argc, argv)) | 193 | if (escape_check_args (argc, argv)) | ... | ... |
... | @@ -209,7 +209,7 @@ argcv_unquote_copy (char *dst, const char *src, size_t n) | ... | @@ -209,7 +209,7 @@ argcv_unquote_copy (char *dst, const char *src, size_t n) |
209 | case '"': | 209 | case '"': |
210 | if (!expect_delim) | 210 | if (!expect_delim) |
211 | { | 211 | { |
212 | char *p; | 212 | const char *p; |
213 | 213 | ||
214 | for (p = src+i+1; *p && *p != src[i]; p++) | 214 | for (p = src+i+1; *p && *p != src[i]; p++) |
215 | if (*p == '\\') | 215 | if (*p == '\\') | ... | ... |
... | @@ -582,8 +582,8 @@ mu_temp_file_stream_create (mu_stream_t *stream, const char *dir) | ... | @@ -582,8 +582,8 @@ mu_temp_file_stream_create (mu_stream_t *stream, const char *dir) |
582 | fs->tempfile = 1; | 582 | fs->tempfile = 1; |
583 | 583 | ||
584 | if (!dir) | 584 | if (!dir) |
585 | fs->filename = dir; | 585 | fs->filename = NULL; |
586 | else if ((fs->filename = strdup(dir)) == NULL) | 586 | else if ((fs->filename = strdup (dir)) == NULL) |
587 | { | 587 | { |
588 | free (fs); | 588 | free (fs); |
589 | return ENOMEM; | 589 | return ENOMEM; | ... | ... |
1 | /* GNU Mailutils -- a suite of utilities for electronic mail | 1 | /* GNU Mailutils -- a suite of utilities for electronic mail |
2 | Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. | 2 | Copyright (C) 1999, 2000, 2001, 2002, 2003, 2006 Free Software Foundation, Inc. |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Lesser General Public | 5 | modify it under the terms of the GNU Lesser General Public |
... | @@ -31,7 +31,7 @@ | ... | @@ -31,7 +31,7 @@ |
31 | static regex_t *re_prefix; | 31 | static regex_t *re_prefix; |
32 | 32 | ||
33 | int | 33 | int |
34 | mu_unre_set_regex (char *str, int caseflag, char **errp) | 34 | mu_unre_set_regex (const char *str, int caseflag, char **errp) |
35 | { | 35 | { |
36 | int rc; | 36 | int rc; |
37 | int flags = REG_EXTENDED; | 37 | int flags = REG_EXTENDED; | ... | ... |
... | @@ -1350,7 +1350,7 @@ char * | ... | @@ -1350,7 +1350,7 @@ char * |
1350 | __argp_base_name (const char *arg) | 1350 | __argp_base_name (const char *arg) |
1351 | { | 1351 | { |
1352 | char *p = strrchr (arg, '/'); | 1352 | char *p = strrchr (arg, '/'); |
1353 | return p ? p + 1 : arg; | 1353 | return (char *)(p ? p + 1 : arg); |
1354 | } | 1354 | } |
1355 | 1355 | ||
1356 | /* A locale-independent version of strftime */ | 1356 | /* A locale-independent version of strftime */ | ... | ... |
... | @@ -255,7 +255,7 @@ push_source (const char *name, int fail) | ... | @@ -255,7 +255,7 @@ push_source (const char *name, int fail) |
255 | free (filename); | 255 | free (filename); |
256 | return 1; | 256 | return 1; |
257 | } | 257 | } |
258 | if (ctx = ctx_lookup (st.st_ino)) | 258 | if ((ctx = ctx_lookup (st.st_ino))) |
259 | { | 259 | { |
260 | ali_parse_error (_("recursive inclusion")); | 260 | ali_parse_error (_("recursive inclusion")); |
261 | if (ctx->prev) | 261 | if (ctx->prev) | ... | ... |
... | @@ -359,7 +359,6 @@ mh_alias_get_address (char *name, mu_address_t *paddr, int *incl) | ... | @@ -359,7 +359,6 @@ mh_alias_get_address (char *name, mu_address_t *paddr, int *incl) |
359 | { | 359 | { |
360 | mu_iterator_t itr; | 360 | mu_iterator_t itr; |
361 | mu_list_t list; | 361 | mu_list_t list; |
362 | const char *domain = NULL; | ||
363 | 362 | ||
364 | if (incl) | 363 | if (incl) |
365 | *incl = 0; | 364 | *incl = 0; | ... | ... |
... | @@ -564,7 +564,7 @@ mh_spawnp (const char *prog, const char *file) | ... | @@ -564,7 +564,7 @@ mh_spawnp (const char *prog, const char *file) |
564 | xargv[i++] = (char*) file; | 564 | xargv[i++] = (char*) file; |
565 | xargv[i++] = NULL; | 565 | xargv[i++] = NULL; |
566 | 566 | ||
567 | rc = mu_spawnvp (xargv[0], (const char**) xargv, &status); | 567 | rc = mu_spawnvp (xargv[0], xargv, &status); |
568 | 568 | ||
569 | free (xargv); | 569 | free (xargv); |
570 | mu_argcv_free (argc, argv); | 570 | mu_argcv_free (argc, argv); | ... | ... |
... | @@ -265,7 +265,7 @@ invoke (char *compname, char *defval, int argc, char **argv, | ... | @@ -265,7 +265,7 @@ invoke (char *compname, char *defval, int argc, char **argv, |
265 | if (extra1) | 265 | if (extra1) |
266 | xargv[i++] = extra1; | 266 | xargv[i++] = extra1; |
267 | xargv[i++] = NULL; | 267 | xargv[i++] = NULL; |
268 | rc = mu_spawnvp (xargv[0], (const char **) xargv, &status); | 268 | rc = mu_spawnvp (xargv[0], xargv, &status); |
269 | free (xargv); | 269 | free (xargv); |
270 | return rc ? rc : check_exit_status (progname, status); | 270 | return rc ? rc : check_exit_status (progname, status); |
271 | } | 271 | } | ... | ... |
... | @@ -105,7 +105,7 @@ mh_alias_expand (char *str, mu_address_t *paddr, int *incl) | ... | @@ -105,7 +105,7 @@ mh_alias_expand (char *str, mu_address_t *paddr, int *incl) |
105 | { | 105 | { |
106 | int status; | 106 | int status; |
107 | mu_argcv_string (argc, argv, &buf); | 107 | mu_argcv_string (argc, argv, &buf); |
108 | if (status = mu_address_create (paddr, buf)) | 108 | if ((status = mu_address_create (paddr, buf))) |
109 | mu_error (_("Bad address `%s': %s"), buf, mu_strerror (status)); | 109 | mu_error (_("Bad address `%s': %s"), buf, mu_strerror (status)); |
110 | free (buf); | 110 | free (buf); |
111 | } | 111 | } | ... | ... |
... | @@ -1623,7 +1623,8 @@ store_handler (mu_message_t msg, msg_part_t part, char *type, char *encoding, | ... | @@ -1623,7 +1623,8 @@ store_handler (mu_message_t msg, msg_part_t part, char *type, char *encoding, |
1623 | } | 1623 | } |
1624 | 1624 | ||
1625 | if (!name | 1625 | if (!name |
1626 | && mu_header_aget_value (hdr, MU_HEADER_CONTENT_TYPE, &val) == 0) { | 1626 | && mu_header_aget_value (hdr, MU_HEADER_CONTENT_TYPE, &val) == 0) |
1627 | { | ||
1627 | if (mu_argcv_get (val, "=", NULL, &argc, &argv) == 0) | 1628 | if (mu_argcv_get (val, "=", NULL, &argc, &argv) == 0) |
1628 | { | 1629 | { |
1629 | int i; | 1630 | int i; | ... | ... |
1 | /* GNU Mailutils -- a suite of utilities for electronic mail | 1 | /* GNU Mailutils -- a suite of utilities for electronic mail |
2 | Copyright (C) 2004, 2005 Free Software Foundation, Inc. | 2 | Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Lesser General Public | 5 | modify it under the terms of the GNU Lesser General Public |
... | @@ -48,6 +48,8 @@ init_disptab () | ... | @@ -48,6 +48,8 @@ init_disptab () |
48 | return 0; | 48 | return 0; |
49 | } | 49 | } |
50 | 50 | ||
51 | /* FIXME: See comment 'For dynamic loading' below */ | ||
52 | #if 0 | ||
51 | static int | 53 | static int |
52 | add_disptab (mu_sql_dispatch_t *tab) | 54 | add_disptab (mu_sql_dispatch_t *tab) |
53 | { | 55 | { |
... | @@ -64,6 +66,7 @@ add_disptab (mu_sql_dispatch_t *tab) | ... | @@ -64,6 +66,7 @@ add_disptab (mu_sql_dispatch_t *tab) |
64 | sql_disptab[sql_disptab_next] = tab; | 66 | sql_disptab[sql_disptab_next] = tab; |
65 | return sql_disptab_next++; | 67 | return sql_disptab_next++; |
66 | } | 68 | } |
69 | #endif | ||
67 | 70 | ||
68 | int | 71 | int |
69 | mu_sql_interface_index (char *name) | 72 | mu_sql_interface_index (char *name) |
... | @@ -75,9 +78,10 @@ mu_sql_interface_index (char *name) | ... | @@ -75,9 +78,10 @@ mu_sql_interface_index (char *name) |
75 | for (i = 1; i < sql_disptab_next; i++) | 78 | for (i = 1; i < sql_disptab_next; i++) |
76 | if (sql_disptab[i] && (!name || strcmp (sql_disptab[i]->name, name) == 0)) | 79 | if (sql_disptab[i] && (!name || strcmp (sql_disptab[i]->name, name) == 0)) |
77 | return i; | 80 | return i; |
78 | // FIXME | 81 | /* FIXME: For dynamic loading |
79 | // if (name && mu_sql_load_ext (name, "dispatch_tab", &tab)) | 82 | if (name && mu_sql_load_ext (name, "dispatch_tab", &tab)) |
80 | // return add_disptab (tab); | 83 | return add_disptab (tab); |
84 | */ | ||
81 | return 0; | 85 | return 0; |
82 | } | 86 | } |
83 | 87 | ... | ... |
-
Please register or sign in to post a comment