From: Richard Russon Date: Sun, 21 Apr 2019 18:15:44 +0000 (+0100) Subject: boolify mutt_date_make_time() X-Git-Tag: 2019-10-25~245^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e190bce753a99061271bc2d33196a1f28f75f6e4;p=neomutt boolify mutt_date_make_time() --- diff --git a/email/from.c b/email/from.c index d3b8955da..ba84411e0 100644 --- a/email/from.c +++ b/email/from.c @@ -203,6 +203,6 @@ bool is_from(const char *s, char *path, size_t pathlen, time_t *tp) tm.tm_isdst = -1; if (tp) - *tp = mutt_date_make_time(&tm, 0); + *tp = mutt_date_make_time(&tm, false); return true; } diff --git a/mutt/date.c b/mutt/date.c index dc5afa8b6..62d20820e 100644 --- a/mutt/date.c +++ b/mutt/date.c @@ -229,7 +229,7 @@ time_t mutt_date_local_tz(time_t t) * Convert a struct tm to time_t, but don't take the local timezone into * account unless "local" is nonzero */ -time_t mutt_date_make_time(struct tm *t, int local) +time_t mutt_date_make_time(struct tm *t, bool local) { time_t g; @@ -575,7 +575,7 @@ time_t mutt_date_parse_date(const char *s, struct Tz *tz_out) tz_out->zoccident = zoccident; } - time_t time = mutt_date_make_time(&tm, 0); + time_t time = mutt_date_make_time(&tm, false); /* Check we haven't overflowed the time (on 32-bit arches) */ if ((time != TIME_T_MAX) && (time != TIME_T_MIN)) time += tz_offset; @@ -673,7 +673,7 @@ time_t mutt_date_parse_imap(const char *s) if (s[0] == '+') tz = -tz; - return mutt_date_make_time(&t, 0) + tz; + return mutt_date_make_time(&t, false) + tz; } /** diff --git a/mutt/date.h b/mutt/date.h index db835e926..675c877e9 100644 --- a/mutt/date.h +++ b/mutt/date.h @@ -48,7 +48,7 @@ struct tm mutt_date_localtime(time_t t); time_t mutt_date_local_tz(time_t t); char * mutt_date_make_date(char *buf, size_t buflen); int mutt_date_make_imap(char *buf, size_t buflen, time_t timestamp); -time_t mutt_date_make_time(struct tm *t, int local); +time_t mutt_date_make_time(struct tm *t, bool local); int mutt_date_make_tls(char *buf, size_t buflen, time_t timestamp); void mutt_date_normalize_time(struct tm *tm); time_t mutt_date_parse_date(const char *s, struct Tz *tz_out); diff --git a/ncrypt/gnupgparse.c b/ncrypt/gnupgparse.c index 57f5bccb1..96180dcf8 100644 --- a/ncrypt/gnupgparse.c +++ b/ncrypt/gnupgparse.c @@ -288,7 +288,7 @@ static struct PgpKeyInfo *parse_pub_line(char *buf, bool *is_subkey, struct PgpK p = tstr + 8; goto bail; } - tmp.gen_time = mutt_date_make_time(&time, 0); + tmp.gen_time = mutt_date_make_time(&time, false); } else /* gpg 2.0.10+ uses seconds since 1970-01-01 */ { diff --git a/pattern.c b/pattern.c index def0d5575..bf8599d95 100644 --- a/pattern.c +++ b/pattern.c @@ -692,8 +692,8 @@ static bool eval_date_minmax(struct Pattern *pat, const char *s, struct Buffer * /* Since we allow two dates to be specified we'll have to adjust that. */ adjust_date_range(&min, &max); - pat->min = mutt_date_make_time(&min, 1); - pat->max = mutt_date_make_time(&max, 1); + pat->min = mutt_date_make_time(&min, true); + pat->max = mutt_date_make_time(&max, true); return true; }