From 36f95756efa62ab8a6a31d728170bab4941b2b03 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Thu, 30 May 2019 10:35:11 +0100 Subject: [PATCH] date: move defines, so they can be used for testing --- mutt/date.c | 8 -------- mutt/date.h | 7 +++++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mutt/date.c b/mutt/date.c index ab1b7465d..a89e41a1d 100644 --- a/mutt/date.c +++ b/mutt/date.c @@ -38,15 +38,7 @@ #include "memory.h" #include "string2.h" -/* theoretically time_t can be float but it is integer on most (if not all) systems */ -#define TIME_T_MAX ((((time_t) 1 << (sizeof(time_t) * 8 - 2)) - 1) * 2 + 1) -#define TIME_T_MIN (-TIME_T_MAX - 1) -#define TM_YEAR_MAX \ - (1970 + (((((TIME_T_MAX - 59) / 60) - 59) / 60) - 23) / 24 / 366) -#define TM_YEAR_MIN (1970 - (TM_YEAR_MAX - 1970) - 1) - // clang-format off - /** * Weekdays - Day of the week (abbreviated) */ diff --git a/mutt/date.h b/mutt/date.h index 675c877e9..2637d99eb 100644 --- a/mutt/date.h +++ b/mutt/date.h @@ -26,6 +26,13 @@ #include #include +/* theoretically time_t can be float but it is integer on most (if not all) systems */ +#define TIME_T_MAX ((((time_t) 1 << (sizeof(time_t) * 8 - 2)) - 1) * 2 + 1) +#define TIME_T_MIN (-TIME_T_MAX - 1) +#define TM_YEAR_MAX \ + (1970 + (((((TIME_T_MAX - 59) / 60) - 59) / 60) - 23) / 24 / 366) +#define TM_YEAR_MIN (1970 - (TM_YEAR_MAX - 1970) - 1) + #define MUTT_DATE_NOW -9999 ///< Constant representing the 'current time', see: mutt_date_gmtime(), mutt_date_localtime() /** -- 2.40.0