Skip to content

Commit 0a78320

Browse files
committed
pgindent run for 9.4
This includes removing tabs after periods in C comments, which was applied to back branches, so this change should not effect backpatching.
1 parent fb85cd4 commit 0a78320

File tree

854 files changed

+7855
-7375
lines changed

Some content is hidden

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

854 files changed

+7855
-7375
lines changed

config/test_quiet_include.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22
* For the raison d'etre of this file, check the comment above the definition
33
* of the PGAC_C_INLINE macro in config/c-compiler.m4.
44
*/
5-
static inline int fun () { return 0; }
5+
static inline int
6+
fun()
7+
{
8+
return 0;
9+
}

contrib/auto_explain/auto_explain.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ _PG_init(void)
116116

117117
DefineCustomBoolVariable("auto_explain.log_triggers",
118118
"Include trigger statistics in plans.",
119-
"This has no effect unless log_analyze is also set.",
119+
"This has no effect unless log_analyze is also set.",
120120
&auto_explain_log_triggers,
121121
false,
122122
PGC_SUSET,

contrib/btree_gist/btree_interval.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ gbt_intv_dist(const void *a, const void *b)
8686

8787
/*
8888
* INTERVALSIZE should be the actual size-on-disk of an Interval, as shown
89-
* in pg_type. This might be less than sizeof(Interval) if the compiler
89+
* in pg_type. This might be less than sizeof(Interval) if the compiler
9090
* insists on adding alignment padding at the end of the struct.
9191
*/
9292
#define INTERVALSIZE 16

contrib/cube/cube.c

+44-41
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ bool g_cube_internal_consistent(NDBOX *key, NDBOX *query, StrategyNumber strate
104104
** Auxiliary funxtions
105105
*/
106106
static double distance_1D(double a1, double a2, double b1, double b2);
107-
static bool cube_is_point_internal(NDBOX *cube);
107+
static bool cube_is_point_internal(NDBOX *cube);
108108

109109

110110
/*****************************************************************************
@@ -538,7 +538,7 @@ g_cube_picksplit(PG_FUNCTION_ARGS)
538538
rt_cube_size(datum_r, &size_r);
539539

540540
/*
541-
* Now split up the regions between the two seeds. An important property
541+
* Now split up the regions between the two seeds. An important property
542542
* of this split algorithm is that the split vector v has the indices of
543543
* items to be split in order in its left and right vectors. We exploit
544544
* this property by doing a merge in the code that actually splits the
@@ -554,7 +554,7 @@ g_cube_picksplit(PG_FUNCTION_ARGS)
554554
{
555555
/*
556556
* If we've already decided where to place this item, just put it on
557-
* the right list. Otherwise, we need to figure out which page needs
557+
* the right list. Otherwise, we need to figure out which page needs
558558
* the least enlargement in order to store the item.
559559
*/
560560

@@ -728,27 +728,27 @@ cube_union_v0(NDBOX *a, NDBOX *b)
728728
SET_VARSIZE(result, size);
729729
SET_DIM(result, dim);
730730

731-
/* First compute the union of the dimensions present in both args */
731+
/* First compute the union of the dimensions present in both args */
732732
for (i = 0; i < DIM(b); i++)
733733
{
734734
result->x[i] = Min(
735-
Min(LL_COORD(a, i), UR_COORD(a, i)),
736-
Min(LL_COORD(b, i), UR_COORD(b, i))
737-
);
735+
Min(LL_COORD(a, i), UR_COORD(a, i)),
736+
Min(LL_COORD(b, i), UR_COORD(b, i))
737+
);
738738
result->x[i + DIM(a)] = Max(
739-
Max(LL_COORD(a, i), UR_COORD(a, i)),
740-
Max(LL_COORD(b, i), UR_COORD(b, i))
741-
);
739+
Max(LL_COORD(a, i), UR_COORD(a, i)),
740+
Max(LL_COORD(b, i), UR_COORD(b, i))
741+
);
742742
}
743743
/* continue on the higher dimensions only present in 'a' */
744744
for (; i < DIM(a); i++)
745745
{
746746
result->x[i] = Min(0,
747-
Min(LL_COORD(a, i), UR_COORD(a, i))
748-
);
747+
Min(LL_COORD(a, i), UR_COORD(a, i))
748+
);
749749
result->x[i + dim] = Max(0,
750-
Max(LL_COORD(a, i), UR_COORD(a, i))
751-
);
750+
Max(LL_COORD(a, i), UR_COORD(a, i))
751+
);
752752
}
753753

