Permalink
Browse files

Restore 'register'.

* asctime.c (asctime_r, asctime):
* date.c (main, dogmt, reset, nondigit, sametm, convert, checkfinal):
* ialloc.c (icatalloc):
* localtime.c (detzcode, detzcode64, settzname, tzload)
(typesequiv, getzname, getqzname, getnum, getsecs, getoffset)
(getrule, transtime, tzparse, tzset, localsub, gmtsub)
(leaps_thru_end_of, timesub, increment_overflow)
(long_increment_overflow, normalize_overflow)
(long_normalize_overflow, tmcomp, time2sub, time1, leapcorr):
* scheck.c (scheck):
* strftime.c (_yconv):
* zdump.c (my_localtime, abbrok, main, yeartot, hunt)
(delta, show, abbr, dumptime):
* zic.c (main, dolink, itsdir, associate, infile, inrule)
(inzone, inzcont, inzsub, inleap, inlink, rulesub, convert64)
(writezone, doabbr, stringoffset, stringrule, stringzone)
(outzone, addtype, leapadd, adjleap, ciequal, itsabbr, byword)
(getfields, rpytime, newabbr, mkdirs):
Restore the uses of 'register', reverting that part of the
"More C modernization" patch.  See Arthur David Olson in
<http://mm.icann.org/pipermail/tz/2012-October/018385.html>.
  • Loading branch information...
1 parent ff07530 commit 2151ca6b20ef7941d5ca6e9523a0ba0aa6eb13e5 @eggert committed Oct 27, 2012
Showing with 337 additions and 335 deletions.
  1. +4 −4 asctime.c
  2. +28 −27 date.c
  3. +2 −2 ialloc.c
  4. +127 −126 localtime.c
  5. +6 −6 scheck.c
  6. +2 −2 strftime.c
  7. +41 −41 zdump.c
  8. +127 −127 zic.c
View
@@ -69,7 +69,7 @@ static char buf_asctime[MAX_ASCTIME_BUF_SIZE];
*/
char *
-asctime_r(const struct tm *timeptr, char *buf)
+asctime_r(register const struct tm *timeptr, char *buf)
{
static const char wday_name[][3] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
@@ -78,8 +78,8 @@ asctime_r(const struct tm *timeptr, char *buf)
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
- const char *wn;
- const char *mn;
+ register const char * wn;
+ register const char * mn;
char year[INT_STRLEN_MAXIMUM(int) + 2];
char result[MAX_ASCTIME_BUF_SIZE];
@@ -126,7 +126,7 @@ asctime_r(const struct tm *timeptr, char *buf)
*/
char *
-asctime(const struct tm *timeptr)
+asctime(register const struct tm *timeptr)
{
return asctime_r(timeptr, buf_asctime);
}
View
55 date.c
@@ -85,20 +85,20 @@ static void wildinput(const char *, const char *,
int
main(const int argc, char *argv[])
{
- const char * format;
- const char * value;
- const char * cp;
- int ch;
- int dousg;
- int aflag = 0;
- int dflag = 0;
- int nflag = 0;
- int tflag = 0;
- int minuteswest;
- int dsttime;
- double adjust;
- time_t now;
- time_t t;
+ register const char * format;
+ register const char * value;
+ register const char * cp;
+ register int ch;
+ register int dousg;
+ register int aflag = 0;
+ register int dflag = 0;
+ register int nflag = 0;
+ register int tflag = 0;
+ register int minuteswest;
+ register int dsttime;
+ register double adjust;
+ time_t now;
+ time_t t;
INITIALIZE(dousg);
INITIALIZE(minuteswest);
@@ -305,9 +305,9 @@ dogmt(void)
static char ** fakeenv;
if (fakeenv == NULL) {
- int from;
- int to;
- int n;
+ register int from;
+ register int to;
+ register int n;
static char tzegmt0[] = "TZ=GMT0";
for (n = 0; environ[n] != NULL; ++n)
@@ -343,7 +343,7 @@ dogmt(void)
static void
reset(const time_t newt, const int nflag)
{
- int fid;
+ register int fid;
time_t oldt;
static struct {
struct utmp before;
@@ -449,7 +449,7 @@ static int netsettime(struct timeval);
static void
reset(const time_t newt, const int nflag)
{
- const char * username;
+ register const char * username;
static struct timeval tv; /* static so tv_usec is 0 */
#ifdef EBUG
@@ -495,7 +495,7 @@ errensure(void)
}
static const char *
-nondigit(const char *cp)
+nondigit(register const char *cp)
{
while (is_digit(*cp))
++cp;
@@ -577,7 +577,8 @@ timeout(FILE *const fp, const char *const format, const struct tm *const tmp)
}
static int
-sametm(const struct tm *const atmp, const struct tm *const btmp)
+sametm(register const struct tm *const atmp,
+ register const struct tm *const btmp)
{
return atmp->tm_year == btmp->tm_year &&
atmp->tm_mon == btmp->tm_mon &&
@@ -595,11 +596,11 @@ sametm(const struct tm *const atmp, const struct tm *const btmp)
#define ATOI2(ar) (ar[0] - '0') * 10 + (ar[1] - '0'); ar += 2;
static time_t
-convert(const char * const value, const int dousg, const time_t t)
+convert(register const char * const value, const int dousg, const time_t t)
{
- const char * cp;
- const char * dotp;
- int cent, year_in_cent, month, hour, day, mins, secs;
+ register const char * cp;
+ register const char * dotp;
+ register int cent, year_in_cent, month, hour, day, mins, secs;
struct tm tm, outtm;
time_t outt;
@@ -707,8 +708,8 @@ checkfinal(const char * const value,
time_t othert;
struct tm tm;
struct tm othertm;
- int pass;
- long offset;
+ register int pass;
+ register long offset;
/*
** See if there's both a USG and a BSD interpretation.
View
@@ -10,8 +10,8 @@
char *
icatalloc(char *const old, const char *const new)
{
- char * result;
- int oldsize, newsize;
+ register char * result;
+ register int oldsize, newsize;
newsize = (new == NULL) ? 0 : strlen(new);
if (old == NULL)
Oops, something went wrong.

0 comments on commit 2151ca6

Please sign in to comment.