1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Initial pgindent run with pg_bsd_indent version 2.0.

The new indent version includes numerous fixes thanks to Piotr Stefaniak.
The main changes visible in this commit are:

* Nicer formatting of function-pointer declarations.
* No longer unexpectedly removes spaces in expressions using casts,
  sizeof, or offsetof.
* No longer wants to add a space in "struct structname *varname", as
  well as some similar cases for const- or volatile-qualified pointers.
* Declarations using PG_USED_FOR_ASSERTS_ONLY are formatted more nicely.
* Fixes bug where comments following declarations were sometimes placed
  with no space separating them from the code.
* Fixes some odd decisions for comments following case labels.
* Fixes some cases where comments following code were indented to less
  than the expected column 33.

On the less good side, it now tends to put more whitespace around typedef
names that are not listed in typedefs.list.  This might encourage us to
put more effort into typedef name collection; it's not really a bug in
indent itself.

There are more changes coming after this round, having to do with comment
indentation and alignment of lines appearing within parentheses.  I wanted
to limit the size of the diffs to something that could be reviewed without
one's eyes completely glazing over, so it seemed better to split up the
changes as much as practical.

Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2017-06-21 14:39:04 -04:00
parent 8ff6d4ec78
commit e3860ffa4d
379 changed files with 1725 additions and 1707 deletions

View File

@ -151,7 +151,7 @@ execCurrentOf(CurrentOfExpr *cexpr,
{
ScanState *scanstate;
bool lisnull;
Oid tuple_tableoid PG_USED_FOR_ASSERTS_ONLY;
Oid tuple_tableoid PG_USED_FOR_ASSERTS_ONLY;
ItemPointer tuple_tid;
/*

View File

@ -140,7 +140,7 @@ typedef struct SQLFunctionParseInfo
char **argnames; /* names of input arguments; NULL if none */
/* Note that argnames[i] can be NULL, if some args are unnamed */
Oid collation; /* function's input collation, if known */
} SQLFunctionParseInfo;
} SQLFunctionParseInfo;
/* non-export function prototypes */

View File

@ -391,7 +391,7 @@ typedef struct AggStatePerTransData
FunctionCallInfoData serialfn_fcinfo;
FunctionCallInfoData deserialfn_fcinfo;
} AggStatePerTransData;
} AggStatePerTransData;
/*
* AggStatePerAggData - per-aggregate information
@ -439,7 +439,7 @@ typedef struct AggStatePerAggData
int16 resulttypeLen;
bool resulttypeByVal;
} AggStatePerAggData;
} AggStatePerAggData;
/*
* AggStatePerGroupData - per-aggregate-per-group working state
@ -471,7 +471,7 @@ typedef struct AggStatePerGroupData
* NULL and not auto-replace it with a later input value. Only the first
* non-NULL input will be auto-substituted.
*/
} AggStatePerGroupData;
} AggStatePerGroupData;
/*
* AggStatePerPhaseData - per-grouping-set-phase state
@ -493,7 +493,7 @@ typedef struct AggStatePerPhaseData
FmgrInfo *eqfunctions; /* per-grouping-field equality fns */
Agg *aggnode; /* Agg node for phase data */
Sort *sortnode; /* Sort node for input ordering for phase */
} AggStatePerPhaseData;
} AggStatePerPhaseData;
/*
* AggStatePerHashData - per-hashtable state
@ -515,7 +515,7 @@ typedef struct AggStatePerHashData
AttrNumber *hashGrpColIdxInput; /* hash col indices in input slot */
AttrNumber *hashGrpColIdxHash; /* indices in hashtbl tuples */
Agg *aggnode; /* original Agg node, for numGroups etc. */
} AggStatePerHashData;
} AggStatePerHashData;
static void select_current_set(AggState *aggstate, int setno, bool is_hash);

View File

@ -687,7 +687,7 @@ ExecHashJoinNewBatch(HashJoinState *hjstate)
BufFileClose(hashtable->outerBatchFile[curbatch]);
hashtable->outerBatchFile[curbatch] = NULL;
}
else /* we just finished the first batch */
else /* we just finished the first batch */
{
/*
* Reset some of the skew optimization state variables, since we no

View File

@ -66,7 +66,7 @@ ExecMaterial(MaterialState *node)
* Allocate a second read pointer to serve as the mark. We know it
* must have index 1, so needn't store that.
*/
int ptrno PG_USED_FOR_ASSERTS_ONLY;
int ptrno PG_USED_FOR_ASSERTS_ONLY;
ptrno = tuplestore_alloc_read_pointer(tuplestorestate,
node->eflags);

View File

@ -137,7 +137,7 @@ typedef struct MergeJoinClauseData
* stored here.
*/
SortSupportData ssup;
} MergeJoinClauseData;
} MergeJoinClauseData;
/* Result type for MJEvalOuterValues and MJEvalInnerValues */
typedef enum
@ -216,7 +216,7 @@ MJExamineQuals(List *mergeclauses,
clause->ssup.ssup_reverse = false;
else if (opstrategy == BTGreaterStrategyNumber)
clause->ssup.ssup_reverse = true;
else /* planner screwed up */
else /* planner screwed up */
elog(ERROR, "unsupported mergejoin strategy %d", opstrategy);
clause->ssup.ssup_nulls_first = nulls_first;

View File

@ -120,7 +120,7 @@ ExecProjectSRF(ProjectSetState *node, bool continuing)
{
TupleTableSlot *resultSlot = node->ps.ps_ResultTupleSlot;
ExprContext *econtext = node->ps.ps_ExprContext;
bool hassrf PG_USED_FOR_ASSERTS_ONLY;
bool hassrf PG_USED_FOR_ASSERTS_ONLY;
bool hasresult;
int argno;

View File

@ -64,7 +64,7 @@ typedef struct SetOpStatePerGroupData
{
long numLeft; /* number of left-input dups in group */
long numRight; /* number of right-input dups in group */
} SetOpStatePerGroupData;
} SetOpStatePerGroupData;
static TupleTableSlot *setop_retrieve_direct(SetOpState *setopstate);
@ -333,7 +333,7 @@ setop_fill_hash_table(SetOpState *setopstate)
SetOp *node = (SetOp *) setopstate->ps.plan;
PlanState *outerPlan;
int firstFlag;
bool in_first_rel PG_USED_FOR_ASSERTS_ONLY;
bool in_first_rel PG_USED_FOR_ASSERTS_ONLY;
/*
* get state info from node

View File

@ -95,7 +95,7 @@ typedef struct WindowStatePerFuncData
int aggno; /* if so, index of its PerAggData */
WindowObject winobj; /* object used in window function API */
} WindowStatePerFuncData;
} WindowStatePerFuncData;
/*
* For plain aggregate window functions, we also have one of these.