2007-02-15 18:09:44 +01:00
|
|
|
--- mktime.c
|
|
|
|
+++ mktime.c
|
2007-01-15 23:50:49 +01:00
|
|
|
@@ -124,9 +124,7 @@
|
|
|
|
#define localtime_r my_localtime_r
|
|
|
|
static struct tm *localtime_r __P ((const time_t *, struct tm *));
|
|
|
|
static struct tm *
|
|
|
|
-localtime_r (t, tp)
|
|
|
|
- const time_t *t;
|
|
|
|
- struct tm *tp;
|
|
|
|
+localtime_r ( const time_t * t, struct tm * tp)
|
|
|
|
{
|
|
|
|
struct tm *l = localtime (t);
|
|
|
|
if (! l)
|
|
|
|
@@ -144,9 +142,7 @@
|
|
|
|
All values are in range, except possibly YEAR.
|
|
|
|
If overflow occurs, yield the low order bits of the correct answer. */
|
|
|
|
static time_t
|
|
|
|
-ydhms_tm_diff (year, yday, hour, min, sec, tp)
|
|
|
|
- int year, yday, hour, min, sec;
|
|
|
|
- const struct tm *tp;
|
|
|
|
+ydhms_tm_diff (int year, int yday, int hour, int min, int sec, const struct tm *tp)
|
|
|
|
{
|
|
|
|
/* Compute intervening leap days correctly even if year is negative.
|
|
|
|
Take care to avoid int overflow. time_t overflow is OK, since
|
|
|
|
@@ -173,8 +169,7 @@
|
2007-02-15 18:09:44 +01:00
|
|
|
|
2007-01-15 23:50:49 +01:00
|
|
|
/* Convert *TP to a time_t value. */
|
|
|
|
time_t
|
|
|
|
-mktime (tp)
|
|
|
|
- struct tm *tp;
|
|
|
|
+mktime (struct tm *tp)
|
|
|
|
{
|
|
|
|
#ifdef _LIBC
|
|
|
|
/* POSIX.1 8.1.1 requires that whenever mktime() is called, the
|
|
|
|
@@ -192,10 +187,7 @@
|
|
|
|
compared to what the result would be for UTC without leap seconds.
|
|
|
|
If *OFFSET's guess is correct, only one CONVERT call is needed. */
|
|
|
|
time_t
|
|
|
|
-__mktime_internal (tp, convert, offset)
|
|
|
|
- struct tm *tp;
|
|
|
|
- struct tm *(*convert) __P ((const time_t *, struct tm *));
|
|
|
|
- time_t *offset;
|
|
|
|
+__mktime_internal (struct tm *tp, struct tm *(*convert) (const time_t *, struct tm *), time_t *offset)
|
|
|
|
{
|
|
|
|
time_t t, dt, t0;
|
|
|
|
struct tm tm;
|