[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] mktime, timegm: simplify glibc time64_t
From: |
Paul Eggert |
Subject: |
[PATCH 2/2] mktime, timegm: simplify glibc time64_t |
Date: |
Sat, 1 Sep 2018 00:23:24 -0700 |
* lib/mktime.c, lib/timegm.c (mktime_offset_t) [_LIBC]:
Now long int, not time_t, since long int is the longstanding type
for this in glibc and there is no need to change it even if time_t
becomes 64 bits - even int would do, though this would be a change
to the glibc generated code. When this change is merged into
glibc, it should simplify the time_t vs time64_t situation.
---
ChangeLog | 8 ++++++++
lib/mktime.c | 2 +-
lib/timegm.c | 2 +-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3f9cf9624..1ad42cd98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2018-08-31 Paul Eggert <address@hidden>
+ mktime, timegm: simplify glibc time64_t
+ * lib/mktime.c, lib/timegm.c (mktime_offset_t) [_LIBC]:
+ Now long int, not time_t, since long int is the longstanding type
+ for this in glibc and there is no need to change it even if time_t
+ becomes 64 bits - even int would do, though this would be a change
+ to the glibc generated code. When this change is merged into
+ glibc, it should simplify the time_t vs time64_t situation.
+
mktime, timegm: simplify merge to glibc
Move code around to make a merge to glibc easier to audit.
This should not change behavior.
diff --git a/lib/mktime.c b/lib/mktime.c
index 285876479..a307671fe 100644
--- a/lib/mktime.c
+++ b/lib/mktime.c
@@ -77,7 +77,7 @@
#endif
#ifdef _LIBC
-typedef time_t mktime_offset_t;
+typedef long int mktime_offset_t;
#else
# include "mktime-internal.h"
#endif
diff --git a/lib/timegm.c b/lib/timegm.c
index 275a7a2ec..71276bbe0 100644
--- a/lib/timegm.c
+++ b/lib/timegm.c
@@ -24,7 +24,7 @@
#include <time.h>
#ifdef _LIBC
-typedef time_t mktime_offset_t;
+typedef long int mktime_offset_t;
#else
# include "mktime-internal.h"
#endif
--
2.17.1