missing includes, intializers, consts
authorPierre Habouzit <madcoder@debian.org>
Sat, 28 Oct 2006 19:22:45 +0000 (21:22 +0200)
committerPierre Habouzit <madcoder@debian.org>
Sat, 28 Oct 2006 19:22:45 +0000 (21:22 +0200)
16 files changed:
curs_lib.c
curs_main.c
edit.c
enter.c
help.c
init.c
keymap.c
keymap.h
main.c
mutt_idna.c
mutt_idna.h
mx.c
pager.c
pop/pop_auth.c
postpone.c
sendlib.c

index e5f9480..0cb31c6 100644 (file)
@@ -27,6 +27,7 @@
 #include "lib/str.h"
 #include "lib/debug.h"
 
 #include "lib/str.h"
 #include "lib/debug.h"
 
+#include <wchar.h>
 #include <termios.h>
 #include <sys/types.h>
 #include <fcntl.h>
 #include <termios.h>
 #include <sys/types.h>
 #include <fcntl.h>
index 0278069..ff7b8e3 100644 (file)
@@ -386,7 +386,7 @@ struct mapping_t IndexHelp[] = {
   {N_("Reply"), OP_REPLY},
   {N_("Group"), OP_GROUP_REPLY},
   {N_("Help"), OP_HELP},
   {N_("Reply"), OP_REPLY},
   {N_("Group"), OP_GROUP_REPLY},
   {N_("Help"), OP_HELP},
-  {NULL}
+  {NULL, OP_NULL}
 };
 
 #ifdef USE_NNTP
 };
 
 #ifdef USE_NNTP
@@ -399,7 +399,7 @@ struct mapping_t IndexNewsHelp[] = {
   {N_("Followup"), OP_FOLLOWUP},
   {N_("Catchup"), OP_CATCHUP},
   {N_("Help"), OP_HELP},
   {N_("Followup"), OP_FOLLOWUP},
   {N_("Catchup"), OP_CATCHUP},
   {N_("Help"), OP_HELP},
-  {NULL}
+  {NULL, OP_NULL}
 };
 #endif
 
 };
 #endif
 
diff --git a/edit.c b/edit.c
index ff581b0..893b495 100644 (file)
--- 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) {
       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;
 
           be_free_memory (buf, buflen);
           buf = NULL;
diff --git a/enter.c b/enter.c
index 7cd96dc..b979a2e 100644 (file)
--- 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.
  */
 
  * 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;
 {
   /* 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;
       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;
         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;
 
         redraw = M_REDRAW_INIT;
         break;
 
diff --git a/help.c b/help.c
index 0545777..c0bf22c 100644 (file)
--- a/help.c
+++ b/help.c
@@ -22,6 +22,7 @@
 #include "pager.h"
 #include "mapping.h"
 
 #include "pager.h"
 #include "mapping.h"
 
+#include <wchar.h>
 #include <ctype.h>
 #include <string.h>
 
 #include <ctype.h>
 #include <string.h>
 
diff --git a/init.c b/init.c
index 169b8b6..10c23d7 100644 (file)
--- 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;
 
   /* 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));
   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));
index 6a7f5c1..2508dff 100644 (file)
--- a/keymap.c
+++ b/keymap.c
@@ -375,7 +375,7 @@ int km_dokey (int menu)
 
     /* do we have an op already? */
     if (tmp.op) {
 
     /* 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? */
       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);
 }
 
       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;
 {
   static char buf[10];
   const char *p;
index 45829b6..6434c77 100644 (file)
--- a/keymap.h
+++ b/keymap.h
@@ -36,7 +36,7 @@ struct keymap_t {
   keycode_t *keys;              /* key sequence */
 };
 
   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);
 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 (file)
--- a/main.c
+++ b/main.c
@@ -42,6 +42,9 @@
 
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
+#else
+extern char *optarg;
+extern int optind;
 #endif
 
 #ifdef HAVE_LIBIDN
 #endif
 
 #ifdef HAVE_LIBIDN
@@ -56,7 +59,7 @@
 #include <libesmtp.h>
 #endif
 
 #include <libesmtp.h>
 #endif
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
 #if HAVE_QDBM
 #include <depot.h>
 #elif HAVE_GDBM
 #if HAVE_QDBM
 #include <depot.h>
 #elif HAVE_GDBM
@@ -229,7 +232,7 @@ static void show_version (void)
   printf ("  libESMTP %s\n", buf);
 #endif
 
   printf ("  libESMTP %s\n", buf);
 #endif
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
 #if HAVE_QDBM
   printf ("  qdbm %s\n", dpversion);
 #elif HAVE_GDBM
 #if HAVE_QDBM
   printf ("  qdbm %s\n", dpversion);
 #elif HAVE_GDBM
@@ -297,7 +300,7 @@ static void show_version (void)
 #else
          "-USE_INODESORT   "
 #endif
 #else
          "-USE_INODESORT   "
 #endif
-#if USE_HCACHE
+#ifdef USE_HCACHE
          "+USE_HCACHE  "
 #else
          "-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;
   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));
 
   /* initialize random number for tmp file creation */ 
   srand ((unsigned int) time (NULL));
index 6c52193..06c2ecd 100644 (file)
@@ -248,7 +248,7 @@ void mutt_env_to_local (ENVELOPE * e)
      if (tag) *tag = #a; e = 1; err = NULL; \
   }
 
      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;
 
 {
   int e = 0;
 
index 180b5b4..508f200 100644 (file)
@@ -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_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);
 
 
 const char *mutt_addr_for_display (ADDRESS * a);
 
diff --git a/mx.c b/mx.c
index 0d2ec9c..cb65b9f 100644 (file)
--- 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
 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;
 
   memset (&unlockit, 0, sizeof (struct flock));
   unlockit.l_type = F_UNLCK;
diff --git a/pager.c b/pager.c
index f255590..d68d041 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -43,6 +43,7 @@
 #include "lib/rx.h"
 #include "lib/debug.h"
 
 #include "lib/rx.h"
 #include "lib/debug.h"
 
+#include <wchar.h>
 #include <sys/stat.h>
 #include <ctype.h>
 #include <unistd.h>
 #include <sys/stat.h>
 #include <ctype.h>
 #include <unistd.h>
index 75fe93c..c7b62a9 100644 (file)
@@ -278,7 +278,7 @@ static pop_auth_t pop_authenticators[] = {
 #endif
   {pop_auth_apop, "apop"},
   {pop_auth_user, "user"},
 #endif
   {pop_auth_apop, "apop"},
   {pop_auth_user, "user"},
-  {NULL}
+  {NULL, NULL}
 };
 
 /*
 };
 
 /*
index a197f12..0b1d689 100644 (file)
 #include <sys/stat.h>
 
 static struct mapping_t PostponeHelp[] = {
 #include <sys/stat.h>
 
 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_("Undel"), OP_UNDELETE},
-  {N_("Help"), OP_HELP},
-  {NULL}
+  {N_("Help"),  OP_HELP},
+  {NULL,        OP_NULL}
 };
 
 
 };
 
 
index 12729ba..7de69ea 100644 (file)
--- 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
                        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;
 {
   sigset_t set;
   int fd, st;
@@ -1944,8 +1944,8 @@ send_msg (const char *path, char **args, const char *msg, char **tempfile)
   return (st);
 }
 
   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 */
 {
   for (; addr; addr = addr->next) {
     /* weed out group mailboxes, since those are for display only */