]> granicus.if.org Git - neomutt/commitdiff
Thomas graces us with this patch that resolves a type-size inconsistency
authorThomas Glanzmann <sithglan@stud.uni-erlangen.de>
Tue, 22 Mar 2005 03:40:54 +0000 (03:40 +0000)
committerThomas Glanzmann <sithglan@stud.uni-erlangen.de>
Tue, 22 Mar 2005 03:40:54 +0000 (03:40 +0000)
in the UIDVALIDITY parser.

Edited for correctness.

hcache.c
imap/imap.c
imap/imap_private.h
imap/message.c
protos.h

index 38f44aa99c458f1a5e507fdc79207d5f59587a8f..85cdc700c2659280dbae31d706c7d251b06876b1 100644 (file)
--- a/hcache.c
+++ b/hcache.c
@@ -63,7 +63,7 @@ static struct header_cache
 typedef union
 {
   struct timeval timeval;
-  uint64_t uid_validity;
+  unsigned long uid_validity;
 } validate;
 
 static void *
@@ -550,7 +550,7 @@ mutt_hcache_per_folder(const char *path, const char *folder)
  * db_store */
 static void *
 mutt_hcache_dump(void *_db, HEADER * h, int *off,
-                uint64_t uid_validity)
+                unsigned long uid_validity)
 {
   struct header_cache *db = _db;
   unsigned char *d = NULL;
@@ -559,7 +559,7 @@ mutt_hcache_dump(void *_db, HEADER * h, int *off,
   d = lazy_malloc(sizeof (validate));
 
   if (uid_validity)
-    memcpy(d, &uid_validity, sizeof (uint64_t));
+    memcpy(d, &uid_validity, sizeof (unsigned long));
   else
   {
     struct timeval now;
@@ -696,7 +696,7 @@ mutt_hcache_fetch(void *db, const char *filename,
 
 int
 mutt_hcache_store(void *db, const char *filename, HEADER * header,
-                 uint64_t uid_validity,
+                 unsigned long uid_validity,
                  size_t(*keylen) (const char *fn))
 {
   struct header_cache *h = db;
@@ -886,7 +886,7 @@ mutt_hcache_fetch(void *db, const char *filename,
 
 int
 mutt_hcache_store(void *db, const char *filename, HEADER * header,
-                 uint64_t uid_validity,
+                 unsigned long uid_validity,
                  size_t(*keylen) (const char *fn))
 {
   DBT key;
index fde8b9a6cc0251d1e079f5210fc71127189d081c..38409514e76252966a92eed34ece8ea20f51a943 100644 (file)
@@ -635,7 +635,7 @@ int imap_open_mailbox (CONTEXT* ctx)
       dprint(2, (debugfile, "Getting mailbox UIDVALIDITY\n"));
       pc += 3;
       pc = imap_next_word(pc);
-      sscanf(pc, "%u", &(idata->uid_validity));
+      sscanf(pc, "%lu", &(idata->uid_validity));
     }
 #endif
     else
index 848326bc6dfdbc158133aab2c36fbfd8e223e456..a9bf6c98e662ad526937f61cfb7d1d4cfb2afe61 100644 (file)
@@ -180,7 +180,7 @@ typedef struct
   IMAP_CACHE cache[IMAP_CACHE_LEN];
   unsigned int noclose : 1;
 #ifdef USE_HCACHE
-  uint64_t uid_validity;
+  unsigned long uid_validity;
 #endif
   
   /* all folder flags - system flags AND keywords */
index acab54596f0933900178e0ddaababb733000388e..cc43c1935914bb391133524e13d504f4fad338f1 100644 (file)
@@ -69,7 +69,7 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
 
 #if USE_HCACHE
   void *hc   = NULL;
-  uint64_t *uid_validity = NULL;
+  unsigned long *uid_validity = NULL;
   char uid_buf[64];
 #endif /* USE_HCACHE */
 
@@ -154,7 +154,7 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
       fputs ("\n\n", fp);
 
       sprintf(uid_buf, "/%u", h.data->uid); /* XXX --tg 21:41 04-07-11 */
-      uid_validity = (uint64_t *) mutt_hcache_fetch (hc, uid_buf, &imap_hcache_keylen);
+      uid_validity = (unsigned long *) mutt_hcache_fetch (hc, uid_buf, &imap_hcache_keylen);
 
       if (uid_validity != NULL
       && *uid_validity == idata->uid_validity) {
index 395f5089b91be026c4c044ae1a3301e19b2fb606..3cda50538b733826e37cd35734e68755173f080c 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -111,7 +111,7 @@ void *mutt_hcache_open(const char *path, const char *folder);
 void mutt_hcache_close(void *db);
 HEADER *mutt_hcache_restore(const unsigned char *d, HEADER **oh);
 void *mutt_hcache_fetch(void *db, const char *filename, size_t (*keylen)(const char *fn));
-int mutt_hcache_store(void *db, const char *filename, HEADER *h, uint64_t uid_validity, size_t (*keylen)(const char *fn));
+int mutt_hcache_store(void *db, const char *filename, HEADER *h, unsigned long uid_validity, size_t (*keylen)(const char *fn));
 int mutt_hcache_delete(void *db, const char *filename, size_t (*keylen)(const char *fn));
 #endif /* USE_HCACHE */