From: Julien Danjou Date: Sat, 4 Nov 2006 14:37:46 +0000 (+0100) Subject: [PATCH] Fix multiple compilation warnings X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=efe9a0bac26a7dabf3953ea0597ce06b3dcb21fe [PATCH] Fix multiple compilation warnings Signed-off-by: Julien Danjou Signed-off-by: Pierre Habouzit --- diff --git a/curs_lib.c b/curs_lib.c index 3e9f31a..443f510 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -584,7 +584,7 @@ int mutt_addwch (wchar_t wc) */ void mutt_format_string (char *dest, size_t destlen, - int min_width, int max_width, + unsigned int min_width, int max_width, int right_justify, char m_pad_char, const char *s, size_t n, int arboreal) { @@ -621,7 +621,7 @@ void mutt_format_string (char *dest, size_t destlen, destlen -= k2; } } - w = (int) destlen < min_width ? destlen : min_width; + w = destlen < min_width ? destlen : min_width; if (w <= 0) *p = '\0'; else if (right_justify) { diff --git a/curs_main.c b/curs_main.c index 36ed33a..6d8421e 100644 --- a/curs_main.c +++ b/curs_main.c @@ -261,7 +261,7 @@ static int mx_toggle_write (CONTEXT * ctx) return 0; } -static void update_index (MUTTMENU * menu, CONTEXT * ctx, int check, +static void update_index (MUTTMENU * menu, CONTEXT * ctx __attribute__ ((unused)), int check, int oldcount, int index_hint) { /* store pointers to the newly added messages */ @@ -309,13 +309,13 @@ static void update_index (MUTTMENU * menu, CONTEXT * ctx, int check, /* uncollapse threads with new mail */ if ((Sort & SORT_MASK) == SORT_THREADS) { if (check == M_REOPENED) { - THREAD *h, *j; + THREAD *h, *c; Context->collapsed = 0; for (h = Context->tree; h; h = h->next) { - for (j = h; !j->message; j = j->child); - mutt_uncollapse_thread (Context, j->message); + for (c = h; !c->message; c = c->child); + mutt_uncollapse_thread (Context, c->message); } mutt_set_virtual (Context); } @@ -419,14 +419,14 @@ int mutt_index_menu (void) char *cp; /* temporary variable. */ int index_hint; /* used to restore cursor position */ int do_buffy_notify = 1; - int close = 0; /* did we OP_QUIT or OP_EXIT out of this menu? */ + int closed = 0; /* did we OP_QUIT or OP_EXIT out of this menu? */ int attach_msg = option (OPTATTACHMSG); menu = mutt_new_menu (); menu->menu = MENU_MAIN; menu->offset = 1; menu->pagelen = LINES - 3; - menu->make_entry = index_make_entry; + menu->make_entry = (void *) index_make_entry; menu->color = index_color; menu->current = ci_first_message (); menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_MAIN, @@ -934,11 +934,11 @@ int mutt_index_menu (void) mutt_message (_("No limit pattern is in effect.")); else { - char buf[STRING]; + char buffer[STRING]; /* i18n: ask for a limit to apply */ - snprintf (buf, sizeof (buf), _("Limit: %s"), Context->pattern); - mutt_message ("%s", buf); + snprintf (buffer, sizeof (buffer), _("Limit: %s"), Context->pattern); + mutt_message ("%s", buffer); } break; @@ -950,11 +950,11 @@ int mutt_index_menu (void) && menu->current < Context->vcount) ? CURHDR->index : -1; if (op == OP_TOGGLE_READ) { - char buf[LONG_STRING]; + char buffer[LONG_STRING]; if (!Context->pattern || strncmp (Context->pattern, "!~R!~D~s", 8) != 0) { - snprintf (buf, sizeof (buf), "!~R!~D~s%s", + snprintf (buffer, sizeof (buffer), "!~R!~D~s%s", Context->pattern ? Context->pattern : ".*"); set_option (OPTHIDEREAD); } @@ -994,7 +994,7 @@ int mutt_index_menu (void) case OP_QUIT: - close = op; + closed = op; if (attach_msg) { done = 1; break; @@ -1122,7 +1122,7 @@ int mutt_index_menu (void) CHECK_READONLY; { int oldvcount = Context->vcount; - int oldcount = Context->msgcount; + oldcount = Context->msgcount; int dcount = 0; int check; @@ -1326,7 +1326,7 @@ int mutt_index_menu (void) case OP_EXIT: - close = op; + closed = op; if (menu->menu == MENU_MAIN && attach_msg) { done = 1; break; @@ -2386,7 +2386,7 @@ int mutt_index_menu (void) } mutt_menuDestroy (&menu); - return (close); + return (closed); } void mutt_set_header_color (CONTEXT * ctx, HEADER * curhdr) diff --git a/dotlock.c b/dotlock.c index 19e2ad6..f89fb1f 100644 --- a/dotlock.c +++ b/dotlock.c @@ -72,7 +72,7 @@ static gid_t MailGid; #endif static int dotlock_deference_symlink (char *, size_t, const char *); -static int dotlock_prepare (char *, size_t, const char *, int fd); +static int dotlock_prepare (char *, ssize_t, const char *, int fd); static int dotlock_check_stats (struct stat *, struct stat *); static int dotlock_dispatch (const char *, int fd); @@ -191,7 +191,7 @@ static int dotlock_init_privs (void) static int dotlock_dispatch (const char *f, int fd) { - char realpath[_POSIX_PATH_MAX]; + char frealpath[_POSIX_PATH_MAX]; /* If dotlock_prepare () succeeds [return value == 0], * realpath contains the basename of f, and we have @@ -204,7 +204,7 @@ static int dotlock_dispatch (const char *f, int fd) * lengthy comment below. */ - if (dotlock_prepare (realpath, sizeof (realpath), f, fd) != 0) + if (dotlock_prepare (frealpath, sizeof (frealpath), f, fd) != 0) return DL_EX_ERROR; /* Actually perform the locking operation. */ @@ -212,11 +212,11 @@ static int dotlock_dispatch (const char *f, int fd) if (DotlockFlags & DL_FL_TRY) return dotlock_try (); else if (DotlockFlags & DL_FL_UNLOCK) - return dotlock_unlock (realpath); + return dotlock_unlock (frealpath); else if (DotlockFlags & DL_FL_UNLINK) - return dotlock_unlink (realpath); + return dotlock_unlink (frealpath); else /* lock */ - return dotlock_lock (realpath); + return dotlock_lock (frealpath); } @@ -360,39 +360,39 @@ static int dotlock_check_stats (struct stat *fsb, struct stat *lsb) return 0; } -static int dotlock_prepare (char *bn, size_t l, const char *f, int _fd) +static int dotlock_prepare (char *bn, ssize_t l, const char *f, int _fd) { struct stat fsb, lsb; - char realpath[_POSIX_PATH_MAX]; - char *basename, *dirname; + char frealpath[_POSIX_PATH_MAX]; + char *fbasename, *dirname; char *p; int fd; int r; - if (dotlock_deference_symlink (realpath, sizeof (realpath), f) == -1) + if (dotlock_deference_symlink (frealpath, sizeof (frealpath), f) == -1) return -1; - if ((p = strrchr (realpath, '/'))) { + if ((p = strrchr (frealpath, '/'))) { *p = '\0'; - basename = p + 1; - dirname = realpath; + fbasename = p + 1; + dirname = frealpath; } else { - basename = realpath; - dirname = "."; + fbasename = frealpath; + dirname = m_strdup("."); } - if (m_strlen(basename) + 1 > l) + if (m_strlen(fbasename) + 1 > l) return -1; - m_strcpy(bn, l, basename); + m_strcpy(bn, l, fbasename); if (chdir (dirname) == -1) return -1; if (_fd != -1) fd = _fd; - else if ((fd = open (basename, O_RDONLY)) == -1) + else if ((fd = open (fbasename, O_RDONLY)) == -1) return -1; r = fstat (fd, &fsb); @@ -403,7 +403,7 @@ static int dotlock_prepare (char *bn, size_t l, const char *f, int _fd) if (r == -1) return -1; - if (lstat (basename, &lsb) == -1) + if (lstat (fbasename, &lsb) == -1) return -1; if (dotlock_check_stats (&fsb, &lsb) == -1) @@ -421,26 +421,26 @@ static int dotlock_prepare (char *bn, size_t l, const char *f, int _fd) */ static void -dotlock_expand_link (char *newpath, const char *path, const char *link) +dotlock_expand_link (char *newpath, const char *path, const char *flink) { const char *lb = NULL; size_t len; /* link is full path */ - if (*link == '/') { - m_strcpy(newpath, _POSIX_PATH_MAX, link); + if (*flink == '/') { + m_strcpy(newpath, _POSIX_PATH_MAX, flink); return; } if ((lb = strrchr (path, '/')) == NULL) { /* no path in link */ - m_strcpy(newpath, _POSIX_PATH_MAX, link); + m_strcpy(newpath, _POSIX_PATH_MAX, flink); return; } len = lb - path + 1; memcpy (newpath, path, len); - m_strcpy(newpath + len, _POSIX_PATH_MAX - len, link); + m_strcpy(newpath + len, _POSIX_PATH_MAX - len, flink); } @@ -454,7 +454,7 @@ dotlock_expand_link (char *newpath, const char *path, const char *link) static int dotlock_deference_symlink (char *d, size_t l, const char *path) { struct stat sb; - char realpath[_POSIX_PATH_MAX]; + char frealpath[_POSIX_PATH_MAX]; const char *pathptr = path; int count = 0; @@ -476,8 +476,8 @@ static int dotlock_deference_symlink (char *d, size_t l, const char *path) linkfile[len] = '\0'; dotlock_expand_link (linkpath, pathptr, linkfile); - m_strcpy(realpath, sizeof(realpath), linkpath); - pathptr = realpath; + m_strcpy(frealpath, sizeof(frealpath), linkpath); + pathptr = frealpath; } else break; @@ -498,7 +498,7 @@ static int dotlock_deference_symlink (char *d, size_t l, const char *path) #define HARDMAXATTEMPTS 10 -static int dotlock_lock (const char *realpath) +static int dotlock_lock (const char *frealpath) { char lockfile[_POSIX_PATH_MAX + LONG_STRING]; char nfslockfile[_POSIX_PATH_MAX + LONG_STRING]; @@ -510,8 +510,8 @@ static int dotlock_lock (const char *realpath) time_t t; snprintf (nfslockfile, sizeof (nfslockfile), "%s.%s.%d", - realpath, Hostname, (int) getpid ()); - snprintf (lockfile, sizeof (lockfile), "%s.lock", realpath); + frealpath, Hostname, (int) getpid ()); + snprintf (lockfile, sizeof (lockfile), "%s.lock", frealpath); BEGIN_PRIVILEGED (); @@ -597,12 +597,12 @@ static int dotlock_lock (const char *realpath) * */ -static int dotlock_unlock (const char *realpath) +static int dotlock_unlock (const char *frealpath) { char lockfile[_POSIX_PATH_MAX + LONG_STRING]; int i; - snprintf (lockfile, sizeof (lockfile), "%s.lock", realpath); + snprintf (lockfile, sizeof (lockfile), "%s.lock", frealpath); BEGIN_PRIVILEGED (); i = unlink (lockfile); @@ -616,18 +616,18 @@ static int dotlock_unlock (const char *realpath) /* remove an empty file */ -static int dotlock_unlink (const char *realpath) +static int dotlock_unlink (const char *frealpath) { struct stat lsb; int i = -1; - if (dotlock_lock (realpath) != DL_EX_OK) + if (dotlock_lock (frealpath) != DL_EX_OK) return DL_EX_ERROR; - if ((i = lstat (realpath, &lsb)) == 0 && lsb.st_size == 0) - unlink (realpath); + if ((i = lstat (frealpath, &lsb)) == 0 && lsb.st_size == 0) + unlink (frealpath); - dotlock_unlock (realpath); + dotlock_unlock (frealpath); return (i == 0) ? DL_EX_OK : DL_EX_ERROR; } diff --git a/edit.c b/edit.c index ff19e35..93fcfa1 100644 --- a/edit.c +++ b/edit.c @@ -297,7 +297,7 @@ int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur) char **buf = NULL; int bufmax = 0, buflen = 0; char tmp[LONG_STRING]; - int abort = 0; + int aborted = 0; int done = 0; int i; char *p; @@ -428,7 +428,7 @@ int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur) be_barf_file (*p ? p : path, buf, buflen); break; case 'x': - abort = 1; + aborted = 1; done = 1; break; default: @@ -448,9 +448,9 @@ int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur) tmp[0] = 0; } - if (!abort) + if (!aborted) be_barf_file (path, buf, buflen); be_free_memory (buf, buflen); - return (abort ? -1 : 0); + return (aborted ? -1 : 0); } diff --git a/enter.c b/enter.c index cc3b379..b310ea1 100644 --- a/enter.c +++ b/enter.c @@ -80,7 +80,7 @@ static size_t width_ceiling (const wchar_t * s, size_t n, int w1) return s - s0; } -static void my_wcstombs (char *dest, size_t dlen, const wchar_t * src, +static void my_wcstombs (char *dest, ssize_t dlen, const wchar_t * src, size_t slen) { mbstate_t st; diff --git a/gnupgparse.c b/gnupgparse.c index cdce751..03bab1a 100644 --- a/gnupgparse.c +++ b/gnupgparse.c @@ -86,7 +86,7 @@ static void fix_uid (char *uid) char *buf; const char *ib; char *ob; - size_t ibl, obl; + ssize_t ibl, obl; buf = p_new(char, n + 1); ib = uid, ibl = d - uid + 1, ob = buf, obl = n; @@ -211,22 +211,22 @@ static pgp_key_t parse_pub_line (char *buf, int *is_subkey, pgp_key_t k) case 6: /* timestamp (1998-02-28) */ { char tstr[11]; - struct tm time; + struct tm st_time; debug_print (2, ("time stamp: %s\n", p)); if (!p) break; - time.tm_sec = 0; - time.tm_min = 0; - time.tm_hour = 12; + st_time.tm_sec = 0; + st_time.tm_min = 0; + st_time.tm_hour = 12; m_strcpy(tstr, sizeof(tstr), p); tstr[4] = '\0'; - time.tm_year = atoi (tstr) - 1900; + st_time.tm_year = atoi (tstr) - 1900; tstr[7] = '\0'; - time.tm_mon = (atoi (tstr + 5)) - 1; - time.tm_mday = atoi (tstr + 8); - k->gen_time = mutt_mktime (&time, 0); + st_time.tm_mon = (atoi (tstr + 5)) - 1; + st_time.tm_mday = atoi (tstr + 8); + k->gen_time = mutt_mktime (&st_time, 0); break; } case 7: /* valid for n days */ diff --git a/headers.c b/headers.c index a9be3cd..d1f2e35 100644 --- a/headers.c +++ b/headers.c @@ -137,7 +137,7 @@ void mutt_edit_headers (const char *editor, keep = 0; } else if (ascii_strncasecmp ("attach:", cur->data, 7) == 0) { - BODY *body; + BODY *bbody; BODY *parts; char *q; @@ -150,10 +150,10 @@ void mutt_edit_headers (const char *editor, else m_strcpy(path, sizeof(path), p); mutt_expand_path (path, sizeof (path)); - if ((body = mutt_make_file_attach (path))) { - body->description = m_strdup(q); + if ((bbody = mutt_make_file_attach (path))) { + bbody->description = m_strdup(q); for (parts = msg->content; parts->next; parts = parts->next); - parts->next = body; + parts->next = bbody; } else { mutt_pretty_mailbox (path); diff --git a/hook.c b/hook.c index 7347070..fb74206 100644 --- a/hook.c +++ b/hook.c @@ -36,7 +36,7 @@ #define ERROR_STOP 0 typedef struct hook { - int type; /* hook type */ + unsigned long type; /* hook type */ rx_t rx; /* regular expression */ char *command; /* filename, command or pattern to execute */ pattern_t *pattern; /* used for fcc,save,send-hook */ @@ -45,9 +45,9 @@ typedef struct hook { static HOOK *Hooks = NULL; -static int current_hook_type = 0; +static unsigned long current_hook_type = 0; -int mutt_parse_hook (BUFFER * buf, BUFFER * s, unsigned long data, +int mutt_parse_hook (BUFFER * buf __attribute__ ((unused)), BUFFER * s, unsigned long data, BUFFER * err) { HOOK *ptr; @@ -216,7 +216,7 @@ static void delete_hook (HOOK * h) } /* Deletes all hooks of type ``type'', or all defined hooks if ``type'' is 0 */ -static void delete_hooks (int type) +static void delete_hooks (unsigned long type) { HOOK *h; HOOK *prev; @@ -239,7 +239,7 @@ static void delete_hooks (int type) } } -int mutt_parse_unhook (BUFFER * buf, BUFFER * s, unsigned long data, +int mutt_parse_unhook (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ ((unused)), BUFFER * err) { while (MoreArgs (s)) { @@ -253,7 +253,7 @@ int mutt_parse_unhook (BUFFER * buf, BUFFER * s, unsigned long data, delete_hooks (0); } else { - int type = mutt_get_hook_type (buf->data); + unsigned long type = mutt_get_hook_type (buf->data); if (!type) { snprintf (err->data, err->dsize, @@ -306,7 +306,7 @@ void mutt_folder_hook (char *path) current_hook_type = 0; } -char *mutt_find_hook (int type, const char *pat) +char *mutt_find_hook (unsigned long type, const char *pat) { HOOK *tmp = Hooks; @@ -318,7 +318,7 @@ char *mutt_find_hook (int type, const char *pat) return (NULL); } -void mutt_message_hook (CONTEXT * ctx, HEADER * hdr, int type) +void mutt_message_hook (CONTEXT * ctx, HEADER * hdr, unsigned long type) { BUFFER err, token; HOOK *hook; @@ -350,7 +350,7 @@ void mutt_message_hook (CONTEXT * ctx, HEADER * hdr, int type) } static int -mutt_addr_hook (char *path, size_t pathlen, int type, CONTEXT * ctx, +mutt_addr_hook (char *path, size_t pathlen, unsigned long type, CONTEXT * ctx, HEADER * hdr) { HOOK *hook; diff --git a/init.c b/init.c index fdaf0c9..d0c25e1 100644 --- a/init.c +++ b/init.c @@ -186,7 +186,8 @@ static void bool_to_string (char* dst, size_t dstlen, } static int bool_from_string (struct option_t* dst, const char* val, - char* errbuf, size_t errlen) { + char* errbuf __attribute__ ((unused)), + size_t errlen __attribute__ ((unused))) { int flag = -1; if (!dst) @@ -273,7 +274,7 @@ static void sys_to_string (char* dst, size_t dstlen, } else if (ascii_strcmp ("muttng_folder_name", option->option) == 0 && CurrentFolder && *CurrentFolder) { - size_t Maildirlength = m_strlen(Maildir); + ssize_t Maildirlength = m_strlen(Maildir); /* * if name starts with $folder, just strip it to keep hierarchy @@ -290,10 +291,10 @@ static void sys_to_string (char* dst, size_t dstlen, val = t+1; /* default: use as-is */ else - val = CurrentFolder; + val = (char *) CurrentFolder; } else - val = option->init; + val = (char *) option->init; snprintf (dst, dstlen, "%s=\"%s\"", option->option, NONULL (val)); if (clean) @@ -301,7 +302,7 @@ static void sys_to_string (char* dst, size_t dstlen, } static int path_from_string (struct option_t* dst, const char* val, - char* errbuf, size_t errlen) { + char* errbuf __attribute__ ((unused)), size_t errlen __attribute__ ((unused))) { char path[_POSIX_PATH_MAX]; if (!dst) @@ -332,7 +333,7 @@ static int str_from_string (struct option_t* dst, const char* val, } static int user_from_string (struct option_t* dst, const char* val, - char* errbuf, size_t errlen) { + char* errbuf __attribute__ ((unused)), size_t errlen __attribute__ ((unused))) { /* if dst == NULL, we may get here in case the user did unset it, * see parse_set() where item is free()'d before coming here; so * just silently ignore it */ @@ -357,7 +358,7 @@ static void quad_to_string (char* dst, size_t dstlen, } static int quad_from_string (struct option_t* dst, const char* val, - char* errbuf, size_t errlen) { + char* errbuf __attribute__ ((unused)), size_t errlen __attribute__ ((unused))) { int flag = -1; if (!dst) @@ -491,7 +492,7 @@ static void magic_to_string (char* dst, size_t dstlen, } static int magic_from_string (struct option_t* dst, const char* val, - char* errbuf, size_t errlen) { + char* errbuf __attribute__ ((unused)), size_t errlen __attribute__ ((unused))) { int flag = -1; if (!dst || !val || !*val) @@ -522,7 +523,7 @@ static void addr_to_string (char* dst, size_t dstlen, } static int addr_from_string (struct option_t* dst, const char* val, - char* errbuf, size_t errlen) { + char* errbuf __attribute__ ((unused)), size_t errlen __attribute__ ((unused))) { if (!dst) return (0); address_delete ((address_t**) dst->data); @@ -824,7 +825,8 @@ static int remove_from_rx_list (list2_t** l, const char *str) static int parse_ifdef (BUFFER * tmp, BUFFER * s, unsigned long data, BUFFER * err) { - int i, j, res = 0; + int i, j; + unsigned long res = 0; BUFFER token; struct option_t* option = NULL; @@ -884,8 +886,9 @@ static int parse_ifdef (BUFFER * tmp, BUFFER * s, unsigned long data, return 0; } -static int parse_unignore (BUFFER * buf, BUFFER * s, unsigned long data, - BUFFER * err) +static int parse_unignore (BUFFER * buf, BUFFER * s, + unsigned long data __attribute__ ((unused)), + BUFFER * err __attribute__ ((unused))) { do { mutt_extract_token (buf, s, 0); @@ -901,8 +904,9 @@ static int parse_unignore (BUFFER * buf, BUFFER * s, unsigned long data, return 0; } -static int parse_ignore (BUFFER * buf, BUFFER * s, unsigned long data, - BUFFER * err) +static int parse_ignore (BUFFER * buf, BUFFER * s, + unsigned long data __attribute__ ((unused)), + BUFFER * err __attribute__ ((unused))) { do { mutt_extract_token (buf, s, 0); @@ -914,8 +918,9 @@ static int parse_ignore (BUFFER * buf, BUFFER * s, unsigned long data, return 0; } -static int parse_list (BUFFER * buf, BUFFER * s, unsigned long data, - BUFFER * err) +static int parse_list (BUFFER * buf, BUFFER * s, + unsigned long data __attribute__ ((unused)), + BUFFER * err __attribute__ ((unused))) { do { mutt_extract_token (buf, s, 0); @@ -936,8 +941,9 @@ static void _alternates_clean (void) } } -static int parse_alternates (BUFFER * buf, BUFFER * s, unsigned long data, - BUFFER * err) +static int parse_alternates (BUFFER * buf, BUFFER * s, + unsigned long data __attribute__ ((unused)), + BUFFER * err __attribute__ ((unused))) { _alternates_clean (); do { @@ -952,8 +958,9 @@ static int parse_alternates (BUFFER * buf, BUFFER * s, unsigned long data, return 0; } -static int parse_unalternates (BUFFER * buf, BUFFER * s, unsigned long data, - BUFFER * err) +static int parse_unalternates (BUFFER * buf, BUFFER * s, + unsigned long data __attribute__ ((unused)), + BUFFER * err __attribute__ ((unused))) { _alternates_clean (); do { @@ -1039,7 +1046,7 @@ static int parse_spam_list (BUFFER * buf, BUFFER * s, unsigned long data, } static int parse_unlist (BUFFER * buf, BUFFER * s, unsigned long data, - BUFFER * err) + BUFFER * err __attribute__ ((unused))) { do { mutt_extract_token (buf, s, 0); @@ -1057,7 +1064,8 @@ static int parse_unlist (BUFFER * buf, BUFFER * s, unsigned long data, return 0; } -static int parse_lists (BUFFER * buf, BUFFER * s, unsigned long data, +static int parse_lists (BUFFER * buf, BUFFER * s, + unsigned long data __attribute__ ((unused)), BUFFER * err) { do { @@ -1082,7 +1090,7 @@ static void _attachments_clean (void) { } static int parse_attach_list (BUFFER *buf, BUFFER *s, LIST **ldata, - BUFFER *err) { + BUFFER *err __attribute__ ((unused))) { ATTACH_MATCH *a; LIST *listp, *lastp; char *p; @@ -1154,7 +1162,8 @@ static int parse_attach_list (BUFFER *buf, BUFFER *s, LIST **ldata, return 0; } -static int parse_unattach_list (BUFFER *buf, BUFFER *s, LIST **ldata, BUFFER *err) { +static int parse_unattach_list (BUFFER *buf, BUFFER *s, LIST **ldata, + BUFFER *err __attribute__ ((unused))) { ATTACH_MATCH *a; LIST *lp, *lastp, *newlp; char *tmp; @@ -1175,7 +1184,7 @@ static int parse_unattach_list (BUFFER *buf, BUFFER *s, LIST **ldata, BUFFER *er *minor = '\0'; ++minor; } else { - minor = "unknown"; + minor = m_strdup("unknown"); } major = mutt_check_mime_type(tmp); @@ -1227,7 +1236,9 @@ static int print_attach_list (LIST *lp, char op, const char *name) { return 0; } -static int parse_attachments (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) { +static int parse_attachments (BUFFER *buf, BUFFER *s, + unsigned long data __attribute__ ((unused)), + BUFFER *err) { char op, *category; LIST **listp; @@ -1277,7 +1288,7 @@ static int parse_attachments (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER return parse_attach_list(buf, s, listp, err); } -static int parse_unattachments (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) { +static int parse_unattachments (BUFFER *buf, BUFFER *s, unsigned long data __attribute__ ((unused)), BUFFER *err) { char op, *p; LIST **listp; @@ -1313,8 +1324,9 @@ static int parse_unattachments (BUFFER *buf, BUFFER *s, unsigned long data, BUFF return parse_unattach_list(buf, s, listp, err); } -static int parse_unlists (BUFFER * buf, BUFFER * s, unsigned long data, - BUFFER * err) +static int parse_unlists (BUFFER * buf, BUFFER * s, + unsigned long data __attribute__ ((unused)), + BUFFER * err __attribute__ ((unused))) { do { mutt_extract_token (buf, s, 0); @@ -1330,7 +1342,7 @@ static int parse_unlists (BUFFER * buf, BUFFER * s, unsigned long data, return 0; } -static int parse_subscribe (BUFFER * buf, BUFFER * s, unsigned long data, +static int parse_subscribe (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ ((unused)), BUFFER * err) { do { @@ -1348,8 +1360,9 @@ static int parse_subscribe (BUFFER * buf, BUFFER * s, unsigned long data, return 0; } -static int parse_unsubscribe (BUFFER * buf, BUFFER * s, unsigned long data, - BUFFER * err) +static int parse_unsubscribe (BUFFER * buf, BUFFER * s, + unsigned long data __attribute__ ((unused)), + BUFFER * err __attribute__ ((unused))) { do { mutt_extract_token (buf, s, 0); @@ -1364,8 +1377,9 @@ static int parse_unsubscribe (BUFFER * buf, BUFFER * s, unsigned long data, return 0; } -static int parse_unalias (BUFFER * buf, BUFFER * s, unsigned long data, - BUFFER * err) +static int parse_unalias (BUFFER * buf, BUFFER * s, + unsigned long data __attribute__ ((unused)), + BUFFER * err __attribute__ ((unused))) { ALIAS *tmp, *last = NULL; @@ -1406,7 +1420,8 @@ static int parse_unalias (BUFFER * buf, BUFFER * s, unsigned long data, return 0; } -static int parse_alias (BUFFER * buf, BUFFER * s, unsigned long data, +static int parse_alias (BUFFER * buf, BUFFER * s, + unsigned long data __attribute__ ((unused)), BUFFER * err) { ALIAS *tmp = Aliases; @@ -1475,7 +1490,9 @@ static int parse_alias (BUFFER * buf, BUFFER * s, unsigned long data, } static int -parse_unmy_hdr (BUFFER * buf, BUFFER * s, unsigned long data, BUFFER * err) +parse_unmy_hdr (BUFFER * buf, BUFFER * s, + unsigned long data __attribute__ ((unused)), + BUFFER * err __attribute__ ((unused))) { LIST *last = NULL; LIST *tmp = UserHeader; @@ -1517,7 +1534,7 @@ parse_unmy_hdr (BUFFER * buf, BUFFER * s, unsigned long data, BUFFER * err) return 0; } -static int parse_my_hdr (BUFFER * buf, BUFFER * s, unsigned long data, +static int parse_my_hdr (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ ((unused)), BUFFER * err) { LIST *tmp; @@ -1582,7 +1599,7 @@ parse_sort (struct option_t* dst, const char *s, const struct mapping_t *map, } /* if additional data more == 1, we want to resolve synonyms */ -static void mutt_set_default(const char *name, void* p, unsigned long more) +static void mutt_set_default(const char *name __attribute__ ((unused)), void* p, unsigned long more) { char buf[LONG_STRING]; struct option_t *ptr = p; @@ -1663,8 +1680,8 @@ static int init_expand (char** dst, struct option_t* src) { } /* if additional data more == 1, we want to resolve synonyms */ -static void mutt_restore_default (const char* name, void* p, - unsigned long more) { +static void mutt_restore_default (const char* name __attribute__ ((unused)), + void* p, unsigned long more) { char errbuf[STRING]; struct option_t* ptr = (struct option_t*) p; char* init = NULL; @@ -1705,7 +1722,7 @@ static void mutt_restore_default (const char* name, void* p, } /* check whether value for $dsn_return would be valid */ -static int check_dsn_return (const char* option, unsigned long p, +static int check_dsn_return (const char* option __attribute__ ((unused)), unsigned long p, char* errbuf, size_t errlen) { char* val = (char*) p; if (val && *val && m_strncmp(val, "hdrs", 4) != 0 && @@ -1721,7 +1738,8 @@ static int check_dsn_return (const char* option, unsigned long p, static int check_dsn_notify (const char* option, unsigned long p, char* errbuf, size_t errlen) { list2_t* list = NULL; - int i = 0, rc = 1; + size_t i = 0; + int rc = 1; char* val = (char*) p; if (!val || !*val) @@ -1768,7 +1786,7 @@ static int check_debug (const char* option, unsigned long p, } #endif -static int check_history (const char* option, unsigned long p, +static int check_history (const char* option __attribute__ ((unused)), unsigned long p, char* errbuf, size_t errlen) { if (!check_num ("history", p, errbuf, errlen)) return (0); @@ -2131,7 +2149,8 @@ static int source_rc (const char *rcfile, BUFFER * err) #undef MAXERRS -static int parse_source (BUFFER * tmp, BUFFER * s, unsigned long data, +static int parse_source (BUFFER * tmp, BUFFER * s, + unsigned long data __attribute__ ((unused)), BUFFER * err) { char path[_POSIX_PATH_MAX]; @@ -2481,7 +2500,7 @@ int mutt_var_value_complete (char *buffer, size_t len, int pos) else return 0; - for (s = tmp, d = tmp2; *s && (d - tmp2) < sizeof(tmp2) - 2;) { + for (s = tmp, d = tmp2; *s && (d - tmp2) < ssizeof(tmp2) - 2;) { if (*s == '\\' || *s == '"') *d++ = '\\'; *d++ = *s++; @@ -2553,7 +2572,8 @@ void mutt_init (int skip_sys_rc, LIST * commands) struct utsname utsname; const char *p; char buffer[STRING], error[STRING]; - int i, default_rc = 0, need_pause = 0; + int default_rc = 0, need_pause = 0; + unsigned int i; BUFFER err; p_clear(&err, 1); @@ -2822,7 +2842,7 @@ void mutt_init (int skip_sys_rc, LIST * commands) /* warn about synonym variables */ if (!list_empty(Synonyms)) { - int i = 0; + i = 0; fprintf (stderr, _("Warning: the following synonym variables were found:\n")); for (i = 0; i < Synonyms->length; i++) { struct option_t* newopt = NULL, *oldopt = NULL; @@ -2867,7 +2887,8 @@ static int opt_cmp (const void* a, const void* b) { } /* callback for hash_map() to put all non-synonym vars into list */ -static void opt_sel_full (const char* key, void* data, +static void opt_sel_full (const char* key __attribute__ ((unused)), + void* data, unsigned long more) { list2_t** l = (list2_t**) more; struct option_t* option = (struct option_t*) data; @@ -2878,7 +2899,8 @@ static void opt_sel_full (const char* key, void* data, } /* callback for hash_map() to put all changed non-synonym vars into list */ -static void opt_sel_diff (const char* key, void* data, +static void opt_sel_diff (const char* key __attribute__ ((unused)), + void* data, unsigned long more) { list2_t** l = (list2_t**) more; struct option_t* option = (struct option_t*) data; @@ -2894,7 +2916,7 @@ static void opt_sel_diff (const char* key, void* data, /* dump out the value of all the variables we have */ int mutt_dump_variables (int full) { - int i = 0; + size_t i = 0; char outbuf[STRING]; list2_t* tmp = NULL; struct option_t* option = NULL; diff --git a/protos.h b/protos.h index 7381c01..4b18418 100644 --- a/protos.h +++ b/protos.h @@ -95,7 +95,7 @@ char *mutt_charset_hook (const char *); char *mutt_iconv_hook (const char *); char *mutt_expand_path (char *, size_t); char *_mutt_expand_path (char *, size_t, int); -char *mutt_find_hook (int, const char *); +char *mutt_find_hook (unsigned long, const char *); char *mutt_gecos_name (char *, size_t, struct passwd *); char *mutt_gen_msgid (void); char *mutt_get_body_charset (char *, size_t, BODY *); @@ -134,7 +134,7 @@ void mutt_expand_fmt (char *, size_t, const char *, const char *); void mutt_expand_link (char *, const char *, const char *); void mutt_fix_reply_recipients (ENVELOPE * env); void mutt_folder_hook (char *); -void mutt_format_string (char *, size_t, int, int, int, char, const char *, +void mutt_format_string (char *, size_t, unsigned int, int, int, char, const char *, size_t, int); void mutt_format_s (char *, size_t, const char *, const char *); void mutt_format_s_tree (char *, size_t, const char *, const char *); @@ -181,7 +181,7 @@ void mutt_select_fcc (char *, size_t, HEADER *); #define mutt_select_file(A,B,C) _mutt_select_file(A,B,C,NULL,NULL) void _mutt_select_file (char *, size_t, int, char ***, int *); -void mutt_message_hook (CONTEXT *, HEADER *, int); +void mutt_message_hook (CONTEXT *, HEADER *, unsigned long); void _mutt_set_flag (CONTEXT *, HEADER *, int, int, int); #define mutt_set_flag(a,b,c,d) _mutt_set_flag(a,b,c,d,1)