From 7f0d64fd7243bc77e6212b6145d270d853f1348d Mon Sep 17 00:00:00 2001 From: Bertram Scharpf Date: Mon, 18 Jun 2018 09:33:19 +0200 Subject: [PATCH] Use the enum constant to initialise --- bcache.c | 2 +- mutt/address.c | 2 -- mutt_notmuch.c | 2 +- url.h | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bcache.c b/bcache.c index 0615a72f6..e6b11c137 100644 --- a/bcache.c +++ b/bcache.c @@ -58,7 +58,7 @@ struct BodyCache static int bcache_path(struct Account *account, const char *mailbox, char *dst, size_t dstlen) { char host[STRING]; - struct Url url = { 0 }; + struct Url url = { U_UNKNOWN }; int len; if (!account || !MessageCachedir || !*MessageCachedir || !dst || (dstlen == 0)) diff --git a/mutt/address.c b/mutt/address.c index d9c04324c..12c1a4431 100644 --- a/mutt/address.c +++ b/mutt/address.c @@ -989,8 +989,6 @@ const char *mutt_addr_for_display(struct Address *a) static char *buf = NULL; char *local_mailbox = NULL; - FREE(&buf); - if (!a->mailbox || mutt_addr_is_local(a)) return a->mailbox; diff --git a/mutt_notmuch.c b/mutt_notmuch.c index 4c4bfe5d2..d44bda43f 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -2173,7 +2173,7 @@ int nm_update_filename(struct Context *ctx, const char *old, const char *new, int nm_nonctx_get_count(char *path, int *all, int *new) { struct UrlQueryString *item = NULL; - struct Url url = { 0 }; + struct Url url = { U_UNKNOWN }; char *url_holder = mutt_str_strdup(path); char *db_filename = NULL, *db_query = NULL; notmuch_database_t *db = NULL; diff --git a/url.h b/url.h index 0ef9bdcef..5ebb71f81 100644 --- a/url.h +++ b/url.h @@ -31,6 +31,7 @@ struct Envelope; */ enum UrlScheme { + U_UNKNOWN, U_FILE, U_POP, U_POPS, @@ -42,9 +43,8 @@ enum UrlScheme U_SMTPS, U_MAILTO, #ifdef USE_NOTMUCH - U_NOTMUCH, + U_NOTMUCH #endif - U_UNKNOWN }; #define U_DECODE_PASSWD (1 << 0) -- 2.40.0