Skip to content

Commit d5f1e08

Browse files
committed
Code spacing improvement, particularly *tm spacing.
1 parent e9c44bd commit d5f1e08

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-
static int time2tm(TimeADT time, struct pg_tm * tm, fsec_t *fsec);
42-
static int timetz2tm(TimeTzADT *time, struct pg_tm * tm, fsec_t *fsec, int *tzp);
43-
static int tm2time(struct pg_tm * tm, fsec_t fsec, TimeADT *result);
44-
static int tm2timetz(struct pg_tm * tm, fsec_t fsec, int tz, TimeTzADT *result);
41+
static int time2tm(TimeADT time, struct pg_tm *tm, fsec_t *fsec);
42+
static int timetz2tm(TimeTzADT *time, struct pg_tm *tm, fsec_t *fsec, int *tzp);
43+
static int tm2time(struct pg_tm *tm, fsec_t fsec, TimeADT *result);
44+
static int tm2timetz(struct pg_tm *tm, fsec_t fsec, int tz, TimeTzADT *result);
4545
static void AdjustTimeForTypmod(TimeADT *time, int32 typmod);
4646

4747
/*****************************************************************************
@@ -914,7 +914,7 @@ time_in(PG_FUNCTION_ARGS)
914914
* Convert a tm structure to a time data type.
915915
*/
916916
static int
917-
tm2time(struct pg_tm * tm, fsec_t fsec, TimeADT *result)
917+
tm2time(struct pg_tm *tm, fsec_t fsec, TimeADT *result)
918918
{
919919
#ifdef HAVE_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
static int
934-
time2tm(TimeADT time, struct pg_tm * tm, fsec_t *fsec)
934+
time2tm(TimeADT time, struct pg_tm *tm, fsec_t *fsec)
935935
{
936936
#ifdef HAVE_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
static int
1714-
tm2timetz(struct pg_tm * tm, fsec_t fsec, int tz, TimeTzADT *result)
1714+
tm2timetz(struct pg_tm *tm, fsec_t fsec, int tz, TimeTzADT *result)
17151715
{
17161716
#ifdef HAVE_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
static int
1831-
timetz2tm(TimeTzADT *time, struct pg_tm * tm, fsec_t *fsec, int *tzp)
1831+
timetz2tm(TimeTzADT *time, struct pg_tm *tm, fsec_t *fsec, int *tzp)
18321832
{
18331833
#ifdef HAVE_INT64_TIMESTAMP
18341834
int64 trem = time->time;
@@ -2291,7 +2291,7 @@ datetimetz_timestamptz(PG_FUNCTION_ARGS)
22912291
TimestampTz result;
22922292

22932293
#ifdef HAVE_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
static int DecodeNumber(int flen, char *field, bool haveTextMonth,
3030
int fmask, int *tmask,
31-
struct pg_tm * tm, fsec_t *fsec, int *is2digits);
31+
struct pg_tm *tm, fsec_t *fsec, int *is2digits);
3232
static int DecodeNumberField(int len, char *str,
3333
int fmask, int *tmask,
34-
struct pg_tm * tm, fsec_t *fsec, int *is2digits);
34+
struct pg_tm *tm, fsec_t *fsec, int *is2digits);
3535
static int DecodeTime(char *str, int fmask, int *tmask,
36-
struct pg_tm * tm, fsec_t *fsec);
36+
struct pg_tm *tm, fsec_t *fsec);
3737
static int DecodeTimezone(char *str, int *tzp);
3838
static int DecodePosixTimezone(char *str, int *tzp);
3939
static datetkn *datebsearch(char *key, datetkn *base, unsigned int nel);
40-
static int DecodeDate(char *str, int fmask, int *tmask, struct pg_tm * tm);
40+
static int DecodeDate(char *str, int fmask, int *tmask, struct pg_tm *tm);
4141
static void TrimTrailingZeros(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(struct pg_tm * tm)
684+
GetCurrentDateTime(struct pg_tm *tm)
685685
{
686686
int tz;
687687
fsec_t fsec;
@@ -698,7 +698,7 @@ GetCurrentDateTime(struct pg_tm * tm)
698698
* including fractional seconds and timezone offset.
699699
*/
700700
void
701-
GetCurrentTimeUsec(struct pg_tm * tm, fsec_t *fsec, int *tzp)
701+
GetCurrentTimeUsec(struct pg_tm *tm, fsec_t *fsec, int *tzp)
702702
{
703703
int tz;
704704

@@ -969,7 +969,7 @@ ParseDateTime(const char *timestr, char *workbuf, size_t buflen,
969969
*/
970970
int
971971
DecodeDateTime(char **field, int *ftype, int nf,
972-
int *dtype, struct pg_tm * tm, fsec_t *fsec, int *tzp)
972+
int *dtype, struct pg_tm *tm, fsec_t *fsec, int *tzp)
973973
{
974974
int fmask = 0,
975975
tmask,
@@ -1632,7 +1632,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
16321632
* of mktime(), anyway.
16331633
*/
16341634
int
1635-
DetermineLocalTimeZone(struct pg_tm * tm)
1635+
DetermineLocalTimeZone(struct pg_tm *tm)
16361636
{
16371637
int date,
16381638
sec;
@@ -1760,7 +1760,7 @@ DetermineLocalTimeZone(struct pg_tm * tm)
17601760
*/
17611761
int
17621762
DecodeTimeOnly(char **field, int *ftype, int nf,
1763-
int *dtype, struct pg_tm * tm, fsec_t *fsec, int *tzp)
1763+
int *dtype, struct pg_tm *tm, fsec_t *fsec, int *tzp)
17641764
{
17651765
int fmask = 0,
17661766
tmask,
@@ -2296,7 +2296,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
22962296
* Insist on a complete set of fields.
22972297
*/
22982298
static int
2299-
DecodeDate(char *str, int fmask, int *tmask, struct pg_tm * tm)
2299+
DecodeDate(char *str, int fmask, int *tmask, struct pg_tm *tm)
23002300
{
23012301
fsec_t fsec;
23022302
int nf = 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
static int
2457-
DecodeTime(char *str, int fmask, int *tmask, struct pg_tm * tm, fsec_t *fsec)
2457+
DecodeTime(char *str, int fmask, int *tmask, struct pg_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
static int
25202520
DecodeNumber(int flen, char *str, bool haveTextMonth, int fmask,
2521-
int *tmask, struct pg_tm * tm, fsec_t *fsec, int *is2digits)
2521+
int *tmask, struct pg_tm *tm, fsec_t *fsec, int *is2digits)
25222522
{
25232523
int val;
25242524
char *cp;
@@ -2708,7 +2708,7 @@ DecodeNumber(int flen, char *str, bool haveTextMonth, int fmask,
27082708
*/
27092709
static int
27102710
DecodeNumberField(int len, char *str, int fmask,
2711-
int *tmask, struct pg_tm * tm, fsec_t *fsec, int *is2digits)
2711+
int *tmask, struct pg_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, int nf, int *dtype, struct pg_tm * tm, fsec_t *fsec)
2969+
DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct pg_tm *tm, fsec_t *fsec)
29702970
{
29712971
int is_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(struct pg_tm * tm, int style, char *str)
3423+
EncodeDateOnly(struct pg_tm *tm, int style, 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(struct pg_tm * tm, fsec_t fsec, int *tzp, int style, char *str)
3483+
EncodeTimeOnly(struct pg_tm *tm, fsec_t fsec, int *tzp, int style, 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(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style, char *str)
3533+
EncodeDateTime(struct pg_tm *tm, fsec_t fsec, int *tzp, char **tzn, int style, char *str)
35343534
{
35353535
int day,
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(struct pg_tm * tm, fsec_t fsec, int style, char *str)
3773+
EncodeInterval(struct pg_tm *tm, fsec_t fsec, int style, char *str)
37743774
{
37753775
int is_before = FALSE;
37763776
int is_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-
static AbsoluteTime tm2abstime(struct pg_tm * tm, int tz);
81-
static void reltime2tm(RelativeTime time, struct pg_tm * tm);
80+
static AbsoluteTime tm2abstime(struct pg_tm *tm, int tz);
81+
static void reltime2tm(RelativeTime time, struct pg_tm *tm);
8282
static int istinterval(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, struct pg_tm * tm, char **tzn)
103+
abstime2tm(AbsoluteTime _time, int *tzp, struct pg_tm *tm, char **tzn)
104104
{
105105
pg_time_t time = (pg_time_t) _time;
106106
struct pg_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
static AbsoluteTime
181-
tm2abstime(struct pg_tm * tm, int tz)
181+
tm2abstime(struct pg_tm *tm, int tz)
182182
{
183183
int day;
184184
AbsoluteTime sec;
@@ -698,7 +698,7 @@ reltimesend(PG_FUNCTION_ARGS)
698698

699699

700700
static void
701-
reltime2tm(RelativeTime time, struct pg_tm * tm)
701+
reltime2tm(RelativeTime time, struct pg_tm *tm)
702702
{
703703
double dtime = 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-
struct pg_tm *tx = pg_localtime(&utime, (attimezone!=NULL)?attimezone:global_timezone);
1093+
struct pg_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 int pg_next_dst_boundary(const pg_time_t *timep,
4949
int *after_isdst,
5050
const pg_tz *tz);
5151
extern size_t pg_strftime(char *s, size_t max, const char *format,
52-
const struct pg_tm * tm);
52+
const struct pg_tm *tm);
5353

5454
extern void pg_timezone_initialize(void);
5555
extern pg_tz *pg_tzset(const char *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
#define DTERR_TZDISP_OVERFLOW (-5)
272272

273273

274-
extern void GetCurrentDateTime(struct pg_tm * tm);
275-
extern void GetCurrentTimeUsec(struct pg_tm * tm, fsec_t *fsec, int *tzp);
274+
extern void GetCurrentDateTime(struct pg_tm *tm);
275+
extern void GetCurrentTimeUsec(struct pg_tm *tm, fsec_t *fsec, int *tzp);
276276
extern void j2date(int jd, int *year, int *month, int *day);
277277
extern int date2j(int year, int month, int day);
278278

@@ -281,22 +281,22 @@ extern int ParseDateTime(const char *timestr, char *workbuf, size_t buflen,
281281
int maxfields, int *numfields);
282282
extern int DecodeDateTime(char **field, int *ftype,
283283
int nf, int *dtype,
284-
struct pg_tm * tm, fsec_t *fsec, int *tzp);
284+
struct pg_tm *tm, fsec_t *fsec, int *tzp);
285285
extern int DecodeTimeOnly(char **field, int *ftype,
286286
int nf, int *dtype,
287-
struct pg_tm * tm, fsec_t *fsec, int *tzp);
287+
struct pg_tm *tm, fsec_t *fsec, int *tzp);
288288
extern int DecodeInterval(char **field, int *ftype,
289289
int nf, int *dtype,
290-
struct pg_tm * tm, fsec_t *fsec);
290+
struct pg_tm *tm, fsec_t *fsec);
291291
extern void DateTimeParseError(int dterr, const char *str,
292292
const char *datatype);
293293

294-
extern int DetermineLocalTimeZone(struct pg_tm * tm);
294+
extern int DetermineLocalTimeZone(struct pg_tm *tm);
295295

296-
extern int EncodeDateOnly(struct pg_tm * tm, int style, char *str);
297-
extern int EncodeTimeOnly(struct pg_tm * tm, fsec_t fsec, int *tzp, int style, char *str);
298-
extern int EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style, char *str);
299-
extern int EncodeInterval(struct pg_tm * tm, fsec_t fsec, int style, char *str);
296+
extern int EncodeDateOnly(struct pg_tm *tm, int style, char *str);
297+
extern int EncodeTimeOnly(struct pg_tm *tm, fsec_t fsec, int *tzp, int style, char *str);
298+
extern int EncodeDateTime(struct pg_tm *tm, fsec_t fsec, int *tzp, char **tzn, int style, char *str);
299+
extern int EncodeInterval(struct pg_tm *tm, fsec_t fsec, int style, char *str);
300300

301301
extern int DecodeSpecial(int field, char *lowtoken, int *val);
302302
extern int DecodeUnits(int field, 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
extern AbsoluteTime GetCurrentAbsoluteTime(void);
165-
extern void abstime2tm(AbsoluteTime time, int *tzp, struct pg_tm * tm, char **tzn);
165+
extern void abstime2tm(AbsoluteTime time, int *tzp, struct pg_tm *tm, char **tzn);
166166

167167
#endif /* NABSTIME_H */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy