From: Pierre Habouzit Date: Sat, 28 Oct 2006 19:22:45 +0000 (+0200) Subject: missing includes, intializers, consts X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=c25bc063f35aaad6938c2022dae7a283346c2769 missing includes, intializers, consts --- diff --git a/curs_lib.c b/curs_lib.c index e5f9480..0cb31c6 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -27,6 +27,7 @@ #include "lib/str.h" #include "lib/debug.h" +#include #include #include #include diff --git a/curs_main.c b/curs_main.c index 0278069..ff7b8e3 100644 --- a/curs_main.c +++ b/curs_main.c @@ -386,7 +386,7 @@ struct mapping_t IndexHelp[] = { {N_("Reply"), OP_REPLY}, {N_("Group"), OP_GROUP_REPLY}, {N_("Help"), OP_HELP}, - {NULL} + {NULL, OP_NULL} }; #ifdef USE_NNTP @@ -399,7 +399,7 @@ struct mapping_t IndexNewsHelp[] = { {N_("Followup"), OP_FOLLOWUP}, {N_("Catchup"), OP_CATCHUP}, {N_("Help"), OP_HELP}, - {NULL} + {NULL, OP_NULL} }; #endif diff --git a/edit.c b/edit.c index ff581b0..893b495 100644 --- a/edit.c +++ b/edit.c @@ -403,7 +403,7 @@ int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur) case 'e': case 'v': if (be_barf_file (path, buf, buflen) == 0) { - char *tag, *err; + const char *tag, *err; be_free_memory (buf, buflen); buf = NULL; diff --git a/enter.c b/enter.c index 7cd96dc..b979a2e 100644 --- a/enter.c +++ b/enter.c @@ -145,7 +145,7 @@ size_t my_mbstowcs (wchar_t ** pwbuf, size_t * pwbuflen, size_t i, char *buf) * Replace part of the wchar_t buffer, from FROM to CURPOS, by BUF. */ -static void replace_part (ENTER_STATE * state, size_t from, char *buf) +static void replace_part (ENTER_STATE *state, size_t from, const char *buf) { /* Save the suffix */ size_t savelen = state->lastchar - state->curpos; @@ -275,13 +275,13 @@ int _mutt_enter_string (char *buf, size_t buflen, int y, int x, switch (ch) { case OP_EDITOR_HISTORY_UP: state->curpos = state->lastchar; - replace_part (state, 0, mutt_history_prev (hclass)); + replace_part(state, 0, mutt_history_prev(hclass)); redraw = M_REDRAW_INIT; break; case OP_EDITOR_HISTORY_DOWN: state->curpos = state->lastchar; - replace_part (state, 0, mutt_history_next (hclass)); + replace_part(state, 0, mutt_history_next(hclass)); redraw = M_REDRAW_INIT; break; diff --git a/help.c b/help.c index 0545777..c0bf22c 100644 --- a/help.c +++ b/help.c @@ -22,6 +22,7 @@ #include "pager.h" #include "mapping.h" +#include #include #include diff --git a/init.c b/init.c index 169b8b6..10c23d7 100644 --- a/init.c +++ b/init.c @@ -1089,8 +1089,8 @@ static int parse_attach_list (BUFFER *buf, BUFFER *s, LIST **ldata, /* Find the last item in the list that data points to. */ lastp = NULL; - debug_print (5, ("parse_attach_list: ldata = %08x, *ldata = %08x\n", - (unsigned int)ldata, (unsigned int)*ldata)); + debug_print (5, ("parse_attach_list: ldata = %p, *ldata = %p\n", + ldata, *ldata)); for (listp = *ldata; listp; listp = listp->next) { a = (ATTACH_MATCH *)listp->data; debug_print (5, ("parse_attach_list: skipping %s/%s\n", a->major, a->minor)); diff --git a/keymap.c b/keymap.c index 6a7f5c1..2508dff 100644 --- a/keymap.c +++ b/keymap.c @@ -375,7 +375,7 @@ int km_dokey (int menu) /* do we have an op already? */ if (tmp.op) { - char *func = NULL; + const char *func = NULL; struct binding_t *bindings; /* is this a valid op for this menu? */ @@ -454,7 +454,7 @@ static void create_bindings (struct binding_t *map, int menu) km_bindkey (map[i].seq, menu, map[i].op); } -char *km_keyname (int c) +const char *km_keyname(int c) { static char buf[10]; const char *p; diff --git a/keymap.h b/keymap.h index 45829b6..6434c77 100644 --- a/keymap.h +++ b/keymap.h @@ -36,7 +36,7 @@ struct keymap_t { keycode_t *keys; /* key sequence */ }; -char *km_keyname (int); +const char *km_keyname (int); int km_expand_key (char *, size_t, struct keymap_t *); struct keymap_t *km_find_func (int, int); void km_init (void); diff --git a/main.c b/main.c index aaa8877..022d5ec 100644 --- a/main.c +++ b/main.c @@ -42,6 +42,9 @@ #ifdef HAVE_GETOPT_H #include +#else +extern char *optarg; +extern int optind; #endif #ifdef HAVE_LIBIDN @@ -56,7 +59,7 @@ #include #endif -#if USE_HCACHE +#ifdef USE_HCACHE #if HAVE_QDBM #include #elif HAVE_GDBM @@ -229,7 +232,7 @@ static void show_version (void) printf (" libESMTP %s\n", buf); #endif -#if USE_HCACHE +#ifdef USE_HCACHE #if HAVE_QDBM printf (" qdbm %s\n", dpversion); #elif HAVE_GDBM @@ -297,7 +300,7 @@ static void show_version (void) #else "-USE_INODESORT " #endif -#if USE_HCACHE +#ifdef USE_HCACHE "+USE_HCACHE " #else "-USE_HCACHE " @@ -573,8 +576,6 @@ int main (int argc, char **argv) int i; int explicit_folder = 0; int dump_variables = -1; - extern char *optarg; - extern int optind; /* initialize random number for tmp file creation */ srand ((unsigned int) time (NULL)); diff --git a/mutt_idna.c b/mutt_idna.c index 6c52193..06c2ecd 100644 --- a/mutt_idna.c +++ b/mutt_idna.c @@ -248,7 +248,7 @@ void mutt_env_to_local (ENVELOPE * e) if (tag) *tag = #a; e = 1; err = NULL; \ } -int mutt_env_to_idna (ENVELOPE * env, const char **tag, char **err) +int mutt_env_to_idna (ENVELOPE * env, const char **tag, const char **err) { int e = 0; diff --git a/mutt_idna.h b/mutt_idna.h index 180b5b4..508f200 100644 --- a/mutt_idna.h +++ b/mutt_idna.h @@ -26,7 +26,7 @@ int mutt_addrlist_to_idna (ADDRESS *, char **); int mutt_addrlist_to_local (ADDRESS *); void mutt_env_to_local (ENVELOPE *); -int mutt_env_to_idna (ENVELOPE *, const char **, char **); +int mutt_env_to_idna (ENVELOPE *, const char **, const char **); const char *mutt_addr_for_display (ADDRESS * a); diff --git a/mx.c b/mx.c index 0d2ec9c..cb65b9f 100644 --- a/mx.c +++ b/mx.c @@ -291,7 +291,7 @@ int mx_lock_file (const char *path, int fd, int excl, int dot, int timeout) int mx_unlock_file (const char *path, int fd, int dot) { #ifdef USE_FCNTL - struct flock unlockit = { F_UNLCK, 0, 0, 0 }; + struct flock unlockit; memset (&unlockit, 0, sizeof (struct flock)); unlockit.l_type = F_UNLCK; diff --git a/pager.c b/pager.c index f255590..d68d041 100644 --- a/pager.c +++ b/pager.c @@ -43,6 +43,7 @@ #include "lib/rx.h" #include "lib/debug.h" +#include #include #include #include diff --git a/pop/pop_auth.c b/pop/pop_auth.c index 75fe93c..c7b62a9 100644 --- a/pop/pop_auth.c +++ b/pop/pop_auth.c @@ -278,7 +278,7 @@ static pop_auth_t pop_authenticators[] = { #endif {pop_auth_apop, "apop"}, {pop_auth_user, "user"}, - {NULL} + {NULL, NULL} }; /* diff --git a/postpone.c b/postpone.c index a197f12..0b1d689 100644 --- a/postpone.c +++ b/postpone.c @@ -40,11 +40,11 @@ #include static struct mapping_t PostponeHelp[] = { - {N_("Exit"), OP_EXIT}, - {N_("Del"), OP_DELETE}, + {N_("Exit"), OP_EXIT}, + {N_("Del"), OP_DELETE}, {N_("Undel"), OP_UNDELETE}, - {N_("Help"), OP_HELP}, - {NULL} + {N_("Help"), OP_HELP}, + {NULL, OP_NULL} }; diff --git a/sendlib.c b/sendlib.c index 12729ba..7de69ea 100644 --- a/sendlib.c +++ b/sendlib.c @@ -1806,7 +1806,7 @@ static RETSIGTYPE alarm_handler (int sig) to the temporary file containing the stdout of the child process */ static int -send_msg (const char *path, char **args, const char *msg, char **tempfile) +send_msg(const char *path, const char **args, const char *msg, char **tempfile) { sigset_t set; int fd, st; @@ -1944,8 +1944,8 @@ send_msg (const char *path, char **args, const char *msg, char **tempfile) return (st); } -static char **add_args (char **args, size_t * argslen, size_t * argsmax, - ADDRESS * addr) +static const char ** +add_args(const char **args, size_t *argslen, size_t *argsmax, ADDRESS * addr) { for (; addr; addr = addr->next) { /* weed out group mailboxes, since those are for display only */