diff options
| author | Stefan Monnier | 2010-12-10 19:13:08 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2010-12-10 19:13:08 -0500 |
| commit | 2c302df3a13236bfbf8ea1b771d13618fcda8d71 (patch) | |
| tree | f26dc9f22861dc37610de319d05255de058c221b /src/mktime.c | |
| parent | 0c747cb143fa227e78f350ac353d703f489209df (diff) | |
| parent | 175069efeb080517afefdd44a06f7a779ea8c25c (diff) | |
| download | emacs-2c302df3a13236bfbf8ea1b771d13618fcda8d71.tar.gz emacs-2c302df3a13236bfbf8ea1b771d13618fcda8d71.zip | |
Merge from trunk
Diffstat (limited to 'src/mktime.c')
| -rw-r--r-- | src/mktime.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/src/mktime.c b/src/mktime.c index 3570cecd451..ede151981f4 100644 --- a/src/mktime.c +++ b/src/mktime.c | |||
| @@ -110,9 +110,7 @@ const unsigned short int __mon_yday[2][13] = | |||
| 110 | localtime to localtime_r, since many localtime_r implementations | 110 | localtime to localtime_r, since many localtime_r implementations |
| 111 | are buggy. */ | 111 | are buggy. */ |
| 112 | static struct tm * | 112 | static struct tm * |
| 113 | my_mktime_localtime_r (t, tp) | 113 | my_mktime_localtime_r (const time_t *t, struct tm *tp) |
| 114 | const time_t *t; | ||
| 115 | struct tm *tp; | ||
| 116 | { | 114 | { |
| 117 | struct tm *l = localtime (t); | 115 | struct tm *l = localtime (t); |
| 118 | if (! l) | 116 | if (! l) |
| @@ -130,9 +128,7 @@ my_mktime_localtime_r (t, tp) | |||
| 130 | If TP is null, return a nonzero value. | 128 | If TP is null, return a nonzero value. |
| 131 | If overflow occurs, yield the low order bits of the correct answer. */ | 129 | If overflow occurs, yield the low order bits of the correct answer. */ |
| 132 | static time_t | 130 | static time_t |
| 133 | ydhms_tm_diff (year, yday, hour, min, sec, tp) | 131 | ydhms_tm_diff (int year, int yday, int hour, int min, int sec, const struct tm *tp) |
| 134 | int year, yday, hour, min, sec; | ||
| 135 | const struct tm *tp; | ||
| 136 | { | 132 | { |
| 137 | if (!tp) | 133 | if (!tp) |
| 138 | return 1; | 134 | return 1; |
| @@ -163,14 +159,8 @@ ydhms_tm_diff (year, yday, hour, min, sec, tp) | |||
| 163 | If *T is out of range for conversion, adjust it so that | 159 | If *T is out of range for conversion, adjust it so that |
| 164 | it is the nearest in-range value and then convert that. */ | 160 | it is the nearest in-range value and then convert that. */ |
| 165 | static struct tm * | 161 | static struct tm * |
| 166 | ranged_convert (convert, t, tp) | 162 | ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), |
| 167 | #ifdef PROTOTYPES | 163 | time_t *t, struct tm *tp) |
| 168 | struct tm *(*convert) (const time_t *, struct tm *); | ||
| 169 | #else | ||
| 170 | struct tm *(*convert)(); | ||
| 171 | #endif | ||
| 172 | time_t *t; | ||
| 173 | struct tm *tp; | ||
| 174 | { | 164 | { |
| 175 | struct tm *r; | 165 | struct tm *r; |
| 176 | 166 | ||
| @@ -217,14 +207,8 @@ ranged_convert (convert, t, tp) | |||
| 217 | compared to what the result would be for UTC without leap seconds. | 207 | compared to what the result would be for UTC without leap seconds. |
| 218 | If *OFFSET's guess is correct, only one CONVERT call is needed. */ | 208 | If *OFFSET's guess is correct, only one CONVERT call is needed. */ |
| 219 | time_t | 209 | time_t |
| 220 | __mktime_internal (tp, convert, offset) | 210 | __mktime_internal (struct tm *tp, struct tm *(*convert) (const time_t *, struct tm *), |
| 221 | struct tm *tp; | 211 | time_t *offset) |
| 222 | #ifdef PROTOTYPES | ||
| 223 | struct tm *(*convert) (const time_t *, struct tm *); | ||
| 224 | #else | ||
| 225 | struct tm *(*convert)(); | ||
| 226 | #endif | ||
| 227 | time_t *offset; | ||
| 228 | { | 212 | { |
| 229 | time_t t, dt, t0, t1, t2; | 213 | time_t t, dt, t0, t1, t2; |
| 230 | struct tm tm; | 214 | struct tm tm; |
| @@ -558,5 +542,3 @@ compile-command: "gcc -DDEBUG -DHAVE_LIMITS_H -DSTDC_HEADERS -Wall -W -O -g mkti | |||
| 558 | End: | 542 | End: |
| 559 | */ | 543 | */ |
| 560 | 544 | ||
| 561 | /* arch-tag: 9456752f-7ddd-47cb-8286-fa807b1355ae | ||
| 562 | (do not change this comment) */ | ||