diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-12-16 13:06:22 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-12-16 13:06:22 +0200 |
commit | a600395e1fe66e0a116827f17f9bd864d4554585 (patch) | |
tree | 42c1d775613364dd2eacb96712f20ee3ce8d7401 /mail | |
parent | 96dc9ab99e9518f5f21a7710e396da8c3fd833b5 (diff) | |
download | mailutils-a600395e1fe66e0a116827f17f9bd864d4554585.tar.gz mailutils-a600395e1fe66e0a116827f17f9bd864d4554585.tar.bz2 |
Fix format specifiers and usage of const char* arguments/variables.
Affected files:
* comsat/comsat.c
* examples/header.c
* examples/mailcap.c
* examples/pop3client.c
* examples/url-parse.c
* imap4d/fetch.c
* imap4d/id.c
* imap4d/list.c
* imap4d/select.c
* imap4d/status.c
* imap4d/store.c
* imap4d/sync.c
* imap4d/util.c
* include/mailutils/sieve.h
* libmu_argp/common.c
* libmu_argp/muinit.c
* libmu_sieve/actions.c
* libmu_sieve/extensions/pipe.c
* libmu_sieve/extensions/vacation.c
* libmu_sieve/prog.c
* libmu_sieve/require.c
* libmu_sieve/runtime.c
* libmu_sieve/sieve-priv.h
* libmu_sieve/sieve.y
* libproto/imap/folder.c
* libproto/imap/mbox.c
* libproto/mailer/sendmail.c
* libproto/mbox/mbox.c
* libproto/pop/pop3_list.c
* libproto/pop/pop3_stat.c
* maidag/lmtp.c
* maidag/sieve.c
* mail/copy.c
* mail/decode.c
* mail/envelope.c
* mail/eq.c
* mail/escape.c
* mail/from.c
* mail/mail.h
* mail/mailline.c
* mail/mailvar.c
* mail/size.c
* mail/util.c
* mail/write.c
* mailbox/cfg_format.c
* mailbox/folder.c
* mailbox/parse822.c
* mailbox/system.c
* messages/messages.c
* mh/folder.c
* mh/forw.c
* mh/inc.c
* mh/mh.h
* mh/mh_alias.l
* mh/mh_fmtgram.y
* mh/mh_getopt.h
* mh/mh_init.c
* mh/mh_msgset.c
* mh/mh_whatnow.c
* mh/mhn.c
* mh/pick.y
* mimeview/mimetypes.y
* python/libmu_py/debug.c
* sieve/sieve.c
Diffstat (limited to 'mail')
-rw-r--r-- | mail/copy.c | 3 | ||||
-rw-r--r-- | mail/decode.c | 4 | ||||
-rw-r--r-- | mail/envelope.c | 3 | ||||
-rw-r--r-- | mail/eq.c | 6 | ||||
-rw-r--r-- | mail/escape.c | 3 | ||||
-rw-r--r-- | mail/from.c | 4 | ||||
-rw-r--r-- | mail/mail.h | 4 | ||||
-rw-r--r-- | mail/mailline.c | 4 | ||||
-rw-r--r-- | mail/mailvar.c | 7 | ||||
-rw-r--r-- | mail/size.c | 8 | ||||
-rw-r--r-- | mail/util.c | 14 | ||||
-rw-r--r-- | mail/write.c | 5 |
12 files changed, 36 insertions, 29 deletions
diff --git a/mail/copy.c b/mail/copy.c index effba42c5..604d06393 100644 --- a/mail/copy.c +++ b/mail/copy.c @@ -108,7 +108,8 @@ mail_copy0 (int argc, char **argv, int mark) } if (status == 0) - fprintf (ofile, "\"%s\" %3d/%-5d\n", filename, total_lines, total_size); + fprintf (ofile, "\"%s\" %3lu/%-5lu\n", filename, + (unsigned long) total_lines, (unsigned long) total_size); mu_mailbox_close (mbx); mu_mailbox_destroy (&mbx); diff --git a/mail/decode.c b/mail/decode.c index 5de847c63..63274566a 100644 --- a/mail/decode.c +++ b/mail/decode.c @@ -127,9 +127,9 @@ fprint_msgset (FILE *fp, const msgset_t *msgset) int i; size_t n = 0; - n = fprintf (fp, "%d", msgset->msg_part[0]); + n = fprintf (fp, "%lu", (unsigned long) msgset->msg_part[0]); for (i = 1; i < msgset->npart; i++) - n += fprintf (fp, "[%d", msgset->msg_part[i]); + n += fprintf (fp, "[%lu", (unsigned long) msgset->msg_part[i]); for (i = 1; i < msgset->npart; i++) n += fprintf (fp, "]"); return n; diff --git a/mail/envelope.c b/mail/envelope.c index 24d93916c..8525ccc13 100644 --- a/mail/envelope.c +++ b/mail/envelope.c @@ -30,7 +30,8 @@ print_envelope (msgset_t *mspec, mu_message_t msg, void *data) status = mu_message_get_envelope (msg, &env); if (status) { - mu_error (_("%d: Cannot get envelope"), mspec->msg_part[0]); + mu_error (_("%lu: Cannot get envelope"), + (unsigned long) mspec->msg_part[0]); } else { @@ -1,6 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail Copyright (C) 1999, 2001, 2002, 2003, 2005, - 2007 Free Software Foundation, Inc. + 2007, 2009 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 @@ -36,7 +36,7 @@ mail_eq (int argc, char **argv) if (n == 0) util_error (_("No applicable message")); else - fprintf (ofile, "%u\n", n); + fprintf (ofile, "%lu\n", (unsigned long) n); break; case 2: @@ -45,7 +45,7 @@ mail_eq (int argc, char **argv) if (list->msg_part[0] <= total) { set_cursor (list->msg_part[0]); - fprintf (ofile, "%u\n", list->msg_part[0]); + fprintf (ofile, "%lu\n", (unsigned long) list->msg_part[0]); } else util_error_range (list->msg_part[0]); diff --git a/mail/escape.c b/mail/escape.c index e44283e42..b2e016caa 100644 --- a/mail/escape.c +++ b/mail/escape.c @@ -433,7 +433,8 @@ quote0 (msgset_t *mspec, mu_message_t mesg, void *data) size_t n = 0; char *prefix = "\t"; - fprintf (stdout, _("Interpolating: %d\n"), mspec->msg_part[0]); + fprintf (stdout, _("Interpolating: %lu\n"), + (unsigned long) mspec->msg_part[0]); mailvar_get (&prefix, "indentprefix", mailvar_type_string, 0); diff --git a/mail/from.c b/mail/from.c index 31e2a9202..75212e1b6 100644 --- a/mail/from.c +++ b/mail/from.c @@ -115,11 +115,11 @@ format_headline (struct header_segm *seg, msgset_t *mspec, mu_message_t msg) if (seg->align == ALIGN_RIGHT) { format_pad (width - len); - fprintf (ofile, "%*.*s", len, len, p); + fprintf (ofile, "%*.*s", (int) len, (int) len, p); } else { - fprintf (ofile, "%*.*s", len, len, p); + fprintf (ofile, "%*.*s", (int) len, (int) len, p); format_pad (width - len); } out_cols += width; diff --git a/mail/mail.h b/mail/mail.h index d9950b009..50d3e31e8 100644 --- a/mail/mail.h +++ b/mail/mail.h @@ -410,8 +410,8 @@ extern int ml_got_interrupt (void); extern void ml_clear_interrupt (void); extern void ml_readline_init (void); extern int ml_reread (const char *prompt, char **text); -extern char *ml_readline (char *prompt); -extern char *ml_readline_with_intr (char *prompt); +extern char *ml_readline (const char *prompt); +extern char *ml_readline_with_intr (const char *prompt); extern char *alias_expand (const char *name); extern void alias_destroy (const char *name); diff --git a/mail/mailline.c b/mail/mailline.c index 4ed1c3ab9..dabf66eb8 100644 --- a/mail/mailline.c +++ b/mail/mailline.c @@ -175,7 +175,7 @@ ml_readline_internal () } char * -ml_readline (char *prompt) +ml_readline (const char *prompt) { if (interactive) return readline (prompt); @@ -183,7 +183,7 @@ ml_readline (char *prompt) } char * -ml_readline_with_intr (char *prompt) +ml_readline_with_intr (const char *prompt) { char *str = ml_readline (prompt); if (_interrupted) diff --git a/mail/mailvar.c b/mail/mailvar.c index e5cc5ce93..f948b1acb 100644 --- a/mail/mailvar.c +++ b/mail/mailvar.c @@ -285,14 +285,15 @@ find_mailvar_symbol (const char *var) } static void -print_descr (FILE *out, char *s, int n, int doc_col, int rmargin, char *pfx) +print_descr (FILE *out, const char *s, int n, + int doc_col, int rmargin, char *pfx) { if (!s) return; do { - char *p; - char *space = NULL; + const char *p; + const char *space = NULL; if (n == 1 && pfx) n += fprintf (out, "%s", pfx); diff --git a/mail/size.c b/mail/size.c index 6f5a14cf5..dddf48db9 100644 --- a/mail/size.c +++ b/mail/size.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2005, 2007, 2009 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 @@ -30,9 +30,11 @@ size0 (msgset_t *mspec, mu_message_t msg, void *data) mu_message_size (msg, &size); mu_message_lines (msg, &lines); - fprintf (ofile, "%c%2d %3d/%-5d\n", + fprintf (ofile, "%c%2lu %3lu/%-5lu\n", is_current_message (mspec->msg_part[0]) ? '>' : ' ', - mspec->msg_part[0], lines, size); + (unsigned long) mspec->msg_part[0], + (unsigned long) lines, + (unsigned long) size); return 0; } diff --git a/mail/util.c b/mail/util.c index b6c3ba5cc..0e1e0b0e3 100644 --- a/mail/util.c +++ b/mail/util.c @@ -387,7 +387,7 @@ util_screen_lines () if (mailvar_get (&screen, "screen", mailvar_type_number, 0) == 0) return screen; n = util_getlines(); - util_do_command ("set screen=%d", n); + util_do_command ("set screen=%lu", (unsigned long) n); return n; } @@ -400,7 +400,7 @@ util_screen_columns () if (mailvar_get (&cols, "columns", mailvar_type_number, 0) == 0) return cols; n = util_getcols(); - util_do_command ("set columns=%d", n); + util_do_command ("set columns=%lu", (unsigned long) n); return n; } @@ -794,15 +794,15 @@ util_descend_subparts (mu_message_t mesg, msgset_t *msgset, mu_message_t *part) mu_message_get_num_parts (mesg, &nparts); if (nparts < msgset->msg_part[i]) { - util_error (_("No such (sub)part in the message: %d"), - msgset->msg_part[i]); + util_error (_("No such (sub)part in the message: %lu"), + (unsigned long) msgset->msg_part[i]); return 1; } if (mu_message_get_part (mesg, msgset->msg_part[i], &submsg)) { - util_error (_("Cannot get (sub)part from the message: %d"), - msgset->msg_part[i]); + util_error (_("Cannot get (sub)part from the message: %lu"), + (unsigned long) msgset->msg_part[i]); return 1; } @@ -1039,7 +1039,7 @@ util_get_message (mu_mailbox_t mbox, size_t msgno, mu_message_t *msg) int util_error_range (size_t msgno) { - util_error (_("%d: invalid message number"), msgno); + util_error (_("%lu: invalid message number"), (unsigned long) msgno); return 1; } diff --git a/mail/write.c b/mail/write.c index 511b92123..5c396fbba 100644 --- a/mail/write.c +++ b/mail/write.c @@ -50,7 +50,7 @@ mail_write (int argc, char **argv) util_error (_("No applicable message")); return 1; } - asprintf (&p, "%u", n); + asprintf (&p, "%lu", (unsigned long) n); filename = util_outfolder_name (p); free (p); } @@ -115,7 +115,8 @@ mail_write (int argc, char **argv) mu_attribute_set_userflag (attr, MAIL_ATTRIBUTE_SAVED); } - fprintf (ofile, "\"%s\" %3d/%-5d\n", filename, total_lines, total_size); + fprintf (ofile, "\"%s\" %3lu/%-5lu\n", filename, + (unsigned long) total_lines, (unsigned long) total_size); free (filename); fclose (output); |