Skip to content

Commit 0784208

Browse files
committed
pgindent run over code.
1 parent 4b04b01 commit 0784208

File tree

413 files changed

+11788
-10834
lines changed

Some content is hidden

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

413 files changed

+11788
-10834
lines changed

contrib/array/array_iterator.c

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ array_iterator(Oid elemtype, Oid proc, int and, ArrayType *array, Datum value)
4343
int ndim,
4444
*dim;
4545
char *p;
46-
FmgrInfo finf; /*Tobias Gabele Jan 18 1999*/
47-
46+
FmgrInfo finf; /* Tobias Gabele Jan 18 1999 */
47+
4848

4949
/* Sanity checks */
5050
if ((array == (ArrayType *) NULL)
@@ -75,9 +75,9 @@ array_iterator(Oid elemtype, Oid proc, int and, ArrayType *array, Datum value)
7575

7676
/* Lookup the function entry point */
7777
proc_fn = (func_ptr) NULL;
78-
fmgr_info(proc,&finf); /*Tobias Gabele Jan 18 1999*/
79-
proc_fn=finf.fn_addr; /*Tobias Gabele Jan 18 1999*/
80-
pronargs=finf.fn_nargs; /*Tobias Gabele Jan 18 1999*/
78+
fmgr_info(proc, &finf); /* Tobias Gabele Jan 18 1999 */
79+
proc_fn = finf.fn_addr; /* Tobias Gabele Jan 18 1999 */
80+
pronargs = finf.fn_nargs; /* Tobias Gabele Jan 18 1999 */
8181
if ((proc_fn == NULL) || (pronargs != 2))
8282
{
8383
elog(ERROR, "array_iterator: fmgr_info lookup failed for oid %d", proc);
@@ -110,38 +110,26 @@ array_iterator(Oid elemtype, Oid proc, int and, ArrayType *array, Datum value)
110110
{
111111
result = (int) (*proc_fn) (p, value);
112112
if (typlen > 0)
113-
{
114113
p += typlen;
115-
}
116114
else
117-
{
118115
p += INTALIGN(*(int32 *) p);
119-
}
120116
}
121117
if (result)
122118
{
123119
if (!and)
124-
{
125120
return (1);
126-
}
127121
}
128122
else
129123
{
130124
if (and)
131-
{
132125
return (0);
133-
}
134126
}
135127
}
136128

137129
if (and && result)
138-
{
139130
return (1);
140-
}
141131
else
142-
{
143132
return (0);
144-
}
145133
}
146134

147135
/*
@@ -344,7 +332,7 @@ int32
344332
array_oideq(ArrayType *array, Oid value)
345333
{
346334
return array_iterator((Oid) 26, /* oid */
347-
(Oid) 184, /* oideq */
335+
(Oid) 184, /* oideq */
348336
0, /* logical or */
349337
array, (Datum) value);
350338
}

contrib/array/array_iterator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#ifndef ARRAY_ITERATOR_H
22
#define ARRAY_ITERATOR_H
33

