From: Federico Kircheis Date: Tue, 6 Mar 2018 17:12:58 +0000 (+0100) Subject: Reduce variable scope - newsrc.c X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6db4aaa591f2319bf2915ccdb7b8150d2415203e;p=neomutt Reduce variable scope - newsrc.c --- diff --git a/newsrc.c b/newsrc.c index 0ab6e5e95..57b0887aa 100644 --- a/newsrc.c +++ b/newsrc.c @@ -138,8 +138,6 @@ void nntp_newsrc_close(struct NntpServer *nserv) */ void nntp_group_unread_stat(struct NntpData *nntp_data) { - anum_t first, last; - nntp_data->unread = 0; if (nntp_data->last_message == 0 || nntp_data->first_message > nntp_data->last_message) return; @@ -147,10 +145,10 @@ void nntp_group_unread_stat(struct NntpData *nntp_data) nntp_data->unread = nntp_data->last_message - nntp_data->first_message + 1; for (unsigned int i = 0; i < nntp_data->newsrc_len; i++) { - first = nntp_data->newsrc_ent[i].first; + anum_t first = nntp_data->newsrc_ent[i].first; if (first < nntp_data->first_message) first = nntp_data->first_message; - last = nntp_data->newsrc_ent[i].last; + anum_t last = nntp_data->newsrc_ent[i].last; if (last > nntp_data->last_message) last = nntp_data->last_message; if (first <= last) @@ -698,7 +696,7 @@ void nntp_hcache_update(struct NntpData *nntp_data, header_cache_t *hc) char buf[16]; bool old = false; void *hdata = NULL; - anum_t first, last, current; + anum_t first, last; if (!hc) return; @@ -714,7 +712,7 @@ void nntp_hcache_update(struct NntpData *nntp_data, header_cache_t *hc) nntp_data->last_cached = last; /* clean removed headers from cache */ - for (current = first; current <= last; current++) + for (anum_t current = first; current <= last; current++) { if (current >= nntp_data->first_message && current <= nntp_data->last_message) continue;