From: Aki Tuomi Date: Fri, 24 Jul 2026 10:22:14 +0000 (+0000) Subject: global: Drop TIME_T_SIGNED define X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00a26d612415a4cff8e4f547a552e4f87118b3ff;p=thirdparty%2Fdovecot%2Fcore.git global: Drop TIME_T_SIGNED define --- diff --git a/m4/time_t.m4 b/m4/time_t.m4 index 2d08cf872f..d3fbbfc483 100644 --- a/m4/time_t.m4 +++ b/m4/time_t.m4 @@ -20,7 +20,6 @@ AC_DEFUN([DOVECOT_TIME_T], [ AC_MSG_ERROR([Unsupported time_t type]) ;; esac - AC_DEFINE(TIME_T_SIGNED,, [Define if your time_t is signed]) timet_d_fmt="$timet_len"d timet_x_fmt="$timet_len"x diff --git a/src/lib-imap/imap-date.c b/src/lib-imap/imap-date.c index c8200c44c8..e6827aad52 100644 --- a/src/lib-imap/imap-date.c +++ b/src/lib-imap/imap-date.c @@ -119,11 +119,7 @@ static int imap_mktime(struct tm *tm, time_t *time_r) if (tm->tm_year <= 100) { /* too old. time_t can be signed or unsigned, handle both cases. */ -#ifdef TIME_T_SIGNED *time_r = INT_MIN; -#else - *time_r = 0; -#endif return 0; } else if (tm_is_too_large(tm, time_r)) { /* too high. return the highest allowed value. diff --git a/src/lib-mail/test-message-date.c b/src/lib-mail/test-message-date.c index 0c98d194f6..2b581d745d 100644 --- a/src/lib-mail/test-message-date.c +++ b/src/lib-mail/test-message-date.c @@ -14,11 +14,9 @@ struct test_message_date { static void test_message_date_parse(void) { static const struct test_message_date tests[] = { -#ifdef TIME_T_SIGNED { "Thu, 01 Jan 1970 01:59:59 +0200", -1, 2*60, TRUE }, { "Fri, 13 Dec 1901 20:45:53 +0000", -2147483647, 0, TRUE }, -#endif -#if (TIME_T_MAX_BITS > 32 || !defined(TIME_T_SIGNED)) +#if TIME_T_MAX_BITS > 32 { "Sun, 07 Feb 2106 06:28:15 +0000", 4294967295U, 0, TRUE }, #endif { "Wed, 07 Nov 2007 01:07:20 +0200", 1194390440, 2*60, TRUE }, diff --git a/src/lib/test-utc-mktime.c b/src/lib/test-utc-mktime.c index 67b2b482f4..5de60fbfbb 100644 --- a/src/lib/test-utc-mktime.c +++ b/src/lib/test-utc-mktime.c @@ -11,20 +11,16 @@ struct test_utc_mktime { void test_utc_mktime(void) { static const struct test_utc_mktime tests[] = { -#ifdef TIME_T_SIGNED { 1969, 12, 31, 23, 59, 59, -1 }, { 1901, 12, 13, 20, 45, 53, -2147483647 }, -#endif -#if (TIME_T_MAX_BITS > 32 || !defined(TIME_T_SIGNED)) - { 2106, 2, 7, 6, 28, 15, 4294967295 }, - { 2038, 1, 19, 3, 14, 8, 2147483648 }, -#endif { 2007, 11, 7, 1, 7, 20, 1194397640 }, { 1970, 1, 1, 0, 0, 0, 0 }, { 2038, 1, 19, 3, 14, 7, 2147483647 }, { INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, -1 }, #if TIME_T_MAX_BITS > 32 + { 2106, 2, 7, 6, 28, 15, 4294967295 }, { 2106, 2, 7, 6, 28, 16, 4294967296 }, + { 2038, 1, 19, 3, 14, 8, 2147483648 }, #endif /* June leap second */ { 2015, 6, 30, 23, 59, 59, 1435708799 }, diff --git a/src/lib/utc-mktime.c b/src/lib/utc-mktime.c index 62c71e15fb..66863cd147 100644 --- a/src/lib/utc-mktime.c +++ b/src/lib/utc-mktime.c @@ -55,11 +55,7 @@ time_t utc_mktime(const struct tm *tm) when gmtime()'s output matches the tm parameter, we've found the correct time_t value. this also means that if tm contains invalid values, -1 is returned. */ -#ifdef TIME_T_SIGNED t = 0; -#else - t = (time_t)1 << (TIME_T_MAX_BITS - 1); -#endif for (bits = TIME_T_MAX_BITS - 2;; bits--) { try_tm = gmtime(&t); dir = tm_cmp(&leap_adj_tm, try_tm);