]> granicus.if.org Git - postgresql/commitdiff
Tweak a few more things in preparation for upcoming pgindent run.
authorRobert Haas <rhaas@postgresql.org>
Tue, 3 May 2016 14:52:25 +0000 (10:52 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 3 May 2016 14:52:25 +0000 (10:52 -0400)
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.

contrib/pageinspect/heapfuncs.c
src/backend/executor/execParallel.c
src/backend/executor/nodeAgg.c
src/backend/tsearch/spell.c
src/backend/tsearch/to_tsany.c
src/backend/utils/adt/dbsize.c
src/backend/utils/adt/tsginidx.c
src/backend/utils/adt/tsvector_op.c

index b7d75b0e75327197275857c5581600393e29373b..d0c28865c3f7d9bcbe59534fe1c4905e24762626 100644 (file)
@@ -229,11 +229,12 @@ heap_page_items(PG_FUNCTION_ARGS)
                        {
                                if (tuphdr->t_infomask & HEAP_HASNULL)
                                {
-                                       int     bits_len =
-                                               ((tuphdr->t_infomask2 & HEAP_NATTS_MASK) / 8 + 1) * 8;
+                                       int                     bits_len;
 
+                                       bits_len =
+                                               ((tuphdr->t_infomask2 & HEAP_NATTS_MASK) / 8 + 1) * 8;
                                        values[11] = CStringGetTextDatum(
-                                                                bits_to_text(tuphdr->t_bits, bits_len));
+                                                                        bits_to_text(tuphdr->t_bits, bits_len));
                                }
                                else
                                        nulls[11] = true;
index bdc6b433e4ba7cc60e6fadf91a0e9f7479fdbbf5..6df62a7dccb77ccd31facd7d886fef8282079b2a 100644 (file)
@@ -400,8 +400,8 @@ ExecInitParallelPlan(PlanState *planstate, EState *estate, int nworkers)
        if (estate->es_instrument)
        {
                instrumentation_len =
-                       offsetof(SharedExecutorInstrumentation, plan_node_id)
-                       sizeof(int) * e.nnodes;
+                       offsetof(SharedExecutorInstrumentation, plan_node_id) +
+                       sizeof(int) * e.nnodes;
                instrumentation_len = MAXALIGN(instrumentation_len);
                instrument_offset = instrumentation_len;
                instrumentation_len += sizeof(Instrumentation) * e.nnodes * nworkers;
@@ -513,7 +513,7 @@ ExecParallelRetrieveInstrumentation(PlanState *planstate,
        /* Also store the per-worker detail. */
        ibytes = instrumentation->num_workers * sizeof(Instrumentation);
        planstate->worker_instrument =
-               palloc(offsetof(WorkerInstrumentation, instrument) + ibytes);
+               palloc(ibytes + offsetof(WorkerInstrumentation, instrument));
        planstate->worker_instrument->num_workers = instrumentation->num_workers;
        memcpy(&planstate->worker_instrument->instrument, instrument, ibytes);
 
index 614b26b8e3cc88ca286b90f671238d98303b3fbf..0c1e4a3cb6e3e8acdbb3b6fce48c2d302688da2d 100644 (file)
@@ -3016,7 +3016,8 @@ build_pertrans_for_aggref(AggStatePerTrans pertrans,
                Expr       *transfnexpr;
 
                /*
-                * Set up infrastructure for calling the transfn
+                * Set up infrastructure for calling the transfn.  Note that invtrans
+                * is not needed here.
                 */
                build_aggregate_transfn_expr(inputTypes,
                                                                         numArguments,
@@ -3025,7 +3026,7 @@ build_pertrans_for_aggref(AggStatePerTrans pertrans,
                                                                         aggtranstype,
                                                                         aggref->inputcollid,
                                                                         aggtransfn,
-                                                                        InvalidOid,    /* invtrans is not needed here */
+                                                                        InvalidOid,
                                                                         &transfnexpr,
                                                                         NULL);
                fmgr_info(aggtransfn, &pertrans->transfn);
index 5f1a97ea02c7d3643c8e04b2b444a38c3ba73563..f48664b09f962190639f40b4157dda93bf3ec088 100644 (file)
@@ -1338,9 +1338,10 @@ NIImportOOAffixes(IspellDict *Conf, const char *filename)
                        || (sflaglen > 2 && Conf->flagMode == FM_LONG))
                        goto nextline;
 
-               /*
+               /*--------
                 * Affix header. For example:
                 * SFX \ N 1
+                *--------
                 */
                if (fields_read == 4)
                {
@@ -1350,9 +1351,10 @@ NIImportOOAffixes(IspellDict *Conf, const char *filename)
                        else
                                flagflags = 0;
                }
-               /*
+               /*--------
                 * Affix fields. For example:
-                * SFX \   0    Y/L     [^Y]
+                * SFX \   0    Y/L [^Y]
+                *--------
                 */
                else
                {
index 3f69d747028f4ddf371974d8782d48f5ed0a386f..d41f82c479a51572874b75fa26f8136f9df5ae46 100644 (file)
@@ -311,7 +311,8 @@ pushval_morph(Datum opaque, TSQueryParserState state, char *strval, int lenval,
                                }
                        }
 
-                       pos = prs.words[count].pos.pos; /* save current word's position */
+                       /* save current word's position */
+                       pos = prs.words[count].pos.pos;
 
                        /* Go through all variants obtained from this token */
                        cntvar = 0;
@@ -343,7 +344,11 @@ pushval_morph(Datum opaque, TSQueryParserState state, char *strval, int lenval,
                        }
 
                        if (cntpos)
-                               pushOperator(state, data->qoperator, 1); /* distance may be useful */
+                       {
+                               /* distance may be useful */
+                               pushOperator(state, data->qoperator, 1);
+                       }
+
                        cntpos++;
                }
 
index 1db4acf175e1c94cfd45e83755f278be87df1c28..4ec2fed2b354232d3d66cb830f0e21507c40d1a7 100644 (file)
@@ -817,11 +817,14 @@ pg_size_bytes(PG_FUNCTION_ARGS)
                else if (pg_strcasecmp(strptr, "kb") == 0)
                        multiplier = (int64) 1024;
                else if (pg_strcasecmp(strptr, "mb") == 0)
-                       multiplier = (int64) 1024 * 1024;
+                       multiplier = ((int64) 1024) * 1024;
+
                else if (pg_strcasecmp(strptr, "gb") == 0)
-                       multiplier = (int64) 1024 * 1024 * 1024;
+                       multiplier = ((int64) 1024) * 1024 * 1024;
+
                else if (pg_strcasecmp(strptr, "tb") == 0)
-                       multiplier = (int64) 1024 * 1024 * 1024 * 1024;
+                       multiplier = ((int64) 1024) * 1024 * 1024 * 1024;
+
                else
                        ereport(ERROR,
                                        (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
index 3f1e7f961f692f037e1f9974dc09bf0e4579bd9a..ebc11c9e4eb6ec40dc6d068ea3f43b108db5ff2a 100644 (file)
@@ -222,9 +222,10 @@ TS_execute_ternary(GinChkVal *gcv, QueryItem *curitem)
        check_stack_depth();
 
        if (curitem->type == QI_VAL)
-               return checkcondition_gin_internal(gcv,
-                                                                                  (QueryOperand *) curitem,
-                                                                                  NULL /* don't have any position info */);
+               return
+                       checkcondition_gin_internal(gcv,
+                                                                               (QueryOperand *) curitem,
+                                                                               NULL /* don't have position info */ );
 
        switch (curitem->qoperator.oper)
        {
index d4fb0ff036d2cc4572417609f6ada1335da8a27f..8298e38545b80101883e86ec557839118b391f0c 100644 (file)
@@ -834,7 +834,8 @@ tsvector_filter(PG_FUNCTION_ARGS)
                                posvout->pos[npos++] = posvin->pos[k];
                }
 
-               if (!npos) /* no satisfactory positions found, so skip that lexeme */
+               /* if no satisfactory positions found, skip lexeme */
+               if (!npos)
                        continue;
 
                arrout[j].haspos = true;