[PATCH 48/59] Minor SECSPERDAY widening tweak

Paul Eggert eggert@cs.ucla.edu
Sun Jan 5 05:57:23 GMT 2025


* time/tzset.c (SECSPERDAY): Now an enum, not a macro.
There's no need to widen it to __time64_t, and keeping it
an enum can help the compiler do cheaper multiplication.
---
 time/tzset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/time/tzset.c b/time/tzset.c
index f3af960620..cc64516e37 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -27,7 +27,7 @@
 
 #include <timezone/tzfile.h>
 
-#define SECSPERDAY ((__time64_t) 86400)
+enum { SECSPERDAY = 24 * 60 * 60 };
 
 char *__tzname[2] = { (char *) "UTC", (char *) "UTC" };
 int __daylight = 0;
-- 
2.45.2



More information about the Libc-alpha mailing list