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

Commit 551938a

Browse files
committed
Post-pgindent cleanup
Make slightly better decisions about indentation than what pgindent is capable of. Mostly breaking out long function calls into one line per argument, with a few other minor adjustments. No functional changes- all whitespace. pgindent ran cleanly (didn't change anything) after. Passes all regressions.
1 parent dedf7e9 commit 551938a

File tree

13 files changed

+88
-44
lines changed

13 files changed

+88
-44
lines changed

contrib/hstore/hstore_io.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,8 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
13001300
* digit as numeric - could be a zip code or similar
13011301
*/
13021302
if (src->len > 0 &&
1303-
!(src->data[0] == '0' && isdigit((unsigned char) src->data[1])) &&
1303+
!(src->data[0] == '0' &&
1304+
isdigit((unsigned char) src->data[1])) &&
13041305
strspn(src->data, "+-0123456789Ee.") == src->len)
13051306
{
13061307
/*

contrib/pg_upgrade/info.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,8 @@ print_rel_infos(RelInfoArr *rel_arr)
441441

442442
for (relnum = 0; relnum < rel_arr->nrels; relnum++)
443443
pg_log(PG_VERBOSE, "relname: %s.%s: reloid: %u reltblspace: %s\n",
444-
rel_arr->rels[relnum].nspname, rel_arr->rels[relnum].relname,
445-
rel_arr->rels[relnum].reloid, rel_arr->rels[relnum].tablespace);
444+
rel_arr->rels[relnum].nspname,
445+
rel_arr->rels[relnum].relname,
446+
rel_arr->rels[relnum].reloid,
447+
rel_arr->rels[relnum].tablespace);
446448
}

contrib/pg_upgrade/pg_upgrade.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,13 @@ create_new_objects(void)
341341
* pg_dump only produces its output at the end, so there is little
342342
* parallelism if using the pipe.
343343
*/
344-
parallel_exec_prog(log_file_name, NULL,
344+
parallel_exec_prog(log_file_name,
345+
NULL,
345346
"\"%s/pg_restore\" %s --exit-on-error --verbose --dbname \"%s\" \"%s\"",
346-
new_cluster.bindir, cluster_conn_opts(&new_cluster),
347-
old_db->db_name, sql_file_name);
347+
new_cluster.bindir,
348+
cluster_conn_opts(&new_cluster),
349+
old_db->db_name,
350+
sql_file_name);
348351
}
349352

350353
/* reap all children */

contrib/pg_upgrade/relfilenode.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ transfer_all_new_tablespaces(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr,
5353
new_pgdata, old_pgdata);
5454

5555
for (tblnum = 0; tblnum < os_info.num_old_tablespaces; tblnum++)
56-
parallel_transfer_all_new_dbs(old_db_arr, new_db_arr, old_pgdata,
57-
new_pgdata, os_info.old_tablespaces[tblnum]);
56+
parallel_transfer_all_new_dbs(old_db_arr,
57+
new_db_arr,
58+
old_pgdata,
59+
new_pgdata,
60+
os_info.old_tablespaces[tblnum]);
5861
/* reap all children */
5962
while (reap_child(true) == true)
6063
;
@@ -230,12 +233,20 @@ transfer_relfile(pageCnvCtx *pageConverter, FileNameMap *map,
230233
else
231234
snprintf(extent_suffix, sizeof(extent_suffix), ".%d", segno);
232235

233-
snprintf(old_file, sizeof(old_file), "%s%s/%u/%u%s%s", map->old_tablespace,
234-
map->old_tablespace_suffix, map->old_db_oid, map->old_relfilenode,
235-
type_suffix, extent_suffix);
236-
snprintf(new_file, sizeof(new_file), "%s%s/%u/%u%s%s", map->new_tablespace,
237-
map->new_tablespace_suffix, map->new_db_oid, map->new_relfilenode,
238-
type_suffix, extent_suffix);
236+
snprintf(old_file, sizeof(old_file), "%s%s/%u/%u%s%s",
237+
map->old_tablespace,
238+
map->old_tablespace_suffix,
239+
map->old_db_oid,
240+
map->old_relfilenode,
241+
type_suffix,
242+
extent_suffix);
243+
snprintf(new_file, sizeof(new_file), "%s%s/%u/%u%s%s",
244+
map->new_tablespace,
245+
map->new_tablespace_suffix,
246+
map->new_db_oid,
247+
map->new_relfilenode,
248+
type_suffix,
249+
extent_suffix);
239250

240251
/* Is it an extent, fsm, or vm file? */
241252
if (type_suffix[0] != '\0' || segno != 0)

contrib/pgbench/pgbench.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -999,8 +999,12 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
999999
* this in a special way (see below).
10001000
*/
10011001
fprintf(logfile, "%ld %d %.0f %.0f %.0f %.0f\n",
1002-
agg->start_time, agg->cnt, agg->sum, agg->sum2,
1003-
agg->min_duration, agg->max_duration);
1002+
agg->start_time,
1003+
agg->cnt,
1004+
agg->sum,
1005+
agg->sum2,
1006+
agg->min_duration,
1007+
agg->max_duration);
10041008

10051009
/* move to the next inteval */
10061010
agg->start_time = agg->start_time + agg_interval;
@@ -1625,7 +1629,6 @@ init(bool is_no_vacuum)
16251629
/* have we reached the next interval (or end)? */
16261630
if ((j == scale * naccounts) || (elapsed_sec >= log_interval * LOG_STEP_SECONDS))
16271631
{
1628-
16291632
fprintf(stderr, INT64_FORMAT " of " INT64_FORMAT " tuples (%d%%) done (elapsed %.2f s, remaining %.2f s).\n",
16301633
j, (int64) naccounts * scale,
16311634
(int) (((int64) j * 100) / (naccounts * scale)), elapsed_sec, remaining_sec);

src/backend/access/gist/gistbuild.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,14 @@ gistProcessItup(GISTBuildState *buildstate, IndexTuple itup,
610610
newtup = gistgetadjusted(indexrel, idxtuple, itup, giststate);
611611
if (newtup)
612612
{
613-
blkno = gistbufferinginserttuples(buildstate, buffer, level,
614-
&newtup, 1, childoffnum,
615-
InvalidBlockNumber, InvalidOffsetNumber);
613+
blkno = gistbufferinginserttuples(buildstate,
614+
buffer,
615+
level,
616+
&newtup,
617+
1,
618+
childoffnum,
619+
InvalidBlockNumber,
620+
InvalidOffsetNumber);
616621
/* gistbufferinginserttuples() released the buffer */
617622
}
618623
else

src/backend/access/heap/heapam.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3182,8 +3182,9 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
31823182
* we weren't looking, start over.
31833183
*/
31843184
if ((oldtup.t_data->t_infomask & HEAP_XMAX_IS_MULTI) ||
3185-
!TransactionIdEquals(HeapTupleHeaderGetRawXmax(oldtup.t_data),
3186-
xwait))
3185+
!TransactionIdEquals(
3186+
HeapTupleHeaderGetRawXmax(oldtup.t_data),
3187+
xwait))
31873188
goto l2;
31883189

31893190
can_continue = true;
@@ -3201,8 +3202,9 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
32013202
* this point. Check for xmax change, and start over if so.
32023203
*/
32033204
if ((oldtup.t_data->t_infomask & HEAP_XMAX_IS_MULTI) ||
3204-
!TransactionIdEquals(HeapTupleHeaderGetRawXmax(oldtup.t_data),
3205-
xwait))
3205+
!TransactionIdEquals(
3206+
HeapTupleHeaderGetRawXmax(oldtup.t_data),
3207+
xwait))
32063208
goto l2;
32073209

32083210
/* Otherwise check if it committed or aborted */
@@ -4183,8 +4185,9 @@ heap_lock_tuple(Relation relation, HeapTuple tuple,
41834185

41844186
/* if the xmax changed in the meantime, start over */
41854187
if ((tuple->t_data->t_infomask & HEAP_XMAX_IS_MULTI) ||
4186-
!TransactionIdEquals(HeapTupleHeaderGetRawXmax(tuple->t_data),
4187-
xwait))
4188+
!TransactionIdEquals(
4189+
HeapTupleHeaderGetRawXmax(tuple->t_data),
4190+
xwait))
41884191
goto l3;
41894192
/* otherwise, we're good */
41904193
require_sleep = false;
@@ -4246,8 +4249,9 @@ heap_lock_tuple(Relation relation, HeapTuple tuple,
42464249
* for xmax change, and start over if so.
42474250
*/
42484251
if (!(tuple->t_data->t_infomask & HEAP_XMAX_IS_MULTI) ||
4249-
!TransactionIdEquals(HeapTupleHeaderGetRawXmax(tuple->t_data),
4250-
xwait))
4252+
!TransactionIdEquals(
4253+
HeapTupleHeaderGetRawXmax(tuple->t_data),
4254+
xwait))
42514255
goto l3;
42524256

42534257
/*
@@ -4300,8 +4304,9 @@ heap_lock_tuple(Relation relation, HeapTuple tuple,
43004304
* this point. Check for xmax change, and start over if so.
43014305
*/
43024306
if ((tuple->t_data->t_infomask & HEAP_XMAX_IS_MULTI) ||
4303-
!TransactionIdEquals(HeapTupleHeaderGetRawXmax(tuple->t_data),
4304-
xwait))
4307+
!TransactionIdEquals(
4308+
HeapTupleHeaderGetRawXmax(tuple->t_data),
4309+
xwait))
43054310
goto l3;
43064311

43074312
/*

src/backend/access/transam/multixact.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,8 @@ MultiXactIdExpand(MultiXactId multi, TransactionId xid, MultiXactStatus status)
432432
/*
433433
* Determine which of the members of the MultiXactId are still of
434434
* interest. This is any running transaction, and also any transaction
435-
* that grabbed something stronger than just a lock and was committed.
436-
* (An update that aborted is of no interest here.)
435+
* that grabbed something stronger than just a lock and was committed. (An
436+
* update that aborted is of no interest here.)
437437
*
438438
* (Removing dead members is just an optimization, but a useful one. Note
439439
* we have the same race condition here as above: j could be 0 at the end
@@ -1349,7 +1349,9 @@ mXactCacheGetById(MultiXactId multi, MultiXactMember **members)
13491349
memcpy(ptr, entry->members, size);
13501350

13511351
debug_elog3(DEBUG2, "CacheGet: found %s",
1352-
mxid_to_string(multi, entry->nmembers, entry->members));
1352+
mxid_to_string(multi,
1353+
entry->nmembers,
1354+
entry->members));
13531355
return entry->nmembers;
13541356
}
13551357
}

src/backend/access/transam/xlog.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,8 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible, bool xlog_switch)
15461546
*/
15471547
if (LogwrtResult.Write >= XLogCtl->xlblocks[curridx])
15481548
elog(PANIC, "xlog write request %X/%X is past end of log %X/%X",
1549-
(uint32) (LogwrtResult.Write >> 32), (uint32) LogwrtResult.Write,
1549+
(uint32) (LogwrtResult.Write >> 32),
1550+
(uint32) LogwrtResult.Write,
15501551
(uint32) (XLogCtl->xlblocks[curridx] >> 32),
15511552
(uint32) XLogCtl->xlblocks[curridx]);
15521553

@@ -7381,7 +7382,8 @@ CreateRestartPoint(int flags)
73817382
{
73827383
ereport(DEBUG2,
73837384
(errmsg("skipping restartpoint, already performed at %X/%X",
7384-
(uint32) (lastCheckPoint.redo >> 32), (uint32) lastCheckPoint.redo)));
7385+
(uint32) (lastCheckPoint.redo >> 32),
7386+
(uint32) lastCheckPoint.redo)));
73857387

73867388
UpdateMinRecoveryPoint(InvalidXLogRecPtr, true);
73877389
if (flags & CHECKPOINT_IS_SHUTDOWN)

src/backend/commands/event_trigger.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,8 @@ EventTriggerDDLCommandStart(Node *parsetree)
705705
return;
706706

707707
runlist = EventTriggerCommonSetup(parsetree,
708-
EVT_DDLCommandStart, "ddl_command_start",
708+
EVT_DDLCommandStart,
709+
"ddl_command_start",
709710
&trigdata);
710711
if (runlist == NIL)
711712
return;

src/backend/commands/tablecmds.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9985,7 +9985,8 @@ AlterTableNamespaceInternal(Relation rel, Oid oldNspOid, Oid nspOid,
99859985
void
99869986
AlterRelationNamespaceInternal(Relation classRel, Oid relOid,
99879987
Oid oldNspOid, Oid newNspOid,
9988-
bool hasDependEntry, ObjectAddresses *objsMoved)
9988+
bool hasDependEntry,
9989+
ObjectAddresses *objsMoved)
99899990
{
99909991
HeapTuple classTup;
99919992
Form_pg_class classForm;
@@ -10024,8 +10025,11 @@ AlterRelationNamespaceInternal(Relation classRel, Oid relOid,
1002410025

1002510026
/* Update dependency on schema if caller said so */
1002610027
if (hasDependEntry &&
10027-
changeDependencyFor(RelationRelationId, relOid,
10028-
NamespaceRelationId, oldNspOid, newNspOid) != 1)
10028+
changeDependencyFor(RelationRelationId,
10029+
relOid,
10030+
NamespaceRelationId,
10031+
oldNspOid,
10032+
newNspOid) != 1)
1002910033
elog(ERROR, "failed to change schema dependency for relation \"%s\"",
1003010034
NameStr(classForm->relname));
1003110035

src/backend/commands/trigger.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,8 +2210,11 @@ ExecARDeleteTriggers(EState *estate, ResultRelInfo *relinfo,
22102210

22112211
if (trigdesc && trigdesc->trig_delete_after_row)
22122212
{
2213-
HeapTuple trigtuple = GetTupleForTrigger(estate, NULL, relinfo,
2214-
tupleid, LockTupleExclusive,
2213+
HeapTuple trigtuple = GetTupleForTrigger(estate,
2214+
NULL,
2215+
relinfo,
2216+
tupleid,
2217+
LockTupleExclusive,
22152218
NULL);
22162219

22172220
AfterTriggerSaveEvent(estate, relinfo, TRIGGER_EVENT_DELETE,
@@ -2449,8 +2452,11 @@ ExecARUpdateTriggers(EState *estate, ResultRelInfo *relinfo,
24492452

24502453
if (trigdesc && trigdesc->trig_update_after_row)
24512454
{
2452-
HeapTuple trigtuple = GetTupleForTrigger(estate, NULL, relinfo,
2453-
tupleid, LockTupleExclusive,
2455+
HeapTuple trigtuple = GetTupleForTrigger(estate,
2456+
NULL,
2457+
relinfo,
2458+
tupleid,
2459+
LockTupleExclusive,
24542460
NULL);
24552461

24562462
AfterTriggerSaveEvent(estate, relinfo, TRIGGER_EVENT_UPDATE,

src/interfaces/ecpg/pgtypeslib/timestamp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,6 @@ PGTYPEStimestamp_defmt_asc(char *str, const char *fmt, timestamp * d)
948948
int
949949
PGTYPEStimestamp_add_interval(timestamp * tin, interval * span, timestamp * tout)
950950
{
951-
952951
if (TIMESTAMP_NOT_FINITE(*tin))
953952
*tout = *tin;
954953

0 commit comments

Comments
 (0)