1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-12-07 17:53:17 +00:00

64-bit architecture speedup

SCCS-file: localtime.c
SCCS-SID: 7.46
This commit is contained in:
Arthur David Olson
1995-10-18 16:36:05 -04:00
committed by Paul Eggert
parent a693f2a5b8
commit baf96a567d

View File

@ -1173,6 +1173,17 @@ register struct tm * const tmp;
if (tmp->tm_wday < 0)
tmp->tm_wday += DAYSPERWEEK;
y = EPOCH_YEAR;
#define CYCLE_DAYS 1022679L /* Any consecutive CYCLE_DAYS days... */
#define CYCLE_YEARS 2800L /* make up exactly CYCLE_YEARS years. */
if (days >= CYCLE_DAYS || days <= -CYCLE_DAYS) {
register int cycles;
cycles = (days >= 0) ?
(days / CYCLE_DAYS) :
(-1 - (-1 - days) / CYCLE_DAYS);
days -= cycles * CYCLE_DAYS;
y += cycles * CYCLE_YEARS;
}
if (days >= 0)
for ( ; ; ) {
yleap = isleap(y);