Skip to content

Commit 8826d85

Browse files
committed
Tweak a few more things in preparation for upcoming pgindent run.
These adjustments adjust code and comments in minor ways to prevent pgindent from mangling them. Among other things, I tried to avoid situations where pgindent would emit "a +b" instead of "a + b", and I tried to avoid having it break up inline comments across multiple lines.
1 parent 1e77949 commit 8826d85

File tree

8 files changed

+34
-20
lines changed

8 files changed

+34
-20
lines changed

contrib/pageinspect/heapfuncs.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,12 @@ heap_page_items(PG_FUNCTION_ARGS)
229229
{
230230
if (tuphdr->t_infomask & HEAP_HASNULL)
231231
{
232-
int bits_len =
233-
((tuphdr->t_infomask2 & HEAP_NATTS_MASK) / 8 + 1) * 8;
232+
int bits_len;
234233

234+
bits_len =
235+
((tuphdr->t_infomask2 & HEAP_NATTS_MASK) / 8 + 1) * 8;
235236
values[11] = CStringGetTextDatum(
236-
bits_to_text(tuphdr->t_bits, bits_len));
237+
bits_to_text(tuphdr->t_bits, bits_len));
237238
}
238239
else
239240
nulls[11] = true;

src/backend/executor/execParallel.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,8 @@ ExecInitParallelPlan(PlanState *planstate, EState *estate, int nworkers)
400400
if (estate->es_instrument)
401401
{
402402
instrumentation_len =
403-
offsetof(SharedExecutorInstrumentation, plan_node_id)
404-
+ sizeof(int) * e.nnodes;
403+
offsetof(SharedExecutorInstrumentation, plan_node_id) +
404+
sizeof(int) * e.nnodes;
405405
instrumentation_len = MAXALIGN(instrumentation_len);
406406
instrument_offset = instrumentation_len;
407407
instrumentation_len += sizeof(Instrumentation) * e.nnodes * nworkers;
@@ -513,7 +513,7 @@ ExecParallelRetrieveInstrumentation(PlanState *planstate,
513513
/* Also store the per-worker detail. */
514514
ibytes = instrumentation->num_workers * sizeof(Instrumentation);
515515
planstate->worker_instrument =
516-
palloc(offsetof(WorkerInstrumentation, instrument) + ibytes);
516+
palloc(ibytes + offsetof(WorkerInstrumentation, instrument));
517517
planstate->worker_instrument->num_workers = instrumentation->num_workers;
518518
memcpy(&planstate->worker_instrument->instrument, instrument, ibytes);
519519

src/backend/executor/nodeAgg.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3016,7 +3016,8 @@ build_pertrans_for_aggref(AggStatePerTrans pertrans,
30163016
Expr *transfnexpr;
30173017

30183018
/*
3019-
* Set up infrastructure for calling the transfn
3019+
* Set up infrastructure for calling the transfn. Note that invtrans
3020+
* is not needed here.
30203021
*/
30213022
build_aggregate_transfn_expr(inputTypes,
30223023
numArguments,
@@ -3025,7 +3026,7 @@ build_pertrans_for_aggref(AggStatePerTrans pertrans,
30253026
aggtranstype,
30263027
aggref->inputcollid,
30273028
aggtransfn,
3028-
InvalidOid, /* invtrans is not needed here */
3029+
InvalidOid,
30293030
&transfnexpr,
30303031
NULL);
30313032
fmgr_info(aggtransfn, &pertrans->transfn);

src/backend/tsearch/spell.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,9 +1338,10 @@ NIImportOOAffixes(IspellDict *Conf, const char *filename)
13381338
|| (sflaglen > 2 && Conf->flagMode == FM_LONG))
13391339
goto nextline;
13401340

1341-
/*
1341+
/*--------
13421342
* Affix header. For example:
13431343
* SFX \ N 1
1344+
*--------
13441345
*/
13451346
if (fields_read == 4)
13461347
{
@@ -1350,9 +1351,10 @@ NIImportOOAffixes(IspellDict *Conf, const char *filename)
13501351
else
13511352
flagflags = 0;
13521353
}
1353-
/*
1354+
/*--------
13541355
* Affix fields. For example:
1355-
* SFX \ 0 Y/L [^Y]
1356+
* SFX \ 0 Y/L [^Y]
1357+
*--------
13561358
*/
13571359
else
13581360
{

src/backend/tsearch/to_tsany.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ pushval_morph(Datum opaque, TSQueryParserState state, char *strval, int lenval,
311311
}
312312
}
313313

314-
pos = prs.words[count].pos.pos; /* save current word's position */
314+
/* save current word's position */
315+
pos = prs.words[count].pos.pos;
315316

316317
/* Go through all variants obtained from this token */
317318
cntvar = 0;
@@ -343,7 +344,11 @@ pushval_morph(Datum opaque, TSQueryParserState state, char *strval, int lenval,
343344
}
344345

345346
if (cntpos)
346-
pushOperator(state, data->qoperator, 1); /* distance may be useful */
347+
{
348+
/* distance may be useful */
349+
pushOperator(state, data->qoperator, 1);
350+
}
351+
347352
cntpos++;
348353
}
349354

src/backend/utils/adt/dbsize.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -817,11 +817,14 @@ pg_size_bytes(PG_FUNCTION_ARGS)
817817
else if (pg_strcasecmp(strptr, "kb") == 0)
818818
multiplier = (int64) 1024;
819819
else if (pg_strcasecmp(strptr, "mb") == 0)
820-
multiplier = (int64) 1024 * 1024;
820+
multiplier = ((int64) 1024) * 1024;
821+
821822
else if (pg_strcasecmp(strptr, "gb") == 0)
822-
multiplier = (int64) 1024 * 1024 * 1024;
823+
multiplier = ((int64) 1024) * 1024 * 1024;
824+
823825
else if (pg_strcasecmp(strptr, "tb") == 0)
824-
multiplier = (int64) 1024 * 1024 * 1024 * 1024;
826+
multiplier = ((int64) 1024) * 1024 * 1024 * 1024;
827+
825828
else
826829
ereport(ERROR,
827830
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),

src/backend/utils/adt/tsginidx.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,10 @@ TS_execute_ternary(GinChkVal *gcv, QueryItem *curitem)
222222
check_stack_depth();
223223

224224
if (curitem->type == QI_VAL)
225-
return checkcondition_gin_internal(gcv,
226-
(QueryOperand *) curitem,
227-
NULL /* don't have any position info */);
225+
return
226+
checkcondition_gin_internal(gcv,
227+
(QueryOperand *) curitem,
228+
NULL /* don't have position info */ );
228229

229230
switch (curitem->qoperator.oper)
230231
{

src/backend/utils/adt/tsvector_op.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,8 @@ tsvector_filter(PG_FUNCTION_ARGS)
834834
posvout->pos[npos++] = posvin->pos[k];
835835
}
836836

837-
if (!npos) /* no satisfactory positions found, so skip that lexeme */
837+
/* if no satisfactory positions found, skip lexeme */
838+
if (!npos)
838839
continue;
839840

840841
arrout[j].haspos = true;

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