diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-12-11 15:18:07 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-12-11 15:18:07 +0000 |
commit | 442ca3c91e1f7cb18428a9b6d0fc5615bf62aa54 (patch) | |
tree | f82c89ac8b8c55589af89da7dbd54eb0150df3b6 | |
parent | cdf51934dc29acfb379e02f634c0ad61d04794f8 (diff) | |
download | mailutils-442ca3c91e1f7cb18428a9b6d0fc5615bf62aa54.tar.gz mailutils-442ca3c91e1f7cb18428a9b6d0fc5615bf62aa54.tar.bz2 |
Add typecasts to the arguments of printf-like functions where necessary.
-rw-r--r-- | examples/mimetest.c | 11 | ||||
-rw-r--r-- | examples/mta.c | 4 | ||||
-rw-r--r-- | mail/var.c | 12 | ||||
-rw-r--r-- | mailbox/folder_imap.c | 2 | ||||
-rw-r--r-- | mailbox/mbx_imap.c | 6 | ||||
-rw-r--r-- | mailbox/mbx_mbox.c | 9 | ||||
-rw-r--r-- | mailbox/mbx_mh.c | 9 | ||||
-rw-r--r-- | mh/mh_global.c | 2 |
8 files changed, 34 insertions, 21 deletions
diff --git a/examples/mimetest.c b/examples/mimetest.c index 9ff413973..0c54a0d19 100644 --- a/examples/mimetest.c +++ b/examples/mimetest.c @@ -139,7 +139,7 @@ main (int argc, char **argv) header_get_value (hdr, MU_HEADER_FROM, from, sizeof (from), NULL); header_get_value (hdr, MU_HEADER_SUBJECT, subject, sizeof (subject), NULL); - printf ("Message: %d\n", i); + printf ("Message: %lu\n", (unsigned long) i); printf ("From: %s\n", from); printf ("Subject: %s\n", subject); @@ -148,8 +148,10 @@ main (int argc, char **argv) fprintf (stderr, "message_get_num_parts - %s\n", mu_errstring (ret)); exit (2); } - printf ("Number of parts in message - %d\n", nparts); - printf ("Total message size - %d\n", msize); + printf ("Number of parts in message - %lu\n", + (unsigned long) nparts); + printf ("Total message size - %lu\n", + (unsigned long) msize); message_display_parts (msg, 0); } mailbox_close (mbox); @@ -203,7 +205,8 @@ message_display_parts (message_t msg, int indent) header_get_value (hdr, MU_HEADER_CONTENT_TYPE, type, sizeof (type), NULL); printf ("%*.*sType of part %d = %s\n", indent, indent, "", j, type); - printf ("%*.*sMessage part size - %d\n", indent, indent, "", msize); + printf ("%*.*sMessage part size - %lu\n", indent, indent, "", + (unsigned long) msize); encoding[0] = '\0'; header_get_value (hdr, MU_HEADER_CONTENT_TRANSFER_ENCODING, encoding, sizeof (encoding), NULL); diff --git a/examples/mta.c b/examples/mta.c index 246b74563..5b61890ad 100644 --- a/examples/mta.c +++ b/examples/mta.c @@ -316,7 +316,7 @@ mta_send (message_t msg) message_get_stream (msg, &stream); line = 0; - fprintf (diag, "%4d: ", line); + fprintf (diag, "%4lu: ", (unsigned long) line); while (stream_read (stream, buffer, sizeof buffer - 1, off, &n) == 0 && n != 0) { @@ -328,7 +328,7 @@ mta_send (message_t msg) if (buffer[i] == '\n') { line++; - fprintf (diag, "%4d: ", line); + fprintf (diag, "%4lu: ", (unsigned long) line); } } off += n; diff --git a/mail/var.c b/mail/var.c index 1ced29dd7..4f020ba37 100644 --- a/mail/var.c +++ b/mail/var.c @@ -559,7 +559,8 @@ var_read (int argc, char **argv, compose_env_t *env) fputs (buf, ofile); } fclose (inf); - fprintf (stdout, "\"%s\" %d/%d\n", filename, lines, size); + fprintf (stdout, "\"%s\" %lu/%lu\n", filename, + (unsigned long) lines, (unsigned long) size); free (filename); return 0; } @@ -614,7 +615,8 @@ var_write (int argc, char **argv, compose_env_t *env) fputs (buf, fp); } fclose (fp); - fprintf (stdout, "\"%s\" %d/%d\n", filename, lines, size); + fprintf (stdout, "\"%s\" %lu/%lu\n", filename, + (unsigned long) lines, (unsigned long) size); free (filename); return 0; } @@ -719,7 +721,8 @@ var_pipe (int argc, char **argv, compose_env_t *env) rc = 0; } - fprintf (stdout, "\"|%s\" in: %d/%d ", argv[1], lines, size); + fprintf (stdout, "\"|%s\" in: %lu/%lu ", argv[1], + (unsigned long) lines, (unsigned long) size); if (rc) { fprintf (stdout, "no lines out\n"); @@ -741,7 +744,8 @@ var_pipe (int argc, char **argv, compose_env_t *env) } fclose (env->file); - fprintf (stdout, "out: %d/%d\n", lines, size); + fprintf (stdout, "out: %lu/%lu\n", + (unsigned long) lines, (unsigned long) size); } /* Clean up the things */ diff --git a/mailbox/folder_imap.c b/mailbox/folder_imap.c index ddfdc115f..86e43d84f 100644 --- a/mailbox/folder_imap.c +++ b/mailbox/folder_imap.c @@ -1232,7 +1232,7 @@ section_name (msg_imap_t msg_imap) char *tmp; char part[64]; size_t partlen; - snprintf (part, sizeof part, "%u", msg_imap->part); + snprintf (part, sizeof part, "%lu", (unsigned long) msg_imap->part); partlen = strlen (part); tmp = realloc (section, sectionlen + partlen + 2); if (tmp == NULL) diff --git a/mailbox/mbx_imap.c b/mailbox/mbx_imap.c index 34331ac26..5c25709a8 100644 --- a/mailbox/mbx_imap.c +++ b/mailbox/mbx_imap.c @@ -2178,9 +2178,11 @@ add_number (char **pset, size_t start, size_t end) if (start == 0) *buf = '\0'; else if (start != end) - snprintf (buf, sizeof buf, "%d:%d", start, end); + snprintf (buf, sizeof buf, "%lu:%lu", + (unsigned long) start, + (unsigned long) end); else - snprintf (buf, sizeof buf, "%d", start); + snprintf (buf, sizeof buf, "%lu", (unsigned long) start); if (set_len) tmp = realloc (set, set_len + strlen (buf) + 2 /* null and comma */); diff --git a/mailbox/mbx_mbox.c b/mailbox/mbx_mbox.c index 324ad1a99..de764d541 100644 --- a/mailbox/mbx_mbox.c +++ b/mailbox/mbx_mbox.c @@ -1235,7 +1235,7 @@ mbox_envelope_date (envelope_t envelope, char *buf, size_t len, static int mbox_envelope_sender (envelope_t envelope, char *buf, size_t len, - size_t *pnwrite) + size_t *pnwrite) { message_t msg = envelope_get_owner (envelope); mbox_message_t mum = message_get_owner (msg); @@ -1602,7 +1602,8 @@ mbox_append_message0 (mailbox_t mailbox, message_t msg, off_t *psize, if (first && is_expunging) { n = sprintf (buffer, "X-IMAPbase: %lu %u\n", - mud->uidvalidity, mud->uidnext); + (unsigned long) mud->uidvalidity, + (unsigned) mud->uidnext); stream_write (mailbox->stream, buffer, n, *psize, &n); *psize += n; } @@ -1643,7 +1644,7 @@ mbox_append_message0 (mailbox_t mailbox, message_t msg, off_t *psize, if (status == 0 || uid != 0) { - n = sprintf (suid, "X-UID: %d\n", uid); + n = sprintf (suid, "X-UID: %u\n", (unsigned) uid); /* Put the UID. */ status = stream_write (mailbox->stream, suid, n, *psize, &n); if (status != 0) @@ -1730,7 +1731,7 @@ mbox_append_message0 (mailbox_t mailbox, message_t msg, off_t *psize, } while (nread > 0); n = 0; - stream_write (mailbox->stream, &nl, 1, *psize, &n); + stream_write (mailbox->stream, &nl, 1, *psize, &n); *psize += n; } diff --git a/mailbox/mbx_mh.c b/mailbox/mbx_mh.c index 29a657814..e4dd7ccc3 100644 --- a/mailbox/mbx_mh.c +++ b/mailbox/mbx_mh.c @@ -195,9 +195,11 @@ _mh_message_name (struct _mh_message *mhm, int deleted) size_t len = strlen (mhm->mhd->name) + 32; filename = malloc (len); if (deleted) - snprintf (filename, len, "%s/,%d", mhm->mhd->name, mhm->seq_number); + snprintf (filename, len, "%s/,%lu", mhm->mhd->name, + (unsigned long) mhm->seq_number); else - snprintf (filename, len, "%s/%d", mhm->mhd->name, mhm->seq_number); + snprintf (filename, len, "%s/%lu", mhm->mhd->name, + (unsigned long) mhm->seq_number); return filename; } @@ -557,7 +559,8 @@ _mh_message_save (struct _mh_data *mhd, struct _mh_message *mhm, int expunge) /* Add imapbase */ if (!mhd->msg_head || (mhd->msg_head == mhm)) /*FIXME*/ - fprintf (fp, "X-IMAPbase: %lu %u\n", mhd->uidvalidity, _mh_next_seq(mhd)); + fprintf (fp, "X-IMAPbase: %lu %u\n", + (unsigned long) mhd->uidvalidity, (unsigned) _mh_next_seq(mhd)); message_get_envelope (msg, &env); if (envelope_date (env, buffer, sizeof buffer, &n) == 0 && n > 0) diff --git a/mh/mh_global.c b/mh/mh_global.c index f9f79c653..6b8227725 100644 --- a/mh/mh_global.c +++ b/mh/mh_global.c @@ -146,7 +146,7 @@ void mh_global_save_state () { char buf[64]; - snprintf (buf, sizeof buf, "%d", current_message); + snprintf (buf, sizeof buf, "%lu", (unsigned long) current_message); mh_context_set_value (sequences, "cur", buf); mh_context_write (sequences); |