4-
static int32
5-
array_iterator(Oid elemtype, Oid proc, int and,
4+
static int32 array_iterator(Oid elemtype, Oid proc, int and,
65
ArrayType *array, Datum value);
76
int32 array_texteq(ArrayType *array, char *value);
87
int32 array_all_texteq(ArrayType *array, char *value);
@@ -24,6 +23,7 @@ int32 array_int4lt(ArrayType *array, int4 value);
2423
int32 array_all_int4lt(ArrayType *array, int4 value);
2524
int32 array_int4le(ArrayType *array, int4 value);
2625
int32 array_all_int4le(ArrayType *array, int4 value);
27-
int32 array_oideq(ArrayType *array, Oid value);
28-
int32 array_all_oidne(ArrayType *array, Oid value);
26+
int32 array_oideq(ArrayType *array, Oid value);
27+
int32 array_all_oidne(ArrayType *array, Oid value);
28+
2929
#endif

contrib/datetime/datetime_functions.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ currentdate()
225225

226226
/*
227227
* Local variables:
228-
* tab-width: 4
229-
* c-indent-level: 4
230-
* c-basic-offset: 4
228+
* tab-width: 4
229+
* c-indent-level: 4
230+
* c-basic-offset: 4
231231
* End:
232232
*/

contrib/earthdistance/earthdistance.c

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,24 @@
44

55
#include <postgres.h>
66
#include <utils/geo_decls.h> /* for Pt */
7-
#include <utils/palloc.h> /* for palloc */
7+
#include <utils/palloc.h> /* for palloc */
88

99
/* Earth's radius is in statute miles. */
10-
const EARTH_RADIUS = 3958.747716;
11-
const TWO_PI = 2.0 * M_PI;
10+
const EARTH_RADIUS = 3958.747716;
11+
const TWO_PI = 2.0 * M_PI;
1212

1313
/******************************************************
1414
*
1515
* degtorad - convert degrees to radians
1616
*
17-
* arg: double, angle in degrees
17+
* arg: double, angle in degrees
1818
*
19-
* returns: double, same angle in radians
19+
* returns: double, same angle in radians
2020
******************************************************/
2121

2222
static double
23-
degtorad (double degrees) {
23+
degtorad(double degrees)
24+
{
2425
return (degrees / 360.0) * TWO_PI;
2526
}
2627

@@ -30,36 +31,40 @@ degtorad (double degrees) {
3031
* geo_distance - distance between points
3132
*
3233
* args:
33-
* a pair of points - for each point,
34-
* x-coordinate is longitude in degrees west of Greenwich
35-
* y-coordinate is latitude in degrees above equator
34+
* a pair of points - for each point,
35+
* x-coordinate is longitude in degrees west of Greenwich
36+
* y-coordinate is latitude in degrees above equator
3637
*
37-
* returns: double
38-
* distance between the points in miles on earth's surface
38+
* returns: double
39+
* distance between the points in miles on earth's surface
3940
******************************************************/
4041

4142
double *
42-
geo_distance (Point *pt1, Point *pt2) {
43+
geo_distance(Point *pt1, Point *pt2)
44+
{
4345

44-
double long1, lat1, long2, lat2;
45-
double longdiff;
46-
double * resultp = palloc (sizeof(double));
46+
double long1,
47+
lat1,
48+
long2,
49+
lat2;
50+
double longdiff;
51+
double *resultp = palloc(sizeof(double));
4752

4853
/* convert degrees to radians */
4954

50-
long1 = degtorad (pt1->x);
51-
lat1 = degtorad (pt1->y);
55+
long1 = degtorad(pt1->x);
56+
lat1 = degtorad(pt1->y);
5257

53-
long2 = degtorad (pt2->x);
54-
lat2 = degtorad (pt2->y);
58+
long2 = degtorad(pt2->x);
59+
lat2 = degtorad(pt2->y);
5560

5661
/* compute difference in longitudes - want < 180 degrees */
57-
longdiff = fabs (long1 - long2);
62+
longdiff = fabs(long1 - long2);
5863
if (longdiff > M_PI)
5964
longdiff = TWO_PI - longdiff;
6065

61-
* resultp = EARTH_RADIUS * acos
62-
(sin (lat1) * sin (lat2) + cos (lat1) * cos (lat2) * cos (longdiff));
66+
*resultp = EARTH_RADIUS * acos
67+
(sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(longdiff));
6368

6469
return resultp;
6570
}

contrib/findoidjoins/findoidjoins.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
#include <libpq-fe.h>
1010
#include "pginterface.h"
1111

12-
PGresult *attres, *relres;
12+
PGresult *attres,
13+
*relres;
1314

1415
int
1516
main(int argc, char **argv)
@@ -55,7 +56,7 @@ main(int argc, char **argv)
5556
");
5657
doquery("FETCH ALL IN c_relations");
5758
relres = get_result();
58-
59+
5960
set_result(attres);
6061
while (fetch(typname, relname, attname) != END_OF_TUPLES)
6162
{
@@ -65,17 +66,17 @@ main(int argc, char **argv)
6566
{
6667
unset_result(relres);
6768
if (strcmp(typname, "oid") == 0)
68-
sprintf(query,"\
69+
sprintf(query, "\
6970
DECLARE c_matches BINARY CURSOR FOR \
70-
SELECT count(*)
71-
FROM %s t1, %s t2 \
72-
WHERE t1.%s = t2.oid", relname, relname2, attname);
71+
SELECT count(*) \
72+
FROM % s t1, %s t2 \
73+
WHERE t1.% s = t2.oid ", relname, relname2, attname);
7374
else
74-
sprintf(query,"\
75+
sprintf(query, "\
7576
DECLARE c_matches BINARY CURSOR FOR \
76-
SELECT count(*)
77-
FROM %s t1, %s t2 \
78-
WHERE RegprocToOid(t1.%s) = t2.oid", relname, relname2, attname);
77+
SELECT count(*) \
78+
FROM % s t1, %s t2 \
79+
WHERE RegprocToOid(t1.% s) = t2.oid ", relname, relname2, attname);
7980

8081
doquery(query);
8182
doquery("FETCH ALL IN c_matches");
@@ -96,7 +97,7 @@ main(int argc, char **argv)
9697
doquery("CLOSE c_attributes");
9798
PQclear(attres);
9899
unset_result(attres);
99-
100+
100101
doquery("COMMIT WORK");
101102

102103
disconnectdb();

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