From: Richard Russon Date: Thu, 12 Jul 2018 12:59:04 +0000 (+0100) Subject: always compile Header data X-Git-Tag: 2019-10-25~757^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83c7a4a2be739565dffcb468c50f9774479ae4a3;p=neomutt always compile Header data --- diff --git a/email/header.c b/email/header.c index 94bc08fee..a90677d95 100644 --- a/email/header.c +++ b/email/header.c @@ -51,11 +51,9 @@ void mutt_header_free(struct Header **h) mutt_list_free(&(*h)->chain); #endif driver_tags_free(&(*h)->tags); -#if defined(USE_POP) || defined(USE_IMAP) || defined(USE_NNTP) || defined(USE_NOTMUCH) if ((*h)->free_cb) (*h)->free_cb(*h); FREE(&(*h)->data); -#endif FREE(h); } diff --git a/email/header.h b/email/header.h index abcc34fe9..9999faa83 100644 --- a/email/header.h +++ b/email/header.h @@ -109,10 +109,8 @@ struct Header struct TagHead tags; /**< for drivers that support server tagging */ -#if defined(USE_POP) || defined(USE_IMAP) || defined(USE_NNTP) || defined(USE_NOTMUCH) void *data; /**< driver-specific data */ void (*free_cb)(struct Header *); /**< driver-specific data free function */ -#endif char *maildir_flags; /**< unknown maildir flags */ }; diff --git a/hcache/hcache.c b/hcache/hcache.c index 11ca90a26..2c00e285c 100644 --- a/hcache/hcache.c +++ b/hcache/hcache.c @@ -837,9 +837,7 @@ static void *hcache_dump(header_cache_t *h, struct Header *header, int *off, #ifdef MIXMASTER STAILQ_INIT(&nh.chain); #endif -#if defined(USE_POP) || defined(USE_IMAP) nh.data = NULL; -#endif memcpy(d + *off, &nh, sizeof(struct Header)); *off += sizeof(struct Header); diff --git a/nntp/nntp.c b/nntp/nntp.c index da10fd32c..b8f9e3e66 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -1211,7 +1211,7 @@ static int parse_overview_line(char *line, void *data) mutt_header_free(&hdr); ctx->hdrs[ctx->msgcount] = hdr = mutt_hcache_restore(hdata); mutt_hcache_free(fc->hc, &hdata); - hdr->data = 0; + hdr->data = NULL; hdr->read = false; hdr->old = false; @@ -1380,7 +1380,7 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first, mutt_debug(2, "mutt_hcache_fetch %s\n", buf); ctx->hdrs[ctx->msgcount] = hdr = mutt_hcache_restore(hdata); mutt_hcache_free(fc.hc, &hdata); - hdr->data = 0; + hdr->data = NULL; /* skip header marked as deleted in cache */ if (hdr->deleted && !restore) @@ -1990,7 +1990,7 @@ static int check_mailbox(struct Context *ctx) mutt_debug(2, "#1 mutt_hcache_fetch %s\n", buf); hdr = mutt_hcache_restore(hdata); mutt_hcache_free(hc, &hdata); - hdr->data = 0; + hdr->data = NULL; deleted = hdr->deleted; flagged = hdr->flagged; mutt_header_free(&hdr); @@ -2037,7 +2037,7 @@ static int check_mailbox(struct Context *ctx) ctx->hdrs[ctx->msgcount] = hdr = mutt_hcache_restore(hdata); mutt_hcache_free(hc, &hdata); - hdr->data = 0; + hdr->data = NULL; if (hdr->deleted) { mutt_header_free(&hdr);