mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2025-12-07 19:01:29 +00:00
delinted
SCCS-file: localtime.c SCCS-SID: 2.29
This commit is contained in:
committed by
Paul Eggert
parent
ad6619e649
commit
06496370da
34
localtime.c
34
localtime.c
@ -129,9 +129,19 @@ register char * name;
|
||||
i = read(fid, buf, sizeof buf);
|
||||
if (close(fid) != 0 || i < sizeof *tzhp)
|
||||
return -1;
|
||||
/*###132 [lint] warning possible pointer alignment problem%%%*/
|
||||
/*###132 [lint] warning illegal pointer combination%%%*/
|
||||
/*###132 [lint] warning illegal pointer combination%%%*/
|
||||
/*###132 [lint] warning possible pointer alignment problem%%%*/
|
||||
tzhp = (struct tzhead *) buf;
|
||||
/*###133 [lint] warning long assignment may lose accuracy%%%*/
|
||||
/*###133 [lint] warning long assignment may lose accuracy%%%*/
|
||||
s.timecnt = (int) detzcode(tzhp->tzh_timecnt);
|
||||
/*###134 [lint] warning long assignment may lose accuracy%%%*/
|
||||
/*###134 [lint] warning long assignment may lose accuracy%%%*/
|
||||
s.typecnt = (int) detzcode(tzhp->tzh_typecnt);
|
||||
/*###135 [lint] warning long assignment may lose accuracy%%%*/
|
||||
/*###135 [lint] warning long assignment may lose accuracy%%%*/
|
||||
s.charcnt = (int) detzcode(tzhp->tzh_charcnt);
|
||||
if (s.timecnt > TZ_MAX_TIMES ||
|
||||
s.typecnt == 0 ||
|
||||
@ -270,7 +280,7 @@ time_t * timep;
|
||||
*/
|
||||
tmp = offtime((time_t) (t + ttisp->tt_gmtoff), 0L);
|
||||
#else /* !USG_COMPAT */
|
||||
tmp = offtime(t, ttisp->tt_gmtoff);
|
||||
tmp = offtime(&t, ttisp->tt_gmtoff);
|
||||
#endif /* !USG_COMPAT */
|
||||
tmp->tm_isdst = ttisp->tt_isdst;
|
||||
tzname[tmp->tm_isdst] = &s.chars[ttisp->tt_abbrind];
|
||||
@ -345,10 +355,18 @@ long offset;
|
||||
rem -= SECS_PER_DAY;
|
||||
++days;
|
||||
}
|
||||
/*###348 [lint] warning long assignment may lose accuracy%%%*/
|
||||
/*###348 [lint] warning long assignment may lose accuracy%%%*/
|
||||
tmp->tm_hour = (int) (rem / SECS_PER_HOUR);
|
||||
rem = rem % SECS_PER_HOUR;
|
||||
/*###350 [lint] warning long assignment may lose accuracy%%%*/
|
||||
/*###350 [lint] warning long assignment may lose accuracy%%%*/
|
||||
tmp->tm_min = (int) (rem / SECS_PER_MIN);
|
||||
/*###351 [lint] warning long assignment may lose accuracy%%%*/
|
||||
/*###351 [lint] warning long assignment may lose accuracy%%%*/
|
||||
tmp->tm_sec = (int) (rem % SECS_PER_MIN);
|
||||
/*###352 [lint] warning long assignment may lose accuracy%%%*/
|
||||
/*###352 [lint] warning long assignment may lose accuracy%%%*/
|
||||
tmp->tm_wday = (int) ((EPOCH_WDAY + days) % DAYS_PER_WEEK);
|
||||
if (tmp->tm_wday < 0)
|
||||
tmp->tm_wday += DAYS_PER_WEEK;
|
||||
@ -356,21 +374,35 @@ long offset;
|
||||
if (days >= 0)
|
||||
for ( ; ; ) {
|
||||
yleap = isleap(y);
|
||||
/*###359 [lint] warning assignment to long may sign-extend incorrectly%%%*/
|
||||
/*###359 [lint] warning assignment to long may sign-extend incorrectly%%%*/
|
||||
if (days < (long) year_lengths[yleap])
|
||||
break;
|
||||
++y;
|
||||
/*###362 [lint] warning assignment to long may sign-extend incorrectly%%%*/
|
||||
/*###362 [lint] warning assignment to long may sign-extend incorrectly%%%*/
|
||||
days = days - (long) year_lengths[yleap];
|
||||
}
|
||||
else do {
|
||||
--y;
|
||||
yleap = isleap(y);
|
||||
/*###367 [lint] warning assignment to long may sign-extend incorrectly%%%*/
|
||||
/*###367 [lint] warning assignment to long may sign-extend incorrectly%%%*/
|
||||
days = days + (long) year_lengths[yleap];
|
||||
} while (days < 0);
|
||||
tmp->tm_year = y - TM_YEAR_BASE;
|
||||
/*###370 [lint] warning long assignment may lose accuracy%%%*/
|
||||
/*###370 [lint] warning long assignment may lose accuracy%%%*/
|
||||
tmp->tm_yday = (int) days;
|
||||
ip = mon_lengths[yleap];
|
||||
/*###372 [lint] warning assignment to long may sign-extend incorrectly%%%*/
|
||||
/*###372 [lint] warning assignment to long may sign-extend incorrectly%%%*/
|
||||
for (tmp->tm_mon = 0; days >= (long) ip[tmp->tm_mon]; ++(tmp->tm_mon))
|
||||
/*###373 [lint] warning assignment to long may sign-extend incorrectly%%%*/
|
||||
/*###373 [lint] warning assignment to long may sign-extend incorrectly%%%*/
|
||||
days = days - (long) ip[tmp->tm_mon];
|
||||
/*###374 [lint] warning long assignment may lose accuracy%%%*/
|
||||
/*###374 [lint] warning long assignment may lose accuracy%%%*/
|
||||
tmp->tm_mday = (int) (days + 1);
|
||||
tmp->tm_isdst = 0;
|
||||
#ifdef KRE_COMPAT
|
||||
|
||||
Reference in New Issue
Block a user