Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1ccd423

Browse files
committed
Massive commit to run PGINDENT on all *.c and *.h files.
1 parent 8fecd4f commit 1ccd423

File tree

687 files changed

+152235
-138348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

687 files changed

+152235
-138348
lines changed

contrib/array/array_iterator.c

+172-149
Large diffs are not rendered by default.

contrib/datetime/datetime_functions.c

+63-50
Original file line numberDiff line numberDiff line change
@@ -13,86 +13,99 @@
1313
#include "utils/datetime.h"
1414

1515

16-
TimeADT *time_difference(TimeADT * time1, TimeADT * time2)
16+
TimeADT *
17+
time_difference(TimeADT * time1, TimeADT * time2)
1718
{
18-
TimeADT *result = (TimeADT *) palloc(sizeof(TimeADT));
19-
*result = *time1 - *time2;
20-
return (result);
19+
TimeADT *result = (TimeADT *) palloc(sizeof(TimeADT));
20+
21+
*result = *time1 - *time2;
22+
return (result);
2123
}
2224

23-
TimeADT *currenttime()
25+
TimeADT *
26+
currenttime()
2427
{
25-
time_t current_time;
26-
struct tm *tm;
27-
TimeADT *result = (TimeADT *) palloc(sizeof(TimeADT));
28-
29-
current_time = time(NULL);
30-
tm = localtime(&current_time);
31-
*result = ((((tm->tm_hour*60)+tm->tm_min)*60)+tm->tm_sec);
32-
return (result);
28+
time_t current_time;
29+
struct tm *tm;
30+
TimeADT *result = (TimeADT *) palloc(sizeof(TimeADT));
31+
32+
current_time = time(NULL);
33+
tm = localtime(&current_time);
34+
*result = ((((tm->tm_hour * 60) + tm->tm_min) * 60) + tm->tm_sec);
35+
return (result);
3336
}
34-
DateADT currentdate()
37+
DateADT
38+
currentdate()
3539
{
36-
time_t current_time;
37-
struct tm *tm;
38-
DateADT result;
39-
current_time = time(NULL);
40-
tm = localtime(&current_time);
41-
42-
result = date2j(tm->tm_year,tm->tm_mon + 1,tm->tm_mday) -
43-
date2j(100,1,1);
44-
return (result);
40+
time_t current_time;
41+
struct tm *tm;
42+
DateADT result;
43+
44+
current_time = time(NULL);
45+
tm = localtime(&current_time);
46+
47+
result = date2j(tm->tm_year, tm->tm_mon + 1, tm->tm_mday) -
48+
date2j(100, 1, 1);
49+
return (result);
4550
}
46-
int4 hours(TimeADT * time)
51+
int4
52+
hours(TimeADT * time)
4753
{
48-
return(*time / (60*60));
54+
return (*time / (60 * 60));
4955
}
5056

51-
int4 minutes(TimeADT * time)
57+
int4
58+
minutes(TimeADT * time)
5259
{
53-
return(((int) (*time / 60)) % 60);
60+
return (((int) (*time / 60)) % 60);
5461
}
5562

56-
int4 seconds(TimeADT * time)
63+
int4
64+
seconds(TimeADT * time)
5765
{
58-
return(((int) *time) % 60);
66+
return (((int) *time) % 60);
5967
}
60-
int4 day(DateADT *date)
68+
int4
69+
day(DateADT * date)
6170
{
62-
struct tm tm;
71+
struct tm tm;
6372

64-
j2date( (*date + date2j(2000,1,1)),
65-
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
73+
j2date((*date + date2j(2000, 1, 1)),
74+
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
6675

67-
return (tm.tm_mday);
76+
return (tm.tm_mday);
6877
}
69-
int4 month(DateADT *date)
78+
int4
79+
month(DateADT * date)
7080
{
71-
struct tm tm;
81+
struct tm tm;
7282

73-
j2date( (*date + date2j(2000,1,1)),
74-
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
83+
j2date((*date + date2j(2000, 1, 1)),
84+
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
7585

76-
return (tm.tm_mon);
86+
return (tm.tm_mon);
7787
}
78-
int4 year(DateADT *date)
88+
int4
89+
year(DateADT * date)
7990
{
80-
struct tm tm;
91+
struct tm tm;
8192

82-
j2date( (*date + date2j(2000,1,1)),
83-
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
93+
j2date((*date + date2j(2000, 1, 1)),
94+
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
8495

85-
return (tm.tm_year);
96+
return (tm.tm_year);
8697
}
87-
int4 asminutes(TimeADT * time)
98+
int4
99+
asminutes(TimeADT * time)
88100
{
89-
int seconds = (int) *time;
101+
int seconds = (int) *time;
90102

91-
return (seconds / 60);
103+
return (seconds / 60);
92104
}
93-
int4 asseconds(TimeADT * time)
105+
int4
106+
asseconds(TimeADT * time)
94107
{
95-
int seconds = (int) *time;
108+
int seconds = (int) *time;
96109

97-
return (seconds);
110+
return (seconds);
98111
}

0 commit comments

Comments
 (0)