754754
/*
@@ -795,6 +795,7 @@ cube_inter(PG_FUNCTION_ARGS)
795795
if (DIM(a) < DIM(b))
796796
{
797797
NDBOX *tmp = b;
798+
798799
b = a;
799800
a = tmp;
800801
swapped = true;
@@ -806,27 +807,27 @@ cube_inter(PG_FUNCTION_ARGS)
806807
SET_VARSIZE(result, size);
807808
SET_DIM(result, dim);
808809

809-
/* First compute intersection of the dimensions present in both args */
810+
/* First compute intersection of the dimensions present in both args */
810811
for (i = 0; i < DIM(b); i++)
811812
{
812813
result->x[i] = Max(
813-
Min(LL_COORD(a, i), UR_COORD(a, i)),
814-
Min(LL_COORD(b, i), UR_COORD(b, i))
815-
);
814+
Min(LL_COORD(a, i), UR_COORD(a, i)),
815+
Min(LL_COORD(b, i), UR_COORD(b, i))
816+
);
816817
result->x[i + DIM(a)] = Min(
817-
Max(LL_COORD(a, i), UR_COORD(a, i)),
818-
Max(LL_COORD(b, i), UR_COORD(b, i))
819-
);
818+
Max(LL_COORD(a, i), UR_COORD(a, i)),
819+
Max(LL_COORD(b, i), UR_COORD(b, i))
820+
);
820821
}
821822
/* continue on the higher dimemsions only present in 'a' */
822823
for (; i < DIM(a); i++)
823824
{
824825
result->x[i] = Max(0,
825-
Min(LL_COORD(a, i), UR_COORD(a, i))
826-
);
826+
Min(LL_COORD(a, i), UR_COORD(a, i))
827+
);
827828
result->x[i + DIM(a)] = Min(0,
828-
Max(LL_COORD(a, i), UR_COORD(a, i))
829-
);
829+
Max(LL_COORD(a, i), UR_COORD(a, i))
830+
);
830831
}
831832

832833
/*
@@ -1236,14 +1237,14 @@ cube_distance(PG_FUNCTION_ARGS)
12361237
/* compute within the dimensions of (b) */
12371238
for (i = 0; i < DIM(b); i++)
12381239
{
1239-
d = distance_1D(LL_COORD(a,i), UR_COORD(a,i), LL_COORD(b,i), UR_COORD(b,i));
1240+
d = distance_1D(LL_COORD(a, i), UR_COORD(a, i), LL_COORD(b, i), UR_COORD(b, i));
12401241
distance += d * d;
12411242
}
12421243

12431244
/* compute distance to zero for those dimensions in (a) absent in (b) */
12441245
for (i = DIM(b); i < DIM(a); i++)
12451246
{
1246-
d = distance_1D(LL_COORD(a,i), UR_COORD(a,i), 0.0, 0.0);
1247+
d = distance_1D(LL_COORD(a, i), UR_COORD(a, i), 0.0, 0.0);
12471248
distance += d * d;
12481249
}
12491250

@@ -1297,11 +1298,11 @@ cube_is_point_internal(NDBOX *cube)
12971298
return true;
12981299

12991300
/*
1300-
* Even if the point-flag is not set, all the lower-left coordinates
1301-
* might match the upper-right coordinates, so that the value is in
1302-
* fact a point. Such values don't arise with current code - the point
1303-
* flag is always set if appropriate - but they might be present on-disk
1304-
* in clusters upgraded from pre-9.4 versions.
1301+
* Even if the point-flag is not set, all the lower-left coordinates might
1302+
* match the upper-right coordinates, so that the value is in fact a
1303+
* point. Such values don't arise with current code - the point flag is
1304+
* always set if appropriate - but they might be present on-disk in
1305+
* clusters upgraded from pre-9.4 versions.
13051306
*/
13061307
for (i = 0; i < DIM(cube); i++)
13071308
{
@@ -1317,6 +1318,7 @@ cube_dim(PG_FUNCTION_ARGS)
13171318
{
13181319
NDBOX *c = PG_GETARG_NDBOX(0);
13191320
int dim = DIM(c);
1321+
13201322
PG_FREE_IF_COPY(c, 0);
13211323
PG_RETURN_INT32(dim);
13221324
}
@@ -1330,7 +1332,7 @@ cube_ll_coord(PG_FUNCTION_ARGS)
13301332
double result;
13311333

13321334
if (DIM(c) >= n && n > 0)
1333-
result = Min(LL_COORD(c, n-1), UR_COORD(c, n-1));
1335+
result = Min(LL_COORD(c, n - 1), UR_COORD(c, n - 1));
13341336
else
13351337
result = 0;
13361338

@@ -1347,7 +1349,7 @@ cube_ur_coord(PG_FUNCTION_ARGS)
13471349
double result;
13481350

13491351
if (DIM(c) >= n && n > 0)
1350-
result = Max(LL_COORD(c, n-1), UR_COORD(c, n-1));
1352+
result = Max(LL_COORD(c, n - 1), UR_COORD(c, n - 1));
13511353
else
13521354
result = 0;
13531355

@@ -1382,15 +1384,15 @@ cube_enlarge(PG_FUNCTION_ARGS)
13821384

13831385
for (i = 0, j = dim; i < DIM(a); i++, j++)
13841386
{
1385-
if (LL_COORD(a,i) >= UR_COORD(a,i))
1387+
if (LL_COORD(a, i) >= UR_COORD(a, i))
13861388
{
1387-
result->x[i] = UR_COORD(a,i) - r;
1388-
result->x[j] = LL_COORD(a,i) + r;
1389+
result->x[i] = UR_COORD(a, i) - r;
1390+
result->x[j] = LL_COORD(a, i) + r;
13891391
}
13901392
else
13911393
{
1392-
result->x[i] = LL_COORD(a,i) - r;
1393-
result->x[j] = UR_COORD(a,i) + r;
1394+
result->x[i] = LL_COORD(a, i) - r;
1395+
result->x[j] = UR_COORD(a, i) + r;
13941396
}
13951397
if (result->x[i] > result->x[j])
13961398
{
@@ -1503,7 +1505,7 @@ cube_c_f8(PG_FUNCTION_ARGS)
15031505
result->x[DIM(result) + i] = cube->x[DIM(cube) + i];
15041506
}
15051507
result->x[DIM(result) - 1] = x;
1506-
result->x[2*DIM(result) - 1] = x;
1508+
result->x[2 * DIM(result) - 1] = x;
15071509
}
15081510

15091511
PG_FREE_IF_COPY(cube, 0);
@@ -1521,7 +1523,8 @@ cube_c_f8_f8(PG_FUNCTION_ARGS)
15211523
int size;
15221524
int i;
15231525

1524-
if (IS_POINT(cube) && (x1 == x2)){
1526+
if (IS_POINT(cube) && (x1 == x2))
1527+
{
15251528
size = POINT_SIZE((DIM(cube) + 1));
15261529
result = (NDBOX *) palloc0(size);
15271530
SET_VARSIZE(result, size);

contrib/cube/cubedata.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ typedef struct NDBOX
1313
*
1414
* Following information is stored:
1515
*
16-
* bits 0-7 : number of cube dimensions;
17-
* bits 8-30 : unused, initialize to zero;
18-
* bit 31 : point flag. If set, the upper right coordinates are not
16+
* bits 0-7 : number of cube dimensions;
17+
* bits 8-30 : unused, initialize to zero;
18+
* bit 31 : point flag. If set, the upper right coordinates are not
1919
* stored, and are implicitly the same as the lower left
2020
* coordinates.
2121
*----------
@@ -31,12 +31,12 @@ typedef struct NDBOX
3131
} NDBOX;
3232

3333
#define POINT_BIT 0x80000000
34-
#define DIM_MASK 0x7fffffff
34+
#define DIM_MASK 0x7fffffff
3535

3636
#define IS_POINT(cube) ( ((cube)->header & POINT_BIT) != 0 )
37-
#define SET_POINT_BIT(cube) ( (cube)->header |= POINT_BIT )
37+
#define SET_POINT_BIT(cube) ( (cube)->header |= POINT_BIT )
3838
#define DIM(cube) ( (cube)->header & DIM_MASK )
39-
#define SET_DIM(cube, _dim) ( (cube)->header = ((cube)->header & ~DIM_MASK) | (_dim) )
39+
#define SET_DIM(cube, _dim) ( (cube)->header = ((cube)->header & ~DIM_MASK) | (_dim) )
4040

4141
#define LL_COORD(cube, i) ( (cube)->x[i] )
4242
#define UR_COORD(cube, i) ( IS_POINT(cube) ? (cube)->x[i] : (cube)->x[(i) + DIM(cube)] )

contrib/dblink/dblink.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2394,7 +2394,7 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk
23942394
* Build sql statement to look up tuple of interest, ie, the one matching
23952395
* src_pkattvals. We used to use "SELECT *" here, but it's simpler to
23962396
* generate a result tuple that matches the table's physical structure,
2397-
* with NULLs for any dropped columns. Otherwise we have to deal with two
2397+
* with NULLs for any dropped columns. Otherwise we have to deal with two
23982398
* different tupdescs and everything's very confusing.
23992399
*/
24002400
appendStringInfoString(&buf, "SELECT ");
@@ -2620,7 +2620,7 @@ dblink_security_check(PGconn *conn, remoteConn *rconn)
26202620
}
26212621

26222622
/*
2623-
* For non-superusers, insist that the connstr specify a password. This
2623+
* For non-superusers, insist that the connstr specify a password. This
26242624
* prevents a password from being picked up from .pgpass, a service file,
26252625
* the environment, etc. We don't want the postgres user's passwords
26262626
* to be accessible to non-superusers.

contrib/earthdistance/earthdistance.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ geo_distance_internal(Point *pt1, Point *pt2)
9191
* distance between the points in miles on earth's surface
9292
*
9393
* If float8 is passed-by-value, the oldstyle version-0 calling convention
94-
* is unportable, so we use version-1. However, if it's passed-by-reference,
94+
* is unportable, so we use version-1. However, if it's passed-by-reference,
9595
* continue to use oldstyle. This is just because we'd like earthdistance
9696
* to serve as a canary for any unintentional breakage of version-0 functions
9797
* with float8 results.

contrib/file_fdw/file_fdw.c

+11-6
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ static const struct FileFdwOption valid_options[] = {
7070
{"encoding", ForeignTableRelationId},
7171
{"force_not_null", AttributeRelationId},
7272
{"force_null", AttributeRelationId},
73+
7374
/*
7475
* force_quote is not supported by file_fdw because it's for COPY TO.
7576
*/
@@ -253,6 +254,7 @@ file_fdw_validator(PG_FUNCTION_ARGS)
253254
errmsg("conflicting or redundant options")));
254255
filename = defGetString(def);
255256
}
257+
256258
/*
257259
* force_not_null is a boolean option; after validation we can discard
258260
* it - it will be retrieved later in get_file_fdw_attribute_options()
@@ -397,7 +399,7 @@ get_file_fdw_attribute_options(Oid relid)
397399
List *fnncolumns = NIL;
398400
List *fncolumns = NIL;
399401

400-
List *options = NIL;
402+
List *options = NIL;
401403

402404
rel = heap_open(relid, AccessShareLock);
403405
tupleDesc = RelationGetDescr(rel);
@@ -443,12 +445,15 @@ get_file_fdw_attribute_options(Oid relid)
443445

444446
heap_close(rel, AccessShareLock);
445447

446-
/* Return DefElem only when some column(s) have force_not_null / force_null options set */
448+
/*
449+
* Return DefElem only when some column(s) have force_not_null /
450+
* force_null options set
451+
*/
447452
if (fnncolumns != NIL)
448453
options = lappend(options, makeDefElem("force_not_null", (Node *) fnncolumns));
449454

450455
if (fncolumns != NIL)
451-
options = lappend(options,makeDefElem("force_null", (Node *) fncolumns));
456+
options = lappend(options, makeDefElem("force_null", (Node *) fncolumns));
452457

453458
return options;
454459
}
@@ -508,7 +513,7 @@ fileGetForeignPaths(PlannerInfo *root,
508513
&startup_cost, &total_cost);
509514

510515
/*
511-
* Create a ForeignPath node and add it as only possible path. We use the
516+
* Create a ForeignPath node and add it as only possible path. We use the
512517
* fdw_private list of the path to carry the convert_selectively option;
513518
* it will be propagated into the fdw_private list of the Plan node.
514519
*/
@@ -921,7 +926,7 @@ estimate_size(PlannerInfo *root, RelOptInfo *baserel,
921926
* planner's idea of the relation width; which is bogus if not all
922927
* columns are being read, not to mention that the text representation
923928
* of a row probably isn't the same size as its internal
924-
* representation. Possibly we could do something better, but the
929+
* representation. Possibly we could do something better, but the
925930
* real answer to anyone who complains is "ANALYZE" ...
926931
*/
927932
int tuple_width;
@@ -986,7 +991,7 @@ estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
986991
* which must have at least targrows entries.
987992
* The actual number of rows selected is returned as the function result.
988993
* We also count the total number of rows in the file and return it into
989-
* *totalrows. Note that *totaldeadrows is always set to 0.
994+
* *totalrows. Note that *totaldeadrows is always set to 0.
990995
*
991996
* Note that the returned list of rows is not always in order by physical
992997
* position in the file. Therefore, correlation estimates derived later

0 commit comments

Comments
 (0)