diff options
Diffstat (limited to 'lib/libc/stdtime/localtime.c')
-rw-r--r-- | lib/libc/stdtime/localtime.c | 146 |
1 files changed, 73 insertions, 73 deletions
diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c index eaee232..28a7b68 100644 --- a/lib/libc/stdtime/localtime.c +++ b/lib/libc/stdtime/localtime.c @@ -207,8 +207,8 @@ static long detzcode(codep) const char * const codep; { - register long result; - register int i; + long result; + int i; result = (codep[0] & 0x80) ? ~0L : 0L; for (i = 0; i < 4; ++i) @@ -219,8 +219,8 @@ const char * const codep; static void settzname P((void)) { - register struct state * sp = lclptr; - register int i; + struct state * sp = lclptr; + int i; tzname[0] = wildabbr; tzname[1] = wildabbr; @@ -238,7 +238,7 @@ settzname P((void)) } #endif /* defined ALL_STATE */ for (i = 0; i < sp->typecnt; ++i) { - register const struct ttinfo * const ttisp = &sp->ttis[i]; + const struct ttinfo * const ttisp = &sp->ttis[i]; tzname[ttisp->tt_isdst] = &sp->chars[ttisp->tt_abbrind]; @@ -257,7 +257,7 @@ settzname P((void)) ** And to get the latest zone names into tzname. . . */ for (i = 0; i < sp->timecnt; ++i) { - register const struct ttinfo * const ttisp = + const struct ttinfo * const ttisp = &sp->ttis[ sp->types[i]]; @@ -268,12 +268,12 @@ settzname P((void)) static int tzload(name, sp) -register const char * name; -register struct state * const sp; +const char * name; +struct state * const sp; { - register const char * p; - register int i; - register int fid; + const char * p; + int i; + int fid; /* XXX The following is from OpenBSD, and I'm not sure it is correct */ if (name != NULL && issetugid() != 0) @@ -283,7 +283,7 @@ register struct state * const sp; if (name == NULL && (name = TZDEFAULT) == NULL) return -1; { - register int doaccess; + int doaccess; struct stat stab; /* ** Section 4.9.1 of the C standard says that @@ -367,7 +367,7 @@ register struct state * const sp; return -1; } for (i = 0; i < sp->typecnt; ++i) { - register struct ttinfo * ttisp; + struct ttinfo * ttisp; ttisp = &sp->ttis[i]; ttisp->tt_gmtoff = detzcode(p); @@ -384,7 +384,7 @@ register struct state * const sp; sp->chars[i] = *p++; sp->chars[i] = '\0'; /* ensure '\0' at end */ for (i = 0; i < sp->leapcnt; ++i) { - register struct lsinfo * lsisp; + struct lsinfo * lsisp; lsisp = &sp->lsis[i]; lsisp->ls_trans = detzcode(p); @@ -393,7 +393,7 @@ register struct state * const sp; p += 4; } for (i = 0; i < sp->typecnt; ++i) { - register struct ttinfo * ttisp; + struct ttinfo * ttisp; ttisp = &sp->ttis[i]; if (ttisstdcnt == 0) @@ -406,7 +406,7 @@ register struct state * const sp; } } for (i = 0; i < sp->typecnt; ++i) { - register struct ttinfo * ttisp; + struct ttinfo * ttisp; ttisp = &sp->ttis[i]; if (ttisgmtcnt == 0) @@ -439,9 +439,9 @@ static const int year_lengths[2] = { static const char * getzname(strp) -register const char * strp; +const char * strp; { - register char c; + char c; while ((c = *strp) != '\0' && !is_digit(c) && c != ',' && c != '-' && c != '+') @@ -458,13 +458,13 @@ register const char * strp; static const char * getnum(strp, nump, min, max) -register const char * strp; +const char * strp; int * const nump; const int min; const int max; { - register char c; - register int num; + char c; + int num; if (strp == NULL || !is_digit(c = *strp)) return NULL; @@ -491,7 +491,7 @@ const int max; static const char * getsecs(strp, secsp) -register const char * strp; +const char * strp; long * const secsp; { int num; @@ -533,10 +533,10 @@ long * const secsp; static const char * getoffset(strp, offsetp) -register const char * strp; +const char * strp; long * const offsetp; { - register int neg = 0; + int neg = 0; if (*strp == '-') { neg = 1; @@ -561,7 +561,7 @@ long * const offsetp; static const char * getrule(strp, rulep) const char * strp; -register struct rule * const rulep; +struct rule * const rulep; { if (*strp == 'J') { /* @@ -616,12 +616,12 @@ static time_t transtime(janfirst, year, rulep, offset) const time_t janfirst; const int year; -register const struct rule * const rulep; +const struct rule * const rulep; const long offset; { - register int leapyear; - register time_t value; - register int i; + int leapyear; + time_t value; + int i; int d, m1, yy0, yy1, yy2, dow; INITIALIZE(value); @@ -710,7 +710,7 @@ const long offset; static int tzparse(name, sp, lastditch) const char * name; -register struct state * const sp; +struct state * const sp; const int lastditch; { const char * stdname; @@ -719,10 +719,10 @@ const int lastditch; size_t dstlen; long stdoffset; long dstoffset; - register time_t * atp; - register unsigned char * typep; - register char * cp; - register int load_result; + time_t * atp; + unsigned char * typep; + char * cp; + int load_result; INITIALIZE(dstname); stdname = name; @@ -762,8 +762,8 @@ const int lastditch; if (*name == ',' || *name == ';') { struct rule start; struct rule end; - register int year; - register time_t janfirst; + int year; + time_t janfirst; time_t starttime; time_t endtime; @@ -812,12 +812,12 @@ const int lastditch; SECSPERDAY; } } else { - register long theirstdoffset; - register long theirdstoffset; - register long theiroffset; - register int isdst; - register int i; - register int j; + long theirstdoffset; + long theirdstoffset; + long theiroffset; + int isdst; + int i; + int j; if (*name != '\0') return -1; @@ -961,7 +961,7 @@ tzsetwall P((void)) static void tzset_basic(void) { - register const char * name; + const char * name; name = getenv("TZ"); if (name == NULL) { @@ -1023,9 +1023,9 @@ const time_t * const timep; const long offset; struct tm * const tmp; { - register struct state * sp; - register const struct ttinfo * ttisp; - register int i; + struct state * sp; + const struct ttinfo * ttisp; + int i; const time_t t = *timep; sp = lclptr; @@ -1214,18 +1214,18 @@ static void timesub(timep, offset, sp, tmp) const time_t * const timep; const long offset; -register const struct state * const sp; -register struct tm * const tmp; +const struct state * const sp; +struct tm * const tmp; { - register const struct lsinfo * lp; - register long days; - register long rem; - register int y; - register int yleap; - register const int * ip; - register long corr; - register int hit; - register int i; + const struct lsinfo * lp; + long days; + long rem; + int y; + int yleap; + const int * ip; + long corr; + int hit; + int i; corr = 0; hit = 0; @@ -1289,7 +1289,7 @@ register struct tm * const tmp; y = EPOCH_YEAR; #define LEAPS_THRU_END_OF(y) ((y) / 4 - (y) / 100 + (y) / 400) while (days < 0 || days >= (long) year_lengths[yleap = isleap(y)]) { - register int newy; + int newy; newy = y + days / DAYSPERNYEAR; if (days < 0) @@ -1369,7 +1369,7 @@ int * const tensptr; int * const unitsptr; const int base; { - register int tensdelta; + int tensdelta; tensdelta = (*unitsptr >= 0) ? (*unitsptr / base) : @@ -1380,10 +1380,10 @@ const int base; static int tmcomp(atmp, btmp) -register const struct tm * const atmp; -register const struct tm * const btmp; +const struct tm * const atmp; +const struct tm * const btmp; { - register int result; + int result; if ((result = (atmp->tm_year - btmp->tm_year)) == 0 && (result = (atmp->tm_mon - btmp->tm_mon)) == 0 && @@ -1401,11 +1401,11 @@ void (* const funcp) P((const time_t*, long, struct tm*)); const long offset; int * const okayp; { - register const struct state * sp; - register int dir; - register int bits; - register int i, j ; - register int saved_seconds; + const struct state * sp; + int dir; + int bits; + int i, j ; + int saved_seconds; time_t newt; time_t t; struct tm yourtm, mytm; @@ -1548,9 +1548,9 @@ struct tm * const tmp; void (* const funcp) P((const time_t *, long, struct tm *)); const long offset; { - register time_t t; - register const struct state * sp; - register int samei, otheri; + time_t t; + const struct state * sp; + int samei, otheri; int okay; if (tmp->tm_isdst > 1) @@ -1683,9 +1683,9 @@ static long leapcorr(timep) time_t * timep; { - register struct state * sp; - register struct lsinfo * lp; - register int i; + struct state * sp; + struct lsinfo * lp; + int i; sp = lclptr; i = sp->leapcnt; |