force our cflags in subdirs as well.
authorPierre Habouzit <madcoder@debian.org>
Sat, 28 Oct 2006 18:54:04 +0000 (20:54 +0200)
committerPierre Habouzit <madcoder@debian.org>
Sat, 28 Oct 2006 18:54:04 +0000 (20:54 +0200)
more consts, less warnings.

13 files changed:
compose.c
imap/Makefile.am
imap/auth.c
imap/auth_login.c
imap/command.c
imap/message.c
intl/Makefile.in
lib/Makefile.am
nntp/Makefile.am
nntp/nntp.c
pop/Makefile.am
pop/pop.h
pop/pop_lib.c

index e7d2886..8af5084 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -708,7 +708,7 @@ int mutt_compose_menu (HEADER * msg,    /* structure for new message */
       if (str_cmp ("builtin", Editor) != 0 &&
           (op == OP_COMPOSE_EDIT_HEADERS ||
            (op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))) {
-        char *tag = NULL, *err = NULL;
+        const char *tag = NULL, *err = NULL;
 
         mutt_env_to_local (msg->env);
         mutt_edit_headers (NONULL (Editor), msg->content->filename, msg,
index 586e27b..4dbf7db 100644 (file)
@@ -23,3 +23,5 @@ noinst_HEADERS = auth.h imap_private.h message.h mx_imap.h
 
 libimap_a_SOURCES = auth.c auth_login.c browse.c command.c imap.c imap.h mx_imap.h \
        message.c utf7.c util.c mx_imap.c $(AUTHENTICATORS) $(GSSSOURCES)
+
+-include ../cflags.mk
index 23473e1..7c6293d 100644 (file)
@@ -39,7 +39,7 @@ static imap_auth_t imap_authenticators[] = {
 #endif
   {imap_auth_login, "login"},
 
-  {NULL}
+  {NULL, NULL}
 };
 
 /* imap_authenticate: Attempt to authenticate using either user-specified
index bffa005..3216c3b 100644 (file)
 #include "auth.h"
 
 /* imap_auth_login: Plain LOGIN support */
-imap_auth_res_t imap_auth_login (IMAP_DATA * idata, const char *method)
+imap_auth_res_t imap_auth_login(IMAP_DATA *idata, const char *method)
 {
-  char q_user[SHORT_STRING], q_pass[SHORT_STRING];
-  char buf[STRING];
-  int rc;
+    char q_user[SHORT_STRING], q_pass[SHORT_STRING];
+    char buf[STRING];
+    int rc;
 
-  if (mutt_bit_isset (idata->capabilities, LOGINDISABLED)) {
-    mutt_message _("LOGIN disabled on this server.");
+    if (mutt_bit_isset (idata->capabilities, LOGINDISABLED)) {
+        mutt_message _("LOGIN disabled on this server.");
 
-    return IMAP_AUTH_UNAVAIL;
-  }
+        return IMAP_AUTH_UNAVAIL;
+    }
 
-  if (mutt_account_getlogin (&idata->conn->account))
-    return IMAP_AUTH_FAILURE;
-  if (mutt_account_getpass (&idata->conn->account))
-    return IMAP_AUTH_FAILURE;
+    if (mutt_account_getlogin (&idata->conn->account))
+        return IMAP_AUTH_FAILURE;
+    if (mutt_account_getpass (&idata->conn->account))
+        return IMAP_AUTH_FAILURE;
 
-  mutt_message _("Logging in...");
+    mutt_message _("Logging in...");
 
-  imap_quote_string (q_user, sizeof (q_user), idata->conn->account.login);
-  imap_quote_string (q_pass, sizeof (q_pass), idata->conn->account.pass);
+    imap_quote_string(q_user, sizeof(q_user), idata->conn->account.login);
+    imap_quote_string(q_pass, sizeof(q_pass), idata->conn->account.pass);
 
-  snprintf (buf, sizeof (buf), "LOGIN %s %s", q_user, q_pass);
-  rc = imap_exec (idata, buf, IMAP_CMD_FAIL_OK | IMAP_CMD_PASS);
+    snprintf(buf, sizeof(buf), "LOGIN %s %s", q_user, q_pass);
+    rc = imap_exec(idata, buf, IMAP_CMD_FAIL_OK | IMAP_CMD_PASS);
 
-  if (!rc)
-    return IMAP_AUTH_SUCCESS;
+    if (!rc)
+        return IMAP_AUTH_SUCCESS;
 
-  mutt_error _("Login failed.");
+    mutt_error _("Login failed.");
 
-  mutt_sleep (2);
-  return IMAP_AUTH_FAILURE;
+    mutt_sleep (2);
+    return IMAP_AUTH_FAILURE;
 }
index 2039e54..a28ae7a 100644 (file)
@@ -42,7 +42,7 @@ static void cmd_parse_fetch (IMAP_DATA * idata, char *s);
 static void cmd_parse_myrights (IMAP_DATA * idata, char *s);
 static void cmd_parse_search (IMAP_DATA* idata, char* s);
 
-static char *Capabilities[] = {
+static const char *Capabilities[] = {
   "IMAP4",
   "IMAP4rev1",
   "STATUS",
index bc75ed5..949f5d9 100644 (file)
@@ -48,7 +48,7 @@ static int msg_has_flag (LIST * flag_list, const char *flag);
 static int msg_parse_fetch (IMAP_HEADER * h, char *s);
 static char *msg_parse_flags (IMAP_HEADER * h, char *s);
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
 static int msg_fetch_header_fetch (CONTEXT * ctx, IMAP_HEADER * h, char *buf,
                                    FILE * fp);
 static size_t imap_hcache_keylen (const char *fn);
@@ -73,7 +73,7 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend)
   const char *want_headers =
     "DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL";
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   void *hc = NULL;
   unsigned long *uid_validity = NULL;
   char uid_buf[64];
@@ -116,7 +116,7 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend)
   idata->reopen &= ~IMAP_NEWMAIL_PENDING;
   idata->newMailCount = 0;
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   if ((hc = mutt_hcache_open (HeaderCache, ctx->path))) {
 
     snprintf (buf, sizeof (buf),
@@ -270,7 +270,7 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend)
       /* content built as a side-effect of mutt_read_rfc822_header */
       ctx->hdrs[msgno]->content->length = h.content_length;
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
       sprintf (uid_buf, "/%u", h.data->uid);
       mutt_hcache_store (hc, uid_buf, ctx->hdrs[msgno], idata->uid_validity,
                          &imap_hcache_keylen);
@@ -284,7 +284,7 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend)
     if ((mfhrc < -1) || ((rc != IMAP_CMD_CONTINUE) && (rc != IMAP_CMD_OK))) {
       imap_free_header_data ((void *)&h.data);
       fclose (fp);
-#if USE_HCACHE
+#ifdef USE_HCACHE
       mutt_hcache_close (hc);
 #endif /* USE_HCACHE */
       return -1;
@@ -300,7 +300,7 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend)
     }
   }
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   mutt_hcache_close (hc);
 #endif /* USE_HCACHE */
 
@@ -890,7 +890,7 @@ static int msg_fetch_header (CONTEXT * ctx, IMAP_HEADER * h, char *buf,
   return rc;
 }
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
 static size_t imap_hcache_keylen (const char *fn)
 {
   return str_len (fn);
index b5435b0..74cfd9e 100644 (file)
@@ -491,3 +491,4 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 # Tell versions [3.59,3.63) of GNU make not to export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
+-include ../cflags.mk
index 5c0d961..9354a37 100644 (file)
@@ -11,3 +11,5 @@ noinst_HEADERS = mem.h str.h exit.h intl.h list.h rx.h debug.h
 
 libsane_a_SOURCES = mem.c exit.c str.c list.c rx.h debug.h \
                    mem.h exit.h str.h list.h rx.c debug.c intl.h
+
+-include ../cflags.mk
index 97e7ad6..8f3d7da 100644 (file)
@@ -11,3 +11,5 @@ noinst_HEADERS = nntp.h mx_nntp.h
 
 libnntp_a_SOURCES = nntp.h mx_nntp.h \
                    nntp.c mx_nntp.c newsrc.c
+
+-include ../cflags.mk
index 526dd30..391d66e 100644 (file)
@@ -323,7 +323,7 @@ static int mutt_nntp_query (NNTP_DATA * data, char *line, size_t linelen)
  * -2 - invalid command or execution error,
  * -3 - error in funct(*line, *data).
  */
-static int mutt_nntp_fetch (NNTP_DATA * nntp_data, char *query, char *msg,
+static int mutt_nntp_fetch (NNTP_DATA * nntp_data, const char *query, char *msg,
                             progress_t* bar, int (*funct) (char *, void *),
                             void *data, int tagged)
 {
@@ -519,7 +519,7 @@ static int parse_description (char *line, void *n)
 #undef news
 }
 
-static void nntp_get_desc (NNTP_DATA * data, char *mask, char *msg, progress_t* bar)
+static void nntp_get_desc (NNTP_DATA * data, const char *mask, char *msg, progress_t* bar)
 {
   char buf[STRING];
 
index ac8f5ce..48cb078 100644 (file)
@@ -10,3 +10,5 @@ noinst_LIBRARIES = libpop.a
 noinst_HEADERS = pop.h mx_pop.h
 
 libpop_a_SOURCES = pop.c pop_auth.c pop_lib.c pop.h mx_pop.h mx_pop.c
+
+-include ../cflags.mk
index bbafe1f..fe49b4b 100644 (file)
--- a/pop/pop.h
+++ b/pop/pop.h
@@ -95,9 +95,9 @@ void pop_apop_timestamp (POP_DATA *, char *);
 int pop_parse_path (const char *, ACCOUNT *);
 int pop_connect (POP_DATA *);
 pop_query_status pop_open_connection (POP_DATA *);
-pop_query_status pop_query_d (POP_DATA *, char *, size_t, char *);
-pop_query_status pop_fetch_data (POP_DATA *, char *, progress_t*, int (*funct) (char *, void *),
-                    void *);
+pop_query_status pop_query_d (POP_DATA *, char *, size_t, const char *);
+pop_query_status pop_fetch_data (POP_DATA *, const char *, progress_t*,
+                                 int (*funct) (char *, void *), void *);
 pop_query_status pop_reconnect (CONTEXT *);
 void pop_logout (CONTEXT *);
 void pop_error (POP_DATA *, char *);
index fe30c11..4aa3409 100644 (file)
@@ -386,7 +386,7 @@ void pop_logout (CONTEXT * ctx)
  * -1 - conection lost,
  * -2 - invalid command or execution error.
 */
-pop_query_status pop_query_d (POP_DATA * pop_data, char *buf, size_t buflen, char *msg)
+pop_query_status pop_query_d (POP_DATA * pop_data, char *buf, size_t buflen, const char *msg)
 {
   int dbg = M_SOCK_LOG_CMD;
   char *c;
@@ -428,7 +428,7 @@ pop_query_status pop_query_d (POP_DATA * pop_data, char *buf, size_t buflen, cha
  * -2 - invalid command or execution error,
  * -3 - error in funct(*line, *data)
  */
-pop_query_status pop_fetch_data (POP_DATA * pop_data, char *query, progress_t* bar,
+pop_query_status pop_fetch_data (POP_DATA * pop_data, const char *query, progress_t* bar,
                     int (*funct) (char *, void *), void *data)
 {
   char buf[LONG_STRING];
@@ -528,7 +528,7 @@ pop_query_status pop_reconnect (CONTEXT * ctx)
       for (i = 0; i < ctx->msgcount; i++)
         ctx->hdrs[i]->refno = -1;
 
-      ret = pop_fetch_data (pop_data, "UIDL\r\n", &bar, check_uidl, ctx);
+      ret = pop_fetch_data(pop_data, "UIDL\r\n", &bar, check_uidl, ctx);
       if (ret == PQ_ERR) {
         mutt_error ("%s", pop_data->err_msg);
         mutt_sleep (2);