Skip to content

Commit 382ceff

Browse files
committed
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they flow past the right margin. By default, BSD indent lines up statement continuation lines that are within parentheses so that they start just to the right of the preceding left parenthesis. However, traditionally, if that resulted in the continuation line extending to the right of the desired right margin, then indent would push it left just far enough to not overrun the margin, if it could do so without making the continuation line start to the left of the current statement indent. That makes for a weird mix of indentations unless one has been completely rigid about never violating the 80-column limit. This behavior has been pretty universally panned by Postgres developers. Hence, disable it with indent's new -lpl switch, so that parenthesized lines are always lined up with the preceding left paren. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/[email protected] Discussion: https://postgr.es/m/[email protected]
1 parent c7b8998 commit 382ceff

File tree

568 files changed

+4747
-4745
lines changed

Some content is hidden

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

568 files changed

+4747
-4745
lines changed

contrib/adminpack/adminpack.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ convert_and_check_filename(text *arg, bool logAllowed)
7474
if (path_contains_parent_reference(filename))
7575
ereport(ERROR,
7676
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
77-
(errmsg("reference to parent directory (\"..\") not allowed"))));
77+
(errmsg("reference to parent directory (\"..\") not allowed"))));
7878

7979
/*
8080
* Allow absolute paths if within DataDir or Log_directory, even
@@ -105,7 +105,7 @@ requireSuperuser(void)
105105
if (!superuser())
106106
ereport(ERROR,
107107
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
108-
(errmsg("only superuser may access generic file functions"))));
108+
(errmsg("only superuser may access generic file functions"))));
109109
}
110110

111111

contrib/amcheck/verify_nbtree.c

+31-31
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ btree_index_checkable(Relation rel)
240240
ereport(ERROR,
241241
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
242242
errmsg("cannot access temporary tables of other sessions"),
243-
errdetail("Index \"%s\" is associated with temporary relation.",
244-
RelationGetRelationName(rel))));
243+
errdetail("Index \"%s\" is associated with temporary relation.",
244+
RelationGetRelationName(rel))));
245245

246246
if (!IndexIsValid(rel->rd_index))
247247
ereport(ERROR,
@@ -411,12 +411,12 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
411411
ereport(ERROR,
412412
(errcode(ERRCODE_INDEX_CORRUPTED),
413413
errmsg("block %u fell off the end of index \"%s\"",
414-
current, RelationGetRelationName(state->rel))));
414+
current, RelationGetRelationName(state->rel))));
415415
else
416416
ereport(DEBUG1,
417417
(errcode(ERRCODE_NO_DATA),
418418
errmsg("block %u of index \"%s\" ignored",
419-
current, RelationGetRelationName(state->rel))));
419+
current, RelationGetRelationName(state->rel))));
420420
goto nextpage;
421421
}
422422
else if (nextleveldown.leftmost == InvalidBlockNumber)
@@ -433,14 +433,14 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
433433
if (!P_LEFTMOST(opaque))
434434
ereport(ERROR,
435435
(errcode(ERRCODE_INDEX_CORRUPTED),
436-
errmsg("block %u is not leftmost in index \"%s\"",
437-
current, RelationGetRelationName(state->rel))));
436+
errmsg("block %u is not leftmost in index \"%s\"",
437+
current, RelationGetRelationName(state->rel))));
438438

439439
if (level.istruerootlevel && !P_ISROOT(opaque))
440440
ereport(ERROR,
441441
(errcode(ERRCODE_INDEX_CORRUPTED),
442-
errmsg("block %u is not true root in index \"%s\"",
443-
current, RelationGetRelationName(state->rel))));
442+
errmsg("block %u is not true root in index \"%s\"",
443+
current, RelationGetRelationName(state->rel))));
444444
}
445445

446446
/*
@@ -488,7 +488,7 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
488488
errmsg("left link/right link pair in index \"%s\" not in agreement",
489489
RelationGetRelationName(state->rel)),
490490
errdetail_internal("Block=%u left block=%u left link from block=%u.",
491-
current, leftcurrent, opaque->btpo_prev)));
491+
current, leftcurrent, opaque->btpo_prev)));
492492

493493
/* Check level, which must be valid for non-ignorable page */
494494
if (level.level != opaque->btpo.level)
@@ -497,7 +497,7 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
497497
errmsg("leftmost down link for level points to block in index \"%s\" whose level is not one level down",
498498
RelationGetRelationName(state->rel)),
499499
errdetail_internal("Block pointed to=%u expected level=%u level in pointed to block=%u.",
500-
current, level.level, opaque->btpo.level)));
500+
current, level.level, opaque->btpo.level)));
501501

502502
/* Verify invariants for page -- all important checks occur here */
503503
bt_target_page_check(state);
@@ -508,8 +508,8 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
508508
if (current == leftcurrent || current == opaque->btpo_prev)
509509
ereport(ERROR,
510510
(errcode(ERRCODE_INDEX_CORRUPTED),
511-
errmsg("circular link chain found in block %u of index \"%s\"",
512-
current, RelationGetRelationName(state->rel))));
511+
errmsg("circular link chain found in block %u of index \"%s\"",
512+
current, RelationGetRelationName(state->rel))));
513513

514514
leftcurrent = current;
515515
current = opaque->btpo_next;
@@ -665,17 +665,17 @@ bt_target_page_check(BtreeCheckState *state)
665665
(errcode(ERRCODE_INDEX_CORRUPTED),
666666
errmsg("item order invariant violated for index \"%s\"",
667667
RelationGetRelationName(state->rel)),
668-
errdetail_internal("Lower index tid=%s (points to %s tid=%s) "
669-
"higher index tid=%s (points to %s tid=%s) "
670-
"page lsn=%X/%X.",
671-
itid,
672-
P_ISLEAF(topaque) ? "heap" : "index",
673-
htid,
674-
nitid,
675-
P_ISLEAF(topaque) ? "heap" : "index",
676-
nhtid,
677-
(uint32) (state->targetlsn >> 32),
678-
(uint32) state->targetlsn)));
668+
errdetail_internal("Lower index tid=%s (points to %s tid=%s) "
669+
"higher index tid=%s (points to %s tid=%s) "
670+
"page lsn=%X/%X.",
671+
itid,
672+
P_ISLEAF(topaque) ? "heap" : "index",
673+
htid,
674+
nitid,
675+
P_ISLEAF(topaque) ? "heap" : "index",
676+
nhtid,
677+
(uint32) (state->targetlsn >> 32),
678+
(uint32) state->targetlsn)));
679679
}
680680

681681
/*
@@ -824,7 +824,7 @@ bt_right_page_check_scankey(BtreeCheckState *state)
824824
ereport(DEBUG1,
825825
(errcode(ERRCODE_NO_DATA),
826826
errmsg("level %u leftmost page of index \"%s\" was found deleted or half dead",
827-
opaque->btpo.level, RelationGetRelationName(state->rel)),
827+
opaque->btpo.level, RelationGetRelationName(state->rel)),
828828
errdetail_internal("Deleted page found when building scankey from right sibling.")));
829829

830830
/* Be slightly more pro-active in freeing this memory, just in case */
@@ -1053,7 +1053,7 @@ bt_downlink_check(BtreeCheckState *state, BlockNumber childblock,
10531053
errmsg("down-link lower bound invariant violated for index \"%s\"",
10541054
RelationGetRelationName(state->rel)),
10551055
errdetail_internal("Parent block=%u child index tid=(%u,%u) parent page lsn=%X/%X.",
1056-
state->targetblock, childblock, offset,
1056+
state->targetblock, childblock, offset,
10571057
(uint32) (state->targetlsn >> 32),
10581058
(uint32) state->targetlsn)));
10591059
}
@@ -1228,21 +1228,21 @@ palloc_btree_page(BtreeCheckState *state, BlockNumber blocknum)
12281228
if (P_ISLEAF(opaque) && !P_ISDELETED(opaque) && opaque->btpo.level != 0)
12291229
ereport(ERROR,
12301230
(errcode(ERRCODE_INDEX_CORRUPTED),
1231-
errmsg("invalid leaf page level %u for block %u in index \"%s\"",
1232-
opaque->btpo.level, blocknum, RelationGetRelationName(state->rel))));
1231+
errmsg("invalid leaf page level %u for block %u in index \"%s\"",
1232+
opaque->btpo.level, blocknum, RelationGetRelationName(state->rel))));
12331233

12341234
if (blocknum != BTREE_METAPAGE && !P_ISLEAF(opaque) &&
12351235
!P_ISDELETED(opaque) && opaque->btpo.level == 0)
12361236
ereport(ERROR,
12371237
(errcode(ERRCODE_INDEX_CORRUPTED),
1238-
errmsg("invalid internal page level 0 for block %u in index \"%s\"",
1239-
opaque->btpo.level, RelationGetRelationName(state->rel))));
1238+
errmsg("invalid internal page level 0 for block %u in index \"%s\"",
1239+
opaque->btpo.level, RelationGetRelationName(state->rel))));
12401240

12411241
if (!P_ISLEAF(opaque) && P_HAS_GARBAGE(opaque))
12421242
ereport(ERROR,
12431243
(errcode(ERRCODE_INDEX_CORRUPTED),
1244-
errmsg("internal page block %u in index \"%s\" has garbage items",
1245-
blocknum, RelationGetRelationName(state->rel))));
1244+
errmsg("internal page block %u in index \"%s\" has garbage items",
1245+
blocknum, RelationGetRelationName(state->rel))));
12461246

12471247
return page;
12481248
}

contrib/auth_delay/auth_delay.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ _PG_init(void)
5757
{
5858
/* Define custom GUC variables */
5959
DefineCustomIntVariable("auth_delay.milliseconds",
60-
"Milliseconds to delay before reporting authentication failure",
60+
"Milliseconds to delay before reporting authentication failure",
6161
NULL,
6262
&auth_delay_milliseconds,
6363
0,

contrib/auto_explain/auto_explain.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ _PG_init(void)
7474
{
7575
/* Define custom GUC variables. */
7676
DefineCustomIntVariable("auto_explain.log_min_duration",
77-
"Sets the minimum execution time above which plans will be logged.",
78-
"Zero prints all plans. -1 turns this feature off.",
77+
"Sets the minimum execution time above which plans will be logged.",
78+
"Zero prints all plans. -1 turns this feature off.",
7979
&auto_explain_log_min_duration,
8080
-1,
8181
-1, INT_MAX / 1000,
@@ -120,7 +120,7 @@ _PG_init(void)
120120

121121
DefineCustomBoolVariable("auto_explain.log_triggers",
122122
"Include trigger statistics in plans.",
123-
"This has no effect unless log_analyze is also set.",
123+
"This has no effect unless log_analyze is also set.",
124124
&auto_explain_log_triggers,
125125
false,
126126
PGC_SUSET,

contrib/bloom/bloom.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ typedef struct BloomOptions
111111
*/
112112
typedef BlockNumber FreeBlockNumberArray[
113113
MAXALIGN_DOWN(
114-
BLCKSZ - SizeOfPageHeaderData - MAXALIGN(sizeof(BloomPageOpaqueData))
115-
- MAXALIGN(sizeof(uint16) * 2 + sizeof(uint32) + sizeof(BloomOptions))
114+
BLCKSZ - SizeOfPageHeaderData - MAXALIGN(sizeof(BloomPageOpaqueData))
115+
- MAXALIGN(sizeof(uint16) * 2 + sizeof(uint32) + sizeof(BloomOptions))
116116
) / sizeof(BlockNumber)
117117
];
118118

contrib/bloom/blvacuum.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ blbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
8484
*/
8585
itup = itupPtr = BloomPageGetTuple(&state, page, FirstOffsetNumber);
8686
itupEnd = BloomPageGetTuple(&state, page,
87-
OffsetNumberNext(BloomPageGetMaxOffset(page)));
87+
OffsetNumberNext(BloomPageGetMaxOffset(page)));
8888
while (itup < itupEnd)
8989
{
9090
/* Do we have to delete this tuple? */
@@ -108,7 +108,7 @@ blbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
108108

109109
/* Assert that we counted correctly */
110110
Assert(itupPtr == BloomPageGetTuple(&state, page,
111-
OffsetNumberNext(BloomPageGetMaxOffset(page))));
111+
OffsetNumberNext(BloomPageGetMaxOffset(page))));
112112

113113
/*
114114
* Add page to new notFullPage list if we will not mark page as

contrib/btree_gin/btree_gin.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ gin_btree_compare_prefix(FunctionCallInfo fcinfo)
115115
data->typecmp,
116116
fcinfo->flinfo,
117117
PG_GET_COLLATION(),
118-
(data->strategy == BTLessStrategyNumber ||
119-
data->strategy == BTLessEqualStrategyNumber)
118+
(data->strategy == BTLessStrategyNumber ||
119+
data->strategy == BTLessEqualStrategyNumber)
120120
? data->datum : a,
121121
b));
122122

contrib/btree_gist/btree_cash.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ Datum
203203
gbt_cash_picksplit(PG_FUNCTION_ARGS)
204204
{
205205
PG_RETURN_POINTER(gbt_num_picksplit(
206-
(GistEntryVector *) PG_GETARG_POINTER(0),
207-
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
206+
(GistEntryVector *) PG_GETARG_POINTER(0),
207+
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
208208
&tinfo, fcinfo->flinfo
209209
));
210210
}

contrib/btree_gist/btree_date.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ gdb_date_dist(const void *a, const void *b, FmgrInfo *flinfo)
8787
{
8888
/* we assume the difference can't overflow */
8989
Datum diff = DirectFunctionCall2(date_mi,
90-
DateADTGetDatum(*((const DateADT *) a)),
91-
DateADTGetDatum(*((const DateADT *) b)));
90+
DateADTGetDatum(*((const DateADT *) a)),
91+
DateADTGetDatum(*((const DateADT *) b)));
9292

9393
return (float8) Abs(DatumGetInt32(diff));
9494
}
@@ -210,14 +210,14 @@ gbt_date_penalty(PG_FUNCTION_ARGS)
210210
diff = DatumGetInt32(DirectFunctionCall2(
211211
date_mi,
212212
DateADTGetDatum(newentry->upper),
213-
DateADTGetDatum(origentry->upper)));
213+
DateADTGetDatum(origentry->upper)));
214214

215215
res = Max(diff, 0);
216216

217217
diff = DatumGetInt32(DirectFunctionCall2(
218218
date_mi,
219-
DateADTGetDatum(origentry->lower),
220-
DateADTGetDatum(newentry->lower)));
219+
DateADTGetDatum(origentry->lower),
220+
DateADTGetDatum(newentry->lower)));
221221

222222
res += Max(diff, 0);
223223

@@ -227,8 +227,8 @@ gbt_date_penalty(PG_FUNCTION_ARGS)
227227
{
228228
diff = DatumGetInt32(DirectFunctionCall2(
229229
date_mi,
230-
DateADTGetDatum(origentry->upper),
231-
DateADTGetDatum(origentry->lower)));
230+
DateADTGetDatum(origentry->upper),
231+
DateADTGetDatum(origentry->lower)));
232232
*result += FLT_MIN;
233233
*result += (float) (res / ((double) (res + diff)));
234234
*result *= (FLT_MAX / (((GISTENTRY *) PG_GETARG_POINTER(0))->rel->rd_att->natts + 1));
@@ -242,8 +242,8 @@ Datum
242242
gbt_date_picksplit(PG_FUNCTION_ARGS)
243243
{
244244
PG_RETURN_POINTER(gbt_num_picksplit(
245-
(GistEntryVector *) PG_GETARG_POINTER(0),
246-
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
245+
(GistEntryVector *) PG_GETARG_POINTER(0),
246+
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
247247
&tinfo, fcinfo->flinfo
248248
));
249249
}

contrib/btree_gist/btree_enum.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ Datum
169169
gbt_enum_picksplit(PG_FUNCTION_ARGS)
170170
{
171171
PG_RETURN_POINTER(gbt_num_picksplit(
172-
(GistEntryVector *) PG_GETARG_POINTER(0),
173-
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
172+
(GistEntryVector *) PG_GETARG_POINTER(0),
173+
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
174174
&tinfo, fcinfo->flinfo
175175
));
176176
}

contrib/btree_gist/btree_float4.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ Datum
196196
gbt_float4_picksplit(PG_FUNCTION_ARGS)
197197
{
198198
PG_RETURN_POINTER(gbt_num_picksplit(
199-
(GistEntryVector *) PG_GETARG_POINTER(0),
200-
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
199+
(GistEntryVector *) PG_GETARG_POINTER(0),
200+
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
201201
&tinfo, fcinfo->flinfo
202202
));
203203
}

contrib/btree_gist/btree_float8.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ Datum
203203
gbt_float8_picksplit(PG_FUNCTION_ARGS)
204204
{
205205
PG_RETURN_POINTER(gbt_num_picksplit(
206-
(GistEntryVector *) PG_GETARG_POINTER(0),
207-
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
206+
(GistEntryVector *) PG_GETARG_POINTER(0),
207+
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
208208
&tinfo, fcinfo->flinfo
209209
));
210210
}

contrib/btree_gist/btree_inet.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ gbt_inet_consistent(PG_FUNCTION_ARGS)
133133
key.upper = (GBT_NUMKEY *) &kkk->upper;
134134

135135
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query,
136-
&strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
136+
&strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
137137
}
138138

139139

@@ -165,8 +165,8 @@ Datum
165165
gbt_inet_picksplit(PG_FUNCTION_ARGS)
166166
{
167167
PG_RETURN_POINTER(gbt_num_picksplit(
168-
(GistEntryVector *) PG_GETARG_POINTER(0),
169-
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
168+
(GistEntryVector *) PG_GETARG_POINTER(0),
169+
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
170170
&tinfo, fcinfo->flinfo
171171
));
172172
}

contrib/btree_gist/btree_int2.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ Datum
202202
gbt_int2_picksplit(PG_FUNCTION_ARGS)
203203
{
204204
PG_RETURN_POINTER(gbt_num_picksplit(
205-
(GistEntryVector *) PG_GETARG_POINTER(0),
206-
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
205+
(GistEntryVector *) PG_GETARG_POINTER(0),
206+
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
207207
&tinfo, fcinfo->flinfo
208208
));
209209
}

contrib/btree_gist/btree_int4.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ Datum
203203
gbt_int4_picksplit(PG_FUNCTION_ARGS)
204204
{
205205
PG_RETURN_POINTER(gbt_num_picksplit(
206-
(GistEntryVector *) PG_GETARG_POINTER(0),
207-
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
206+
(GistEntryVector *) PG_GETARG_POINTER(0),
207+
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
208208
&tinfo, fcinfo->flinfo
209209
));
210210
}

contrib/btree_gist/btree_int8.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ Datum
203203
gbt_int8_picksplit(PG_FUNCTION_ARGS)
204204
{
205205
PG_RETURN_POINTER(gbt_num_picksplit(
206-
(GistEntryVector *) PG_GETARG_POINTER(0),
207-
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
206+
(GistEntryVector *) PG_GETARG_POINTER(0),
207+
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
208208
&tinfo, fcinfo->flinfo
209209
));
210210
}

contrib/btree_gist/btree_interval.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ Datum
285285
gbt_intv_picksplit(PG_FUNCTION_ARGS)
286286
{
287287
PG_RETURN_POINTER(gbt_num_picksplit(
288-
(GistEntryVector *) PG_GETARG_POINTER(0),
289-
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
288+
(GistEntryVector *) PG_GETARG_POINTER(0),
289+
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
290290
&tinfo, fcinfo->flinfo
291291
));
292292
}

0 commit comments

Comments
 (0)