]> granicus.if.org Git - neomutt/commitdiff
boolify mutt_date_make_time()
authorRichard Russon <rich@flatcap.org>
Sun, 21 Apr 2019 18:15:44 +0000 (19:15 +0100)
committerRichard Russon <rich@flatcap.org>
Wed, 24 Apr 2019 11:35:08 +0000 (12:35 +0100)
email/from.c
mutt/date.c
mutt/date.h
ncrypt/gnupgparse.c
pattern.c

index d3b8955dae4ac73fa80a9b9494880629f16e5dc1..ba84411e044d7c7963da27c33a13fd714ce74aba 100644 (file)
@@ -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;
 }
index dc5afa8b66d553f25fade34fee0d35033cbeaba5..62d20820ec76897836b75cf7fcaa7ef490cccce9 100644 (file)
@@ -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;
 }
 
 /**
index db835e92610ec1e963f89af6c44e1f8a2f11c2f7..675c877e9c64834346eeda3ff1a2e991e2ab326f 100644 (file)
@@ -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);
index 57f5bccb1e8102506e9805d7260bc6fd473bb374..96180dcf819a69297c1d05b851c131b855df8862 100644 (file)
@@ -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 */
         {
index def0d55753ff23e0ba61f9aaaad4b263da693fe9..bf8599d950259225afb6d177d51f4b029db0f4bc 100644 (file)
--- 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;
 }