Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0b62bbe

Browse files
author
Neil Conway
committed
Cosmetic improvements to the timezone code: remove the use of the
'register' qualifier, make some function declarations more consistent,and so on.
1 parentec490f5 commit0b62bbe

File tree

6 files changed

+200
-201
lines changed

6 files changed

+200
-201
lines changed

‎src/timezone/ialloc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
44
*
55
* IDENTIFICATION
6-
* $PostgreSQL: pgsql/src/timezone/ialloc.c,v 1.5 2004/05/21 20:59:10 tgl Exp $
6+
* $PostgreSQL: pgsql/src/timezone/ialloc.c,v 1.6 2005/06/20 08:00:51 neilc Exp $
77
*/
88

99
#include"postgres.h"
@@ -38,9 +38,9 @@ irealloc(void *pointer, const int size)
3838
char*
3939
icatalloc(char*old,constchar*new)
4040
{
41-
registerchar*result;
42-
registerintoldsize,
43-
newsize;
41+
char*result;
42+
intoldsize,
43+
newsize;
4444

4545
newsize= (new==NULL) ?0 :strlen(new);
4646
if (old==NULL)

‎src/timezone/localtime.c

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
44
*
55
* IDENTIFICATION
6-
* $PostgreSQL: pgsql/src/timezone/localtime.c,v 1.10 2005/04/19 03:13:59 momjian Exp $
6+
* $PostgreSQL: pgsql/src/timezone/localtime.c,v 1.11 2005/06/20 08:00:51 neilc Exp $
77
*/
88

99
/*
@@ -81,15 +81,15 @@ static const char *getzname(const char *strp);
8181
staticconstchar*getnum(constchar*strp,int*nump,intmin,intmax);
8282
staticconstchar*getsecs(constchar*strp,long*secsp);
8383
staticconstchar*getoffset(constchar*strp,long*offsetp);
84-
staticconstchar*getrule(constchar*strp,structrule*rulep);
85-
staticvoidgmtload(structstate*sp);
86-
staticvoidgmtsub(constpg_time_t*timep,longoffset,structpg_tm*tmp);
87-
staticvoidlocalsub(constpg_time_t*timep,longoffset,structpg_tm*tmp,constpg_tz*tz);
84+
staticconstchar*getrule(constchar*strp,structrule*rulep);
85+
staticvoidgmtload(structstate*sp);
86+
staticvoidgmtsub(constpg_time_t*timep,longoffset,structpg_tm*tmp);
87+
staticvoidlocalsub(constpg_time_t*timep,longoffset,structpg_tm*tmp,constpg_tz*tz);
8888
staticvoidtimesub(constpg_time_t*timep,longoffset,
89-
conststructstate*sp,structpg_tm*tmp);
89+
conststructstate*sp,structpg_tm*tmp);
9090
staticpg_time_ttranstime(pg_time_tjanfirst,intyear,
91-
conststructrule*rulep,longoffset);
92-
inttzparse(constchar*name,structstate*sp,intlastditch);
91+
conststructrule*rulep,longoffset);
92+
inttzparse(constchar*name,structstate*sp,intlastditch);
9393

9494
/* GMT timezone */
9595
staticstructstategmtmem;
@@ -113,8 +113,8 @@ static struct pg_tm tm;
113113
staticlong
114114
detzcode(constchar*codep)
115115
{
116-
registerlongresult;
117-
registerinti;
116+
longresult;
117+
inti;
118118

119119
result= (codep[0]&0x80) ? ~0L :0L;
120120
for (i=0;i<4;++i)
@@ -123,16 +123,16 @@ detzcode(const char *codep)
123123
}
124124

125125
int
126-
tzload(registerconstchar*name,registerstructstate*sp)
126+
tzload(constchar*name,structstate*sp)
127127
{
128-
registerconstchar*p;
129-
registerinti;
130-
registerintfid;
128+
constchar*p;
129+
inti;
130+
intfid;
131131

132132
if (name==NULL&& (name=TZDEFAULT)==NULL)
133133
return-1;
134134
{
135-
registerintdoaccess;
135+
intdoaccess;
136136
charfullname[MAXPGPATH];
137137

138138
if (name[0]==':')
@@ -209,7 +209,7 @@ tzload(register const char *name, register struct state * sp)
209209
}
210210
for (i=0;i<sp->typecnt;++i)
211211
{
212-
registerstructttinfo*ttisp;
212+
structttinfo*ttisp;
213213

214214
ttisp=&sp->ttis[i];
215215
ttisp->tt_gmtoff=detzcode(p);
@@ -227,7 +227,7 @@ tzload(register const char *name, register struct state * sp)
227227
sp->chars[i]='\0';/* ensure '\0' at end */
228228
for (i=0;i<sp->leapcnt;++i)
229229
{
230-
registerstructlsinfo*lsisp;
230+
structlsinfo*lsisp;
231231

232232
lsisp=&sp->lsis[i];
233233
lsisp->ls_trans=detzcode(p);
@@ -237,7 +237,7 @@ tzload(register const char *name, register struct state * sp)
237237
}
238238
for (i=0;i<sp->typecnt;++i)
239239
{
240-
registerstructttinfo*ttisp;
240+
structttinfo*ttisp;
241241

242242
ttisp=&sp->ttis[i];
243243
if (ttisstdcnt==0)
@@ -252,7 +252,7 @@ tzload(register const char *name, register struct state * sp)
252252
}
253253
for (i=0;i<sp->typecnt;++i)
254254
{
255-
registerstructttinfo*ttisp;
255+
structttinfo*ttisp;
256256

257257
ttisp=&sp->ttis[i];
258258
if (ttisgmtcnt==0)
@@ -284,9 +284,9 @@ static const int year_lengths[2] = {
284284
* character.
285285
*/
286286
staticconstchar*
287-
getzname(registerconstchar*strp)
287+
getzname(constchar*strp)
288288
{
289-
registercharc;
289+
charc;
290290

291291
while ((c=*strp)!='\0'&& !is_digit(c)&&c!=','&&c!='-'&&
292292
c!='+')
@@ -301,10 +301,10 @@ getzname(register const char *strp)
301301
* Otherwise, return a pointer to the first character not part of the number.
302302
*/
303303
staticconstchar*
304-
getnum(registerconstchar*strp,int*nump,constintmin,constintmax)
304+
getnum(constchar*strp,int*nump,intmin,intmax)
305305
{
306-
registercharc;
307-
registerintnum;
306+
charc;
307+
intnum;
308308

309309
if (strp==NULL|| !is_digit(c=*strp))
310310
returnNULL;
@@ -330,7 +330,7 @@ getnum(register const char *strp, int *nump, const int min, const int max)
330330
* of seconds.
331331
*/
332332
staticconstchar*
333-
getsecs(registerconstchar*strp,long*secsp)
333+
getsecs(constchar*strp,long*secsp)
334334
{
335335
intnum;
336336

@@ -370,9 +370,9 @@ getsecs(register const char *strp, long *secsp)
370370
* Otherwise, return a pointer to the first character not part of the time.
371371
*/
372372
staticconstchar*
373-
getoffset(registerconstchar*strp,long*offsetp)
373+
getoffset(constchar*strp,long*offsetp)
374374
{
375-
registerintneg=0;
375+
intneg=0;
376376

377377
if (*strp=='-')
378378
{
@@ -396,7 +396,7 @@ getoffset(register const char *strp, long *offsetp)
396396
* Otherwise, return a pointer to the first character not part of the rule.
397397
*/
398398
staticconstchar*
399-
getrule(constchar*strp,registerstructrule*rulep)
399+
getrule(constchar*strp,structrule*rulep)
400400
{
401401
if (*strp=='J')
402402
{
@@ -457,13 +457,13 @@ getrule(const char *strp, register struct rule * rulep)
457457
* calculate the Epoch-relative time that rule takes effect.
458458
*/
459459
staticpg_time_t
460-
transtime(constpg_time_tjanfirst,constintyear,
461-
registerconststructrule*rulep,constlongoffset)
460+
transtime(constpg_time_tjanfirst,intyear,
461+
conststructrule*rulep,longoffset)
462462
{
463-
registerintleapyear;
464-
registerpg_time_tvalue=0;
465-
registerinti;
466-
intd,
463+
intleapyear;
464+
pg_time_tvalue=0;
465+
inti,
466+
d,
467467
m1,
468468
yy0,
469469
yy1,
@@ -556,18 +556,18 @@ transtime(const pg_time_t janfirst, const int year,
556556
*/
557557

558558
int
559-
tzparse(constchar*name,registerstructstate*sp,constintlastditch)
559+
tzparse(constchar*name,structstate*sp,intlastditch)
560560
{
561561
constchar*stdname;
562562
constchar*dstname=NULL;
563563
size_tstdlen;
564564
size_tdstlen;
565565
longstdoffset;
566566
longdstoffset;
567-
registerpg_time_t*atp;
568-
registerunsignedchar*typep;
569-
registerchar*cp;
570-
registerintload_result;
567+
pg_time_t*atp;
568+
unsignedchar*typep;
569+
char*cp;
570+
intload_result;
571571

572572
stdname=name;
573573
if (lastditch)
@@ -614,8 +614,8 @@ tzparse(const char *name, register struct state * sp, const int lastditch)
614614
{
615615
structrulestart;
616616
structruleend;
617-
registerintyear;
618-
registerpg_time_tjanfirst;
617+
intyear;
618+
pg_time_tjanfirst;
619619
pg_time_tstarttime;
620620
pg_time_tendtime;
621621

@@ -671,12 +671,12 @@ tzparse(const char *name, register struct state * sp, const int lastditch)
671671
}
672672
else
673673
{
674-
registerlongtheirstdoffset;
675-
registerlongtheirdstoffset;
676-
registerlongtheiroffset;
677-
registerintisdst;
678-
registerinti;
679-
registerintj;
674+
longtheirstdoffset;
675+
longtheirdstoffset;
676+
longtheiroffset;
677+
intisdst;
678+
inti;
679+
intj;
680680

681681
if (*name!='\0')
682682
return-1;
@@ -798,7 +798,7 @@ tzparse(const char *name, register struct state * sp, const int lastditch)
798798
}
799799

800800
staticvoid
801-
gmtload(structstate*sp)
801+
gmtload(structstate*sp)
802802
{
803803
if (tzload(gmt,sp)!=0)
804804
(void)tzparse(gmt,sp, TRUE);
@@ -814,11 +814,11 @@ gmtload(struct state * sp)
814814
* The unused offset argument is for the benefit of mktime variants.
815815
*/
816816
staticvoid
817-
localsub(constpg_time_t*timep,constlongoffset,structpg_tm*tmp,constpg_tz*tz)
817+
localsub(constpg_time_t*timep,longoffset,structpg_tm*tmp,constpg_tz*tz)
818818
{
819-
registerconststructstate*sp;
820-
registerconststructttinfo*ttisp;
821-
registerinti;
819+
conststructstate*sp;
820+
conststructttinfo*ttisp;
821+
inti;
822822
constpg_time_tt=*timep;
823823

824824
sp=&tz->state;
@@ -859,7 +859,7 @@ pg_localtime(const pg_time_t *timep, const pg_tz *tz)
859859
* gmtsub is to gmtime as localsub is to localtime.
860860
*/
861861
staticvoid
862-
gmtsub(constpg_time_t*timep,constlongoffset,structpg_tm*tmp)
862+
gmtsub(constpg_time_t*timep,longoffset,structpg_tm*tmp)
863863
{
864864
if (!gmt_is_set)
865865
{
@@ -888,21 +888,21 @@ pg_gmtime(const pg_time_t *timep)
888888

889889

890890
staticvoid
891-
timesub(constpg_time_t*timep,constlongoffset,
892-
registerconststructstate*sp,registerstructpg_tm*tmp)
891+
timesub(constpg_time_t*timep,longoffset,
892+
conststructstate*sp,structpg_tm*tmp)
893893
{
894-
registerconststructlsinfo*lp;
894+
conststructlsinfo*lp;
895895

896896
/* expand days to 64 bits to support full Julian-day range */
897-
registerint64days;
898-
registerintidays;
899-
registerlongrem;
900-
registerinty;
901-
registerintyleap;
902-
registerconstint*ip;
903-
registerlongcorr;
904-
registerinthit;
905-
registerinti;
897+
int64days;
898+
intidays;
899+
longrem;
900+
inty;
901+
intyleap;
902+
constint*ip;
903+
longcorr;
904+
inthit;
905+
inti;
906906

907907
corr=0;
908908
hit=0;
@@ -979,7 +979,7 @@ timesub(const pg_time_t *timep, const long offset,
979979
#defineLEAPS_THRU_END_OF(y)(((y) + 4800) / 4 - ((y) + 4800) / 100 + ((y) + 4800) / 400)
980980
while (days<0||days >= (int64)year_lengths[yleap=isleap(y)])
981981
{
982-
registerintnewy;
982+
intnewy;
983983

984984
newy=y+days /DAYSPERNYEAR;
985985
if (days<0)
@@ -1029,8 +1029,8 @@ pg_next_dst_boundary(const pg_time_t *timep,
10291029
int*after_isdst,
10301030
constpg_tz*tz)
10311031
{
1032-
registerconststructstate*sp;
1033-
registerconststructttinfo*ttisp;
1032+
conststructstate*sp;
1033+
conststructttinfo*ttisp;
10341034
inti;
10351035
intj;
10361036
constpg_time_tt=*timep;

‎src/timezone/pgtz.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.34 2005/06/19 21:34:03 tgl Exp $
9+
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.35 2005/06/20 08:00:51 neilc Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -97,7 +97,7 @@ static void scan_available_timezones(char *tzdir, char *tzdirsub,
9797
* Get GMT offset from a system struct tm
9898
*/
9999
staticint
100-
get_timezone_offset(structtm*tm)
100+
get_timezone_offset(structtm*tm)
101101
{
102102
#if defined(HAVE_STRUCT_TM_TM_ZONE)
103103
returntm->tm_gmtoff;
@@ -128,7 +128,7 @@ build_time_t(int year, int month, int day)
128128
* Does a system tm value match one we computed ourselves?
129129
*/
130130
staticbool
131-
compare_tm(structtm*s,structpg_tm*p)
131+
compare_tm(structtm*s,structpg_tm*p)
132132
{
133133
if (s->tm_sec!=p->tm_sec||
134134
s->tm_min!=p->tm_min||
@@ -155,7 +155,7 @@ compare_tm(struct tm * s, struct pg_tm * p)
155155
* test time.
156156
*/
157157
staticint
158-
score_timezone(constchar*tzname,structtztry*tt)
158+
score_timezone(constchar*tzname,structtztry*tt)
159159
{
160160
inti;
161161
pg_time_tpgtt;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp