Skip to content

Commit 5cbfce5

Browse files
committed
Initial pgindent and pgperltidy run for v13.
Includes some manual cleanup of places that pgindent messed up, most of which weren't per project style anyway. Notably, it seems some people didn't absorb the style rules of commit c9d2977, because there were a bunch of new occurrences of function calls with a newline just after the left paren, all with faulty expectations about how the rest of the call would get indented.
1 parent 1255466 commit 5cbfce5

File tree

198 files changed

+2021
-1788
lines changed

Some content is hidden

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

198 files changed

+2021
-1788
lines changed

contrib/adminpack/adminpack.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Datum
217217
pg_file_sync(PG_FUNCTION_ARGS)
218218
{
219219
char *filename;
220-
struct stat fst;
220+
struct stat fst;
221221

222222
filename = convert_and_check_filename(PG_GETARG_TEXT_PP(0));
223223

contrib/intarray/_int_bool.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ checkcondition_arr(void *checkval, ITEM *item, void *options)
256256
static bool
257257
checkcondition_bit(void *checkval, ITEM *item, void *siglen)
258258
{
259-
return GETBIT(checkval, HASHVAL(item->val, (int)(intptr_t) siglen));
259+
return GETBIT(checkval, HASHVAL(item->val, (int) (intptr_t) siglen));
260260
}
261261

262262
/*
@@ -300,7 +300,7 @@ bool
300300
signconsistent(QUERYTYPE *query, BITVECP sign, int siglen, bool calcnot)
301301
{
302302
return execute(GETQUERY(query) + query->size - 1,
303-
(void *) sign, (void *)(intptr_t) siglen, calcnot,
303+
(void *) sign, (void *) (intptr_t) siglen, calcnot,
304304
checkcondition_bit);
305305
}
306306

contrib/ltree/_ltree_gist.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,8 @@ gist_te(ltree_gist *key, ltree *query, int siglen)
407407

408408
typedef struct LtreeSignature
409409
{
410-
BITVECP sign;
411-
int siglen;
410+
BITVECP sign;
411+
int siglen;
412412
} LtreeSignature;
413413

414414
static bool

contrib/ltree/ltree.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ typedef struct
272272
#define LTG_GETRNODE(x, siglen) ( LTG_ISONENODE(x) ? LTG_NODE(x) : LTG_RNODE(x, siglen) )
273273

274274
extern ltree_gist *ltree_gist_alloc(bool isalltrue, BITVECP sign, int siglen,
275-
ltree *left, ltree *right);
275+
ltree *left, ltree *right);
276276

277277
/* GiST support for ltree[] */
278278

contrib/ltree/ltree_gist.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ltree_gist_alloc(bool isalltrue, BITVECP sign, int siglen,
4040
ltree *left, ltree *right)
4141
{
4242
int32 size = LTG_HDRSIZE + (isalltrue ? 0 : siglen) +
43-
(left ? VARSIZE(left) + (right ? VARSIZE(right) : 0) : 0);
43+
(left ? VARSIZE(left) + (right ? VARSIZE(right) : 0) : 0);
4444
ltree_gist *result = palloc(size);
4545

4646
SET_VARSIZE(result, size);
@@ -557,8 +557,8 @@ gist_between(ltree_gist *key, lquery *query, int siglen)
557557

558558
typedef struct LtreeSignature
559559
{
560-
BITVECP sign;
561-
int siglen;
560+
BITVECP sign;
561+
int siglen;
562562
} LtreeSignature;
563563

564564
static bool

contrib/pg_stat_statements/pg_stat_statements.c

+1
Original file line numberDiff line numberDiff line change
@@ -2681,6 +2681,7 @@ JumbleRowMarks(pgssJumbleState *jstate, List *rowMarks)
26812681
foreach(lc, rowMarks)
26822682
{
26832683
RowMarkClause *rowmark = lfirst_node(RowMarkClause, lc);
2684+
26842685
if (!rowmark->pushedDown)
26852686
{
26862687
APP_JUMB(rowmark->rti);

contrib/pg_visibility/pg_visibility.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ pg_truncate_visibility_map(PG_FUNCTION_ARGS)
384384
Oid relid = PG_GETARG_OID(0);
385385
Relation rel;
386386
ForkNumber fork;
387-
BlockNumber block;
387+
BlockNumber block;
388388

389389
rel = relation_open(relid, AccessExclusiveLock);
390390

contrib/postgres_fdw/connection.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ connect_pg_server(ForeignServer *server, UserMapping *user)
303303
/*
304304
* Check that non-superuser has used password to establish connection;
305305
* otherwise, he's piggybacking on the postgres server's user
306-
* identity. See also dblink_security_check() in contrib/dblink
307-
* and check_conn_params.
306+
* identity. See also dblink_security_check() in contrib/dblink and
307+
* check_conn_params.
308308
*/
309309
if (!superuser_arg(user->userid) && UserMappingPasswordRequired(user) &&
310310
!PQconnectionUsedPassword(conn))
@@ -361,6 +361,7 @@ UserMappingPasswordRequired(UserMapping *user)
361361
foreach(cell, user->options)
362362
{
363363
DefElem *def = (DefElem *) lfirst(cell);
364+
364365
if (strcmp(def->defname, "password_required") == 0)
365366
return defGetBoolean(def);
366367
}

contrib/postgres_fdw/option.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ postgres_fdw_validator(PG_FUNCTION_ARGS)
144144
}
145145
else if (strcmp(def->defname, "password_required") == 0)
146146
{
147-
bool pw_required = defGetBoolean(def);
147+
bool pw_required = defGetBoolean(def);
148148

149149
/*
150150
* Only the superuser may set this option on a user mapping, or
151151
* alter a user mapping on which this option is set. We allow a
152-
* user to clear this option if it's set - in fact, we don't have a
153-
* choice since we can't see the old mapping when validating an
152+
* user to clear this option if it's set - in fact, we don't have
153+
* a choice since we can't see the old mapping when validating an
154154
* alter.
155155
*/
156156
if (!superuser() && !pw_required)
@@ -204,11 +204,11 @@ InitPgFdwOptions(void)
204204
{"fetch_size", ForeignServerRelationId, false},
205205
{"fetch_size", ForeignTableRelationId, false},
206206
{"password_required", UserMappingRelationId, false},
207+
207208
/*
208209
* sslcert and sslkey are in fact libpq options, but we repeat them
209-
* here to allow them to appear in both foreign server context
210-
* (when we generate libpq options) and user mapping context
211-
* (from here).
210+
* here to allow them to appear in both foreign server context (when
211+
* we generate libpq options) and user mapping context (from here).
212212
*/
213213
{"sslcert", UserMappingRelationId, true},
214214
{"sslkey", UserMappingRelationId, true},

doc/src/sgml/mk_feature_tables.pl

+4-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@
5555
print " <entry>$feature_id</entry>\n";
5656
}
5757
print " <entry>",
58-
defined($feature_packages{$feature_id}) ? $feature_packages{$feature_id} : "",
59-
"</entry>\n";
58+
defined($feature_packages{$feature_id})
59+
? $feature_packages{$feature_id}
60+
: "",
61+
"</entry>\n";
6062
if ($subfeature_id)
6163
{
6264
print " <entry>$subfeature_name</entry>\n";

src/backend/access/common/detoast.c

+10-9
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ detoast_attr(struct varlena *attr)
201201
*/
202202
struct varlena *
203203
detoast_attr_slice(struct varlena *attr,
204-
int32 sliceoffset, int32 slicelength)
204+
int32 sliceoffset, int32 slicelength)
205205
{
206206
struct varlena *preslice;
207207
struct varlena *result;
@@ -220,12 +220,12 @@ detoast_attr_slice(struct varlena *attr,
220220

221221
/*
222222
* For compressed values, we need to fetch enough slices to decompress
223-
* at least the requested part (when a prefix is requested). Otherwise,
224-
* just fetch all slices.
223+
* at least the requested part (when a prefix is requested).
224+
* Otherwise, just fetch all slices.
225225
*/
226226
if (slicelength > 0 && sliceoffset >= 0)
227227
{
228-
int32 max_size;
228+
int32 max_size;
229229

230230
/*
231231
* Determine maximum amount of compressed data needed for a prefix
@@ -253,7 +253,7 @@ detoast_attr_slice(struct varlena *attr,
253253
Assert(!VARATT_IS_EXTERNAL_INDIRECT(redirect.pointer));
254254

255255
return detoast_attr_slice(redirect.pointer,
256-
sliceoffset, slicelength);
256+
sliceoffset, slicelength);
257257
}
258258
else if (VARATT_IS_EXTERNAL_EXPANDED(attr))
259259
{
@@ -343,7 +343,8 @@ toast_fetch_datum(struct varlena *attr)
343343
SET_VARSIZE(result, attrsize + VARHDRSZ);
344344

345345
if (attrsize == 0)
346-
return result; /* Probably shouldn't happen, but just in case. */
346+
return result; /* Probably shouldn't happen, but just in
347+
* case. */
347348

348349
/*
349350
* Open the toast relation and its indexes
@@ -387,9 +388,9 @@ toast_fetch_datum_slice(struct varlena *attr, int32 sliceoffset,
387388
VARATT_EXTERNAL_GET_POINTER(toast_pointer, attr);
388389

389390
/*
390-
* It's nonsense to fetch slices of a compressed datum unless when it's
391-
* a prefix -- this isn't lo_* we can't return a compressed datum which
392-
* is meaningful to toast later.
391+
* It's nonsense to fetch slices of a compressed datum unless when it's a
392+
* prefix -- this isn't lo_* we can't return a compressed datum which is
393+
* meaningful to toast later.
393394
*/
394395
Assert(!VARATT_EXTERNAL_IS_COMPRESSED(toast_pointer) || 0 == sliceoffset);
395396

src/backend/access/gist/gist.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -1347,8 +1347,8 @@ gistfinishsplit(GISTInsertState *state, GISTInsertStack *stack,
13471347
left->buf, right->buf, false, false))
13481348
{
13491349
/*
1350-
* If the parent page was split, the existing downlink might
1351-
* have moved.
1350+
* If the parent page was split, the existing downlink might have
1351+
* moved.
13521352
*/
13531353
stack->downlinkoffnum = InvalidOffsetNumber;
13541354
}
@@ -1370,9 +1370,10 @@ gistfinishsplit(GISTInsertState *state, GISTInsertStack *stack,
13701370
tuples, 2,
13711371
stack->downlinkoffnum,
13721372
left->buf, right->buf,
1373-
true, /* Unlock parent */
1374-
unlockbuf /* Unlock stack->buffer if caller wants that */
1375-
))
1373+
true, /* Unlock parent */
1374+
unlockbuf /* Unlock stack->buffer if caller wants
1375+
* that */
1376+
))
13761377
{
13771378
/*
13781379
* If the parent page was split, the downlink might have moved.

src/backend/access/hash/hashutil.c

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ _hash_spareindex(uint32 num_bucket)
144144
{
145145
uint32 splitpoint_group;
146146
uint32 splitpoint_phases;
147+
147148
splitpoint_group = pg_ceil_log2_32(num_bucket);
148149

149150
if (splitpoint_group < HASH_SPLITPOINT_GROUPS_WITH_ONE_PHASE)

src/backend/access/hash/hashvalidate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ check_hash_func_signature(Oid funcid, int16 amprocnum, Oid argtype)
318318
argtype == XIDOID || argtype == CIDOID))
319319
/* okay, allowed use of hashint4() */ ;
320320
else if ((funcid == F_HASHINT8 || funcid == F_HASHINT8EXTENDED) &&
321-
(argtype == XID8OID))
321+
(argtype == XID8OID))
322322
/* okay, allowed use of hashint8() */ ;
323323
else if ((funcid == F_TIMESTAMP_HASH ||
324324
funcid == F_TIMESTAMP_HASH_EXTENDED) &&

src/backend/access/heap/heapam.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2153,8 +2153,8 @@ heap_multi_insert(Relation relation, TupleTableSlot **slots, int ntuples,
21532153
RelationPutHeapTuple(relation, buffer, heaptuples[ndone], false);
21542154

21552155
/*
2156-
* Note that heap_multi_insert is not used for catalog tuples yet,
2157-
* but this will cover the gap once that is the case.
2156+
* Note that heap_multi_insert is not used for catalog tuples yet, but
2157+
* this will cover the gap once that is the case.
21582158
*/
21592159
if (needwal && need_cids)
21602160
log_heap_new_cid(relation, heaptuples[ndone]);

src/backend/access/index/indexam.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ index_opclass_options(Relation indrel, AttrNumber attnum, Datum attoptions,
943943

944944
/* fetch options support procedure if specified */
945945
if (amoptsprocnum != 0)
946-
procid =index_getprocid(indrel, attnum, amoptsprocnum);
946+
procid = index_getprocid(indrel, attnum, amoptsprocnum);
947947

948948
if (!OidIsValid(procid))
949949
{
@@ -953,7 +953,7 @@ index_opclass_options(Relation indrel, AttrNumber attnum, Datum attoptions,
953953
bool isnull;
954954

955955
if (!DatumGetPointer(attoptions))
956-
return NULL; /* ok, no options, no procedure */
956+
return NULL; /* ok, no options, no procedure */
957957

958958
/*
959959
* Report an error if the opclass's options-parsing procedure does not

src/backend/access/nbtree/nbtpage.c

+8-5
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,8 @@ _bt_pagedel(Relation rel, Buffer leafbuf, TransactionId *oldestBtpoXact)
15661566
BTScanInsert itup_key;
15671567
ItemId itemid;
15681568
IndexTuple targetkey;
1569-
BlockNumber leftsib, leafblkno;
1569+
BlockNumber leftsib,
1570+
leafblkno;
15701571
Buffer sleafbuf;
15711572

15721573
itemid = PageGetItemId(page, P_HIKEY);
@@ -1777,6 +1778,7 @@ _bt_mark_page_halfdead(Relation rel, Buffer leafbuf, BTStack stack)
17771778
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
17781779

17791780
#ifdef USE_ASSERT_CHECKING
1781+
17801782
/*
17811783
* This is just an assertion because _bt_lock_subtree_parent should have
17821784
* guaranteed tuple has the expected contents
@@ -2368,7 +2370,8 @@ _bt_lock_subtree_parent(Relation rel, BlockNumber child, BTStack stack,
23682370
Buffer *subtreeparent, OffsetNumber *poffset,
23692371
BlockNumber *topparent, BlockNumber *topparentrightsib)
23702372
{
2371-
BlockNumber parent, leftsibparent;
2373+
BlockNumber parent,
2374+
leftsibparent;
23722375
OffsetNumber parentoffset,
23732376
maxoff;
23742377
Buffer pbuf;
@@ -2439,9 +2442,9 @@ _bt_lock_subtree_parent(Relation rel, BlockNumber child, BTStack stack,
24392442
/*
24402443
* Now make sure that the parent deletion is itself safe by examining the
24412444
* child's grandparent page. Recurse, passing the parent page as the
2442-
* child page (child's grandparent is the parent on the next level up).
2443-
* If parent deletion is unsafe, then child deletion must also be unsafe
2444-
* (in which case caller cannot delete any pages at all).
2445+
* child page (child's grandparent is the parent on the next level up). If
2446+
* parent deletion is unsafe, then child deletion must also be unsafe (in
2447+
* which case caller cannot delete any pages at all).
24452448
*/
24462449
*topparent = parent;
24472450
*topparentrightsib = opaque->btpo_next;

src/backend/access/nbtree/nbtree.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,8 @@ btvacuumpage(BTVacState *vstate, BlockNumber scanblkno)
10911091
void *callback_state = vstate->callback_state;
10921092
Relation rel = info->index;
10931093
bool attempt_pagedel;
1094-
BlockNumber blkno, backtrack_to;
1094+
BlockNumber blkno,
1095+
backtrack_to;
10951096
Buffer buf;
10961097
Page page;
10971098
BTPageOpaque opaque;

src/backend/access/nbtree/nbtsearch.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,10 @@ _bt_search(Relation rel, BTScanInsert key, Buffer *bufP, int access,
156156

157157
/*
158158
* We need to save the location of the pivot tuple we chose in the
159-
* parent page on a stack. If we need to split a page, we'll use
160-
* the stack to work back up to its parent page. If caller ends up
161-
* splitting a page one level down, it usually ends up inserting a
162-
* new pivot tuple/downlink immediately after the location recorded
163-
* here.
159+
* parent page on a stack. If we need to split a page, we'll use the
160+
* stack to work back up to its parent page. If caller ends up
161+
* splitting a page one level down, it usually ends up inserting a new
162+
* pivot tuple/downlink immediately after the location recorded here.
164163
*/
165164
new_stack = (BTStack) palloc(sizeof(BTStackData));
166165
new_stack->bts_blkno = par_blkno;

src/backend/access/nbtree/nbtsplitloc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static bool _bt_afternewitemoff(FindSplitData *state, OffsetNumber maxoff,
7272
static bool _bt_adjacenthtid(ItemPointer lowhtid, ItemPointer highhtid);
7373
static OffsetNumber _bt_bestsplitloc(FindSplitData *state, int perfectpenalty,
7474
bool *newitemonleft, FindSplitStrat strategy);
75-
static int _bt_defaultinterval(FindSplitData *state);
75+
static int _bt_defaultinterval(FindSplitData *state);
7676
static int _bt_strategy(FindSplitData *state, SplitPoint *leftpage,
7777
SplitPoint *rightpage, FindSplitStrat *strategy);
7878
static void _bt_interval_edges(FindSplitData *state,

src/backend/access/rmgrdesc/dbasedesc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ dbase_desc(StringInfo buf, XLogReaderState *record)
3535
else if (info == XLOG_DBASE_DROP)
3636
{
3737
xl_dbase_drop_rec *xlrec = (xl_dbase_drop_rec *) rec;
38-
int i;
38+
int i;
3939

4040
appendStringInfo(buf, "dir");
4141
for (i = 0; i < xlrec->ntablespaces; i++)

src/backend/access/rmgrdesc/xactdesc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static void
251251
xact_desc_relations(StringInfo buf, char *label, int nrels,
252252
RelFileNode *xnodes)
253253
{
254-
int i;
254+
int i;
255255

256256
if (nrels > 0)
257257
{
@@ -269,7 +269,7 @@ xact_desc_relations(StringInfo buf, char *label, int nrels,
269269
static void
270270
xact_desc_subxacts(StringInfo buf, int nsubxacts, TransactionId *subxacts)
271271
{
272-
int i;
272+
int i;
273273

274274
if (nsubxacts > 0)
275275
{

src/backend/access/spgist/spgvalidate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ spgvalidate(Oid opclassoid)
275275
if ((thisgroup->functionset & (((uint64) 1) << i)) != 0)
276276
continue; /* got it */
277277
if (i == SPGIST_OPTIONS_PROC)
278-
continue; /* optional method */
278+
continue; /* optional method */
279279
ereport(INFO,
280280
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
281281
errmsg("operator family \"%s\" of access method %s is missing support function %d for type %s",

0 commit comments

Comments
 (0)