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

Commitd5f1e08

Browse files
committed
Code spacing improvement, particularly *tm spacing.
1 parente9c44bd commitd5f1e08

File tree

10 files changed

+73
-72
lines changed

10 files changed

+73
-72
lines changed

‎src/backend/utils/adt/date.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.116 2005/07/21 18:06:12 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.117 2005/07/22 03:46:33 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -38,10 +38,10 @@
3838
#endif
3939

4040

41-
staticinttime2tm(TimeADTtime,structpg_tm*tm,fsec_t*fsec);
42-
staticinttimetz2tm(TimeTzADT*time,structpg_tm*tm,fsec_t*fsec,int*tzp);
43-
staticinttm2time(structpg_tm*tm,fsec_tfsec,TimeADT*result);
44-
staticinttm2timetz(structpg_tm*tm,fsec_tfsec,inttz,TimeTzADT*result);
41+
staticinttime2tm(TimeADTtime,structpg_tm*tm,fsec_t*fsec);
42+
staticinttimetz2tm(TimeTzADT*time,structpg_tm*tm,fsec_t*fsec,int*tzp);
43+
staticinttm2time(structpg_tm*tm,fsec_tfsec,TimeADT*result);
44+
staticinttm2timetz(structpg_tm*tm,fsec_tfsec,inttz,TimeTzADT*result);
4545
staticvoidAdjustTimeForTypmod(TimeADT*time,int32typmod);
4646

4747
/*****************************************************************************
@@ -914,7 +914,7 @@ time_in(PG_FUNCTION_ARGS)
914914
* Convert a tm structure to a time data type.
915915
*/
916916
staticint
917-
tm2time(structpg_tm*tm,fsec_tfsec,TimeADT*result)
917+
tm2time(structpg_tm*tm,fsec_tfsec,TimeADT*result)
918918
{
919919
#ifdefHAVE_INT64_TIMESTAMP
920920
*result= ((((tm->tm_hour*MINS_PER_HOUR+tm->tm_min)*SECS_PER_MINUTE)+tm->tm_sec)
@@ -931,7 +931,7 @@ tm2time(struct pg_tm * tm, fsec_t fsec, TimeADT *result)
931931
*local time zone. If out of this range, leave as GMT. - tgl 97/05/27
932932
*/
933933
staticint
934-
time2tm(TimeADTtime,structpg_tm*tm,fsec_t*fsec)
934+
time2tm(TimeADTtime,structpg_tm*tm,fsec_t*fsec)
935935
{
936936
#ifdefHAVE_INT64_TIMESTAMP
937937
tm->tm_hour=time /USECS_PER_HOUR;
@@ -1711,7 +1711,7 @@ time_part(PG_FUNCTION_ARGS)
17111711
* Convert a tm structure to a time data type.
17121712
*/
17131713
staticint
1714-
tm2timetz(structpg_tm*tm,fsec_tfsec,inttz,TimeTzADT*result)
1714+
tm2timetz(structpg_tm*tm,fsec_tfsec,inttz,TimeTzADT*result)
17151715
{
17161716
#ifdefHAVE_INT64_TIMESTAMP
17171717
result->time= ((((tm->tm_hour*MINS_PER_HOUR+tm->tm_min)*SECS_PER_MINUTE)+tm->tm_sec)*
@@ -1828,7 +1828,7 @@ timetz_send(PG_FUNCTION_ARGS)
18281828
* Convert TIME WITH TIME ZONE data type to POSIX time structure.
18291829
*/
18301830
staticint
1831-
timetz2tm(TimeTzADT*time,structpg_tm*tm,fsec_t*fsec,int*tzp)
1831+
timetz2tm(TimeTzADT*time,structpg_tm*tm,fsec_t*fsec,int*tzp)
18321832
{
18331833
#ifdefHAVE_INT64_TIMESTAMP
18341834
int64trem=time->time;
@@ -2291,7 +2291,7 @@ datetimetz_timestamptz(PG_FUNCTION_ARGS)
22912291
TimestampTzresult;
22922292

22932293
#ifdefHAVE_INT64_TIMESTAMP
2294-
result=(date*USECS_PER_DAY+time->time)+time->zone*USECS_PER_SEC;
2294+
result=date*USECS_PER_DAY+time->time+time->zone*USECS_PER_SEC;
22952295
#else
22962296
result=date* (double)SECS_PER_DAY+time->time+time->zone;
22972297
#endif

‎src/backend/utils/adt/datetime.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.155 2005/07/21 18:06:12 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.156 2005/07/22 03:46:33 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -28,16 +28,16 @@
2828

2929
staticintDecodeNumber(intflen,char*field,boolhaveTextMonth,
3030
intfmask,int*tmask,
31-
structpg_tm*tm,fsec_t*fsec,int*is2digits);
31+
structpg_tm*tm,fsec_t*fsec,int*is2digits);
3232
staticintDecodeNumberField(intlen,char*str,
3333
intfmask,int*tmask,
34-
structpg_tm*tm,fsec_t*fsec,int*is2digits);
34+
structpg_tm*tm,fsec_t*fsec,int*is2digits);
3535
staticintDecodeTime(char*str,intfmask,int*tmask,
36-
structpg_tm*tm,fsec_t*fsec);
36+
structpg_tm*tm,fsec_t*fsec);
3737
staticintDecodeTimezone(char*str,int*tzp);
3838
staticintDecodePosixTimezone(char*str,int*tzp);
3939
staticdatetkn*datebsearch(char*key,datetkn*base,unsignedintnel);
40-
staticintDecodeDate(char*str,intfmask,int*tmask,structpg_tm*tm);
40+
staticintDecodeDate(char*str,intfmask,int*tmask,structpg_tm*tm);
4141
staticvoidTrimTrailingZeros(char*str);
4242

4343

@@ -681,7 +681,7 @@ j2day(int date)
681681
* Get the transaction start time ("now()") broken down as a struct pg_tm.
682682
*/
683683
void
684-
GetCurrentDateTime(structpg_tm*tm)
684+
GetCurrentDateTime(structpg_tm*tm)
685685
{
686686
inttz;
687687
fsec_tfsec;
@@ -698,7 +698,7 @@ GetCurrentDateTime(struct pg_tm * tm)
698698
* including fractional seconds and timezone offset.
699699
*/
700700
void
701-
GetCurrentTimeUsec(structpg_tm*tm,fsec_t*fsec,int*tzp)
701+
GetCurrentTimeUsec(structpg_tm*tm,fsec_t*fsec,int*tzp)
702702
{
703703
inttz;
704704

@@ -969,7 +969,7 @@ ParseDateTime(const char *timestr, char *workbuf, size_t buflen,
969969
*/
970970
int
971971
DecodeDateTime(char**field,int*ftype,intnf,
972-
int*dtype,structpg_tm*tm,fsec_t*fsec,int*tzp)
972+
int*dtype,structpg_tm*tm,fsec_t*fsec,int*tzp)
973973
{
974974
intfmask=0,
975975
tmask,
@@ -1632,7 +1632,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
16321632
* of mktime(), anyway.
16331633
*/
16341634
int
1635-
DetermineLocalTimeZone(structpg_tm*tm)
1635+
DetermineLocalTimeZone(structpg_tm*tm)
16361636
{
16371637
intdate,
16381638
sec;
@@ -1760,7 +1760,7 @@ DetermineLocalTimeZone(struct pg_tm * tm)
17601760
*/
17611761
int
17621762
DecodeTimeOnly(char**field,int*ftype,intnf,
1763-
int*dtype,structpg_tm*tm,fsec_t*fsec,int*tzp)
1763+
int*dtype,structpg_tm*tm,fsec_t*fsec,int*tzp)
17641764
{
17651765
intfmask=0,
17661766
tmask,
@@ -2296,7 +2296,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
22962296
* Insist on a complete set of fields.
22972297
*/
22982298
staticint
2299-
DecodeDate(char*str,intfmask,int*tmask,structpg_tm*tm)
2299+
DecodeDate(char*str,intfmask,int*tmask,structpg_tm*tm)
23002300
{
23012301
fsec_tfsec;
23022302
intnf=0;
@@ -2454,7 +2454,7 @@ DecodeDate(char *str, int fmask, int *tmask, struct pg_tm * tm)
24542454
*can be used to represent time spans.
24552455
*/
24562456
staticint
2457-
DecodeTime(char*str,intfmask,int*tmask,structpg_tm*tm,fsec_t*fsec)
2457+
DecodeTime(char*str,intfmask,int*tmask,structpg_tm*tm,fsec_t*fsec)
24582458
{
24592459
char*cp;
24602460

@@ -2518,7 +2518,7 @@ DecodeTime(char *str, int fmask, int *tmask, struct pg_tm * tm, fsec_t *fsec)
25182518
*/
25192519
staticint
25202520
DecodeNumber(intflen,char*str,boolhaveTextMonth,intfmask,
2521-
int*tmask,structpg_tm*tm,fsec_t*fsec,int*is2digits)
2521+
int*tmask,structpg_tm*tm,fsec_t*fsec,int*is2digits)
25222522
{
25232523
intval;
25242524
char*cp;
@@ -2708,7 +2708,7 @@ DecodeNumber(int flen, char *str, bool haveTextMonth, int fmask,
27082708
*/
27092709
staticint
27102710
DecodeNumberField(intlen,char*str,intfmask,
2711-
int*tmask,structpg_tm*tm,fsec_t*fsec,int*is2digits)
2711+
int*tmask,structpg_tm*tm,fsec_t*fsec,int*is2digits)
27122712
{
27132713
char*cp;
27142714

@@ -2966,7 +2966,7 @@ DecodeSpecial(int field, char *lowtoken, int *val)
29662966
*preceding an hh:mm:ss field. - thomas 1998-04-30
29672967
*/
29682968
int
2969-
DecodeInterval(char**field,int*ftype,intnf,int*dtype,structpg_tm*tm,fsec_t*fsec)
2969+
DecodeInterval(char**field,int*ftype,intnf,int*dtype,structpg_tm*tm,fsec_t*fsec)
29702970
{
29712971
intis_before= FALSE;
29722972
char*cp;
@@ -3420,7 +3420,7 @@ datebsearch(char *key, datetkn *base, unsigned int nel)
34203420
* Encode date as local time.
34213421
*/
34223422
int
3423-
EncodeDateOnly(structpg_tm*tm,intstyle,char*str)
3423+
EncodeDateOnly(structpg_tm*tm,intstyle,char*str)
34243424
{
34253425
if (tm->tm_mon<1||tm->tm_mon>MONTHS_PER_YEAR)
34263426
return-1;
@@ -3480,7 +3480,7 @@ EncodeDateOnly(struct pg_tm * tm, int style, char *str)
34803480
* Encode time fields only.
34813481
*/
34823482
int
3483-
EncodeTimeOnly(structpg_tm*tm,fsec_tfsec,int*tzp,intstyle,char*str)
3483+
EncodeTimeOnly(structpg_tm*tm,fsec_tfsec,int*tzp,intstyle,char*str)
34843484
{
34853485
if (tm->tm_hour<0||tm->tm_hour>HOURS_PER_DAY)
34863486
return-1;
@@ -3530,7 +3530,7 @@ EncodeTimeOnly(struct pg_tm * tm, fsec_t fsec, int *tzp, int style, char *str)
35303530
*European - dd/mm/yyyy
35313531
*/
35323532
int
3533-
EncodeDateTime(structpg_tm*tm,fsec_tfsec,int*tzp,char**tzn,intstyle,char*str)
3533+
EncodeDateTime(structpg_tm*tm,fsec_tfsec,int*tzp,char**tzn,intstyle,char*str)
35343534
{
35353535
intday,
35363536
hour,
@@ -3770,7 +3770,7 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style,
37703770
* - thomas 1998-04-30
37713771
*/
37723772
int
3773-
EncodeInterval(structpg_tm*tm,fsec_tfsec,intstyle,char*str)
3773+
EncodeInterval(structpg_tm*tm,fsec_tfsec,intstyle,char*str)
37743774
{
37753775
intis_before= FALSE;
37763776
intis_nonzero= FALSE;

‎src/backend/utils/adt/nabstime.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.139 2005/07/21 18:06:12 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.140 2005/07/22 03:46:33 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -77,8 +77,8 @@
7777
* Function prototypes -- internal to this file only
7878
*/
7979

80-
staticAbsoluteTimetm2abstime(structpg_tm*tm,inttz);
81-
staticvoidreltime2tm(RelativeTimetime,structpg_tm*tm);
80+
staticAbsoluteTimetm2abstime(structpg_tm*tm,inttz);
81+
staticvoidreltime2tm(RelativeTimetime,structpg_tm*tm);
8282
staticintistinterval(char*i_string,
8383
AbsoluteTime*i_start,
8484
AbsoluteTime*i_end);
@@ -100,7 +100,7 @@ GetCurrentAbsoluteTime(void)
100100

101101

102102
void
103-
abstime2tm(AbsoluteTime_time,int*tzp,structpg_tm*tm,char**tzn)
103+
abstime2tm(AbsoluteTime_time,int*tzp,structpg_tm*tm,char**tzn)
104104
{
105105
pg_time_ttime= (pg_time_t)_time;
106106
structpg_tm*tx;
@@ -178,7 +178,7 @@ abstime2tm(AbsoluteTime _time, int *tzp, struct pg_tm * tm, char **tzn)
178178
* Note that tm has full year (not 1900-based) and 1-based month.
179179
*/
180180
staticAbsoluteTime
181-
tm2abstime(structpg_tm*tm,inttz)
181+
tm2abstime(structpg_tm*tm,inttz)
182182
{
183183
intday;
184184
AbsoluteTimesec;
@@ -698,7 +698,7 @@ reltimesend(PG_FUNCTION_ARGS)
698698

699699

700700
staticvoid
701-
reltime2tm(RelativeTimetime,structpg_tm*tm)
701+
reltime2tm(RelativeTimetime,structpg_tm*tm)
702702
{
703703
doubledtime=time;
704704

‎src/backend/utils/adt/timestamp.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.138 2005/07/21 18:06:12 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.139 2005/07/22 03:46:34 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1059,7 +1059,7 @@ timestamp2tm(Timestamp dt, int *tzp, struct pg_tm *tm, fsec_t *fsec, char **tzn,
10591059
* We have a brute force time zone per SQL99? Then use it without
10601060
* change since we have already rotated to the time zone.
10611061
*/
1062-
if ((attimezone==NULL)&&HasCTZSet)
1062+
if ((attimezone==NULL)&&HasCTZSet)
10631063
{
10641064
*tzp=CTimeZone;
10651065
tm->tm_isdst=0;
@@ -1090,7 +1090,8 @@ timestamp2tm(Timestamp dt, int *tzp, struct pg_tm *tm, fsec_t *fsec, char **tzn,
10901090
utime= (pg_time_t)dt;
10911091
if ((Timestamp)utime==dt)
10921092
{
1093-
structpg_tm*tx=pg_localtime(&utime, (attimezone!=NULL)?attimezone:global_timezone);
1093+
structpg_tm*tx=pg_localtime(&utime, (attimezone!=NULL) ?
1094+
attimezone :global_timezone);
10941095

10951096
tm->tm_year=tx->tm_year+1900;
10961097
tm->tm_mon=tx->tm_mon+1;

‎src/include/pgtime.h

Lines changed: 2 additions & 2 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/include/pgtime.h,v 1.8 2005/06/15 00:34:09 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/pgtime.h,v 1.9 2005/07/22 03:46:34 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -49,7 +49,7 @@ extern intpg_next_dst_boundary(const pg_time_t *timep,
4949
int*after_isdst,
5050
constpg_tz*tz);
5151
externsize_tpg_strftime(char*s,size_tmax,constchar*format,
52-
conststructpg_tm*tm);
52+
conststructpg_tm*tm);
5353

5454
externvoidpg_timezone_initialize(void);
5555
externpg_tz*pg_tzset(constchar*tzname);

‎src/include/utils/datetime.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
12-
* $PostgreSQL: pgsql/src/include/utils/datetime.h,v 1.54 2005/05/26 02:04:14 neilc Exp $
12+
* $PostgreSQL: pgsql/src/include/utils/datetime.h,v 1.55 2005/07/22 03:46:34 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -271,8 +271,8 @@ extern const int day_tab[2][13];
271271
#defineDTERR_TZDISP_OVERFLOW(-5)
272272

273273

274-
externvoidGetCurrentDateTime(structpg_tm*tm);
275-
externvoidGetCurrentTimeUsec(structpg_tm*tm,fsec_t*fsec,int*tzp);
274+
externvoidGetCurrentDateTime(structpg_tm*tm);
275+
externvoidGetCurrentTimeUsec(structpg_tm*tm,fsec_t*fsec,int*tzp);
276276
externvoidj2date(intjd,int*year,int*month,int*day);
277277
externintdate2j(intyear,intmonth,intday);
278278

@@ -281,22 +281,22 @@ extern int ParseDateTime(const char *timestr, char *workbuf, size_t buflen,
281281
intmaxfields,int*numfields);
282282
externintDecodeDateTime(char**field,int*ftype,
283283
intnf,int*dtype,
284-
structpg_tm*tm,fsec_t*fsec,int*tzp);
284+
structpg_tm*tm,fsec_t*fsec,int*tzp);
285285
externintDecodeTimeOnly(char**field,int*ftype,
286286
intnf,int*dtype,
287-
structpg_tm*tm,fsec_t*fsec,int*tzp);
287+
structpg_tm*tm,fsec_t*fsec,int*tzp);
288288
externintDecodeInterval(char**field,int*ftype,
289289
intnf,int*dtype,
290-
structpg_tm*tm,fsec_t*fsec);
290+
structpg_tm*tm,fsec_t*fsec);
291291
externvoidDateTimeParseError(intdterr,constchar*str,
292292
constchar*datatype);
293293

294-
externintDetermineLocalTimeZone(structpg_tm*tm);
294+
externintDetermineLocalTimeZone(structpg_tm*tm);
295295

296-
externintEncodeDateOnly(structpg_tm*tm,intstyle,char*str);
297-
externintEncodeTimeOnly(structpg_tm*tm,fsec_tfsec,int*tzp,intstyle,char*str);
298-
externintEncodeDateTime(structpg_tm*tm,fsec_tfsec,int*tzp,char**tzn,intstyle,char*str);
299-
externintEncodeInterval(structpg_tm*tm,fsec_tfsec,intstyle,char*str);
296+
externintEncodeDateOnly(structpg_tm*tm,intstyle,char*str);
297+
externintEncodeTimeOnly(structpg_tm*tm,fsec_tfsec,int*tzp,intstyle,char*str);
298+
externintEncodeDateTime(structpg_tm*tm,fsec_tfsec,int*tzp,char**tzn,intstyle,char*str);
299+
externintEncodeInterval(structpg_tm*tm,fsec_tfsec,intstyle,char*str);
300300

301301
externintDecodeSpecial(intfield,char*lowtoken,int*val);
302302
externintDecodeUnits(intfield,char*lowtoken,int*val);

‎src/include/utils/nabstime.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/utils/nabstime.h,v 1.46 2005/06/29 22:51:57 tgl Exp $
10+
* $PostgreSQL: pgsql/src/include/utils/nabstime.h,v 1.47 2005/07/22 03:46:34 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -162,6 +162,6 @@ extern Datum timeofday(PG_FUNCTION_ARGS);
162162

163163
/* non-fmgr-callable support routines */
164164
externAbsoluteTimeGetCurrentAbsoluteTime(void);
165-
externvoidabstime2tm(AbsoluteTimetime,int*tzp,structpg_tm*tm,char**tzn);
165+
externvoidabstime2tm(AbsoluteTimetime,int*tzp,structpg_tm*tm,char**tzn);
166166

167167
#endif/* NABSTIME_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp