From: Julien Danjou Date: Mon, 13 Nov 2006 15:04:47 +0000 (+0100) Subject: Fix a bunch of warnings in imap code X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=5b0581b41f115cd0442037a97db313ef5b5b8822;p=apps%2Fmadmutt.git Fix a bunch of warnings in imap code Signed-off-by: Julien Danjou Signed-off-by: Pierre Habouzit --- diff --git a/imap/auth_anon.c b/imap/auth_anon.c index 7c2dfba..cb3fe72 100644 --- a/imap/auth_anon.c +++ b/imap/auth_anon.c @@ -21,7 +21,7 @@ #include /* this is basically a stripped-down version of the cram-md5 method. */ -imap_auth_res_t imap_auth_anon (IMAP_DATA * idata, const char *method) +imap_auth_res_t imap_auth_anon (IMAP_DATA * idata, const char *method __attribute__ ((unused))) { int rc; diff --git a/imap/auth_cram.c b/imap/auth_cram.c index 0438a82..d70afb8 100644 --- a/imap/auth_cram.c +++ b/imap/auth_cram.c @@ -29,7 +29,7 @@ static void hmac_md5 (const char *password, char *challenge, unsigned char *response); /* imap_auth_cram_md5: AUTH=CRAM-MD5 support. */ -imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA * idata, const char *method) +imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA * idata, const char *method __attribute__ ((unused))) { char ibuf[LONG_STRING * 2], obuf[LONG_STRING]; unsigned char hmac_response[MD5_DIGEST_LEN]; diff --git a/imap/auth_gss.c b/imap/auth_gss.c index 197a18e..23e528e 100644 --- a/imap/auth_gss.c +++ b/imap/auth_gss.c @@ -37,7 +37,7 @@ #define GSS_AUTH_P_PRIVACY 4 /* imap_auth_gss: AUTH=GSSAPI support. */ -imap_auth_res_t imap_auth_gss (IMAP_DATA * idata, const char *method) +imap_auth_res_t imap_auth_gss (IMAP_DATA * idata, const char *method __attribute__ ((unused))) { gss_buffer_desc request_buf, send_token; gss_buffer_t sec_token; diff --git a/imap/auth_login.c b/imap/auth_login.c index a6b78dc..48a607a 100644 --- a/imap/auth_login.c +++ b/imap/auth_login.c @@ -21,7 +21,7 @@ #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 __attribute__ ((unused))) { char q_user[SHORT_STRING], q_pass[SHORT_STRING]; char buf[STRING]; diff --git a/imap/command.c b/imap/command.c index 6968334..3893f89 100644 --- a/imap/command.c +++ b/imap/command.c @@ -385,7 +385,7 @@ static int cmd_handle_untagged (IMAP_DATA * idata) } /* This should be optimised (eg with a tree or hash) */ -static int uid2msgno (IMAP_DATA* idata, unsigned int uid) { +static int uid2msgno (IMAP_DATA* idata, int uid) { int i; for (i = 0; i < idata->ctx->msgcount; i++) { diff --git a/imap/imap.c b/imap/imap.c index fb4b3ac..f7b30f4 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -53,7 +53,7 @@ static void imap_set_flag (IMAP_DATA * idata, int aclbit, int flag, /* imap_access: Check permissions on an IMAP mailbox. * TODO: ACL checks. Right now we assume if it exists we can * mess with it. */ -int imap_access (const char *path, int flags) +int imap_access (const char *path, int flags __attribute__ ((unused))) { IMAP_DATA *idata; IMAP_MBOX mx; @@ -805,7 +805,7 @@ int imap_make_msg_set (IMAP_DATA * idata, BUFFER * buf, int flag, int changed) HEADER **hdrs; /* sorted local copy */ int count = 0; /* number of messages in message set */ int match = 0; /* whether current message matches flag condition */ - unsigned int setstart = 0; /* start of current message range */ + int setstart = 0; /* start of current message range */ int n; short oldsort; /* we clobber reverse, must restore it */ @@ -1106,7 +1106,7 @@ void imap_close_mailbox (CONTEXT * ctx) * 0 no change * -1 error */ -int imap_check_mailbox (CONTEXT * ctx, int *index_hint, int force) +int imap_check_mailbox (CONTEXT * ctx, int *index_hint __attribute__ ((unused)), int force) { /* overload keyboard timeout to avoid many mailbox checks in a row. * Most users don't like having to wait exactly when they press a key. */ diff --git a/imap/imap_private.h b/imap/imap_private.h index 2bdebe6..2a7a1f9 100644 --- a/imap/imap_private.h +++ b/imap/imap_private.h @@ -99,7 +99,7 @@ enum { /* -- data structures -- */ typedef struct { - unsigned int uid; + int uid; char *path; } IMAP_CACHE; diff --git a/imap/message.c b/imap/message.c index 92afea8..e9b98d5 100644 --- a/imap/message.c +++ b/imap/message.c @@ -54,7 +54,7 @@ static char *msg_parse_flags (IMAP_HEADER * h, char *s); #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); +static ssize_t imap_hcache_keylen (const char *fn); #endif /* USE_HCACHE */ /* imap_read_headers: @@ -892,7 +892,7 @@ static int msg_fetch_header (CONTEXT * ctx, IMAP_HEADER * h, char *buf, } #ifdef USE_HCACHE -static size_t imap_hcache_keylen (const char *fn) +static ssize_t imap_hcache_keylen (const char *fn) { return m_strlen(fn); } @@ -904,7 +904,7 @@ static size_t imap_hcache_keylen (const char *fn) * -1 if the string is not a fetch response * -2 if the string is a corrupt fetch response */ static int msg_fetch_header_fetch (CONTEXT * ctx, IMAP_HEADER * h, char *buf, - FILE * fp) + FILE * fp __attribute__ ((unused))) { IMAP_DATA *idata; int rc = -1; /* default now is that string isn't FETCH response */ diff --git a/imap/mx_imap.c b/imap/mx_imap.c index d622a47..1c4358f 100644 --- a/imap/mx_imap.c +++ b/imap/mx_imap.c @@ -22,7 +22,7 @@ -int imap_is_magic (const char* path, struct stat* st) { +int imap_is_magic (const char* path, struct stat* st __attribute__ ((unused))) { url_scheme_t s; if (!path || !*path) return (-1); @@ -35,7 +35,9 @@ static int acl_check_imap (CONTEXT* ctx, int bit) { mutt_bit_isset (((IMAP_DATA*) ctx->data)->rights, bit)); } -static int imap_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr) +static int imap_open_new_message (MESSAGE * msg, + CONTEXT * dest __attribute__ ((unused)), + HEADER * hdr __attribute__ ((unused))) { char tmp[_POSIX_PATH_MAX]; @@ -50,7 +52,9 @@ static int imap_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr) /* this ugly kludge is required since the last int to * imap_check_mailbox() doesn't mean 'lock' but 'force'... */ -static int _imap_check_mailbox (CONTEXT* ctx, int* index_hint, int lock) { +static int _imap_check_mailbox (CONTEXT* ctx, + int* index_hint, + int lock __attribute__ ((unused))) { return (imap_check_mailbox (ctx, index_hint, 0)); } diff --git a/lib-crypt/smime.c b/lib-crypt/smime.c index 5e9fae0..eb554e9 100644 --- a/lib-crypt/smime.c +++ b/lib-crypt/smime.c @@ -1053,7 +1053,7 @@ static char *smime_extract_signer_certificate (char *infile) /* Add a certificate and update index file (externally). */ -void smime_invoke_import (char *infile, char *mailbox __attribute__((notused))) +void smime_invoke_import (char *infile, char *mailbox __attribute__ ((unused))) { char tmpfname[_POSIX_PATH_MAX], *certfile = NULL, buf[STRING]; FILE *smimein = NULL, *fpout = NULL, *fperr = NULL; diff --git a/pop/mx_pop.c b/pop/mx_pop.c index f30dbbd..c1f2048 100644 --- a/pop/mx_pop.c +++ b/pop/mx_pop.c @@ -19,12 +19,12 @@ #include "mx.h" #include "mx_pop.h" -static int pop_is_magic (const char* path, struct stat* st) { +static int pop_is_magic (const char* path, struct stat* st __attribute__ ((unused))) { url_scheme_t s = url_check_scheme (NONULL (path)); return ((s == U_POP || s == U_POPS) ? M_POP : -1); } -static int acl_check_pop (CONTEXT* ctx, int bit) { +static int acl_check_pop (CONTEXT* ctx __attribute__ ((unused)), int bit) { switch (bit) { case ACL_INSERT: /* editing messages */ case ACL_WRITE: /* change importance */