]> granicus.if.org Git - mutt/commitdiff
Fix some warnings
authorBrendan Cully <brendan@kublai.com>
Wed, 11 Apr 2007 02:23:16 +0000 (19:23 -0700)
committerBrendan Cully <brendan@kublai.com>
Wed, 11 Apr 2007 02:23:16 +0000 (19:23 -0700)
ChangeLog
bcache.c
imap/imap.c
imap/util.c
lib.c

index 1bd7c7a77af21b92930c6bace85b423b821dd765..4e51651e300d7298ff774e2294f0bbf98f707ed8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
-2007-04-10 17:40 -0700  Brendan Cully  <brendan@kublai.com>  (8082e4c9f524)
+2007-04-10 19:19 -0700  Brendan Cully  <brendan@kublai.com>  (ddd38b4cf15c)
+
+       * hcache.c: Refactor mutt_hcache_open to share more code
+
+       * hcache.c: Save some stats when header cache already exists
 
        * hcache.c, imap/imap.c, imap/imap_private.h, imap/message.c,
        imap/util.c: Make IMAP header cache layout match body cache. You can
index dbdc34672a81ae9f39588ff77936d8d578eb97ce..ac07849253d90224cb097729db791786347a159d 100644 (file)
--- a/bcache.c
+++ b/bcache.c
@@ -42,7 +42,6 @@ static int bcache_path(ACCOUNT *account, const char *mailbox,
                       char *dst, size_t dstlen)
 {
   char host[STRING];
-  char *s, *p;
   ciss_url_t url;
   size_t len;
 
index e192f8410b3e73a481858d678b8e186019a72505..4030c913113a8bd038030004177cc9b19c441248 100644 (file)
@@ -1567,9 +1567,6 @@ IMAP_STATUS* imap_mboxcache_get (IMAP_DATA* idata, const char* mbox, int create)
   IMAP_STATUS scache;
 #ifdef USE_HCACHE
   header_cache_t *hc = NULL;
-  ciss_url_t url;
-  char urlstr[LONG_STRING];
-  char cpath[LONG_STRING];
   unsigned int *uidvalidity = NULL;
   unsigned int *uidnext = NULL;
 #endif
index 076c75877efd9c342656c8a8ba199554a15868c7..fff96e22997608c6541aa6bf322f9321a0d5535a 100644 (file)
@@ -84,7 +84,7 @@ header_cache_t* imap_hcache_open (IMAP_DATA* idata, const char* path)
   char mbox[LONG_STRING];
 
   if (imap_parse_path (idata->ctx->path, &mx) < 0)
-    return -1;
+    return NULL;
 
   if (path)
     imap_cachepath (idata, path, mbox, sizeof (mbox));
diff --git a/lib.c b/lib.c
index 4113af65454cb33d0f03c0a313d013f27dfdc6e0..05f00c68e7b6ad89bcc62517afed29381e7c55ba 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -866,11 +866,14 @@ void mutt_remove_trailing_ws (char *s)
 char *mutt_concatn_path (char *dst, size_t dstlen,
     const char *dir, size_t dirlen, const char *fname, size_t fnamelen)
 {
+  size_t req;
+  size_t offset = 0;
+
   if (dstlen == 0)
     return NULL; /* probably should not mask errors like this */
 
   /* size check */
-  size_t req = dirlen + fnamelen + 1; /* +1 for the trailing nul */
+  req = dirlen + fnamelen + 1; /* +1 for the trailing nul */
   if (dirlen && fnamelen)
     req++; /* when both components are non-nul, we add a "/" in between */
   if (req > dstlen) { /* check for condition where the dst length is too short */
@@ -884,7 +887,6 @@ char *mutt_concatn_path (char *dst, size_t dstlen,
     return NULL;
   }
 
-  size_t offset = 0;
   if (dirlen) { /* when dir is not empty */
     memcpy(dst, dir, dirlen);
     offset = dirlen;