mirror of
https://github.com/postgres/postgres.git
synced 2025-12-22 17:42:17 +03:00
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4d wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
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:
@@ -85,4 +85,4 @@ extern Node *estimate_expression_value(PlannerInfo *root, Node *node);
|
||||
extern Query *inline_set_returning_function(PlannerInfo *root,
|
||||
RangeTblEntry *rte);
|
||||
|
||||
#endif /* CLAUSES_H */
|
||||
#endif /* CLAUSES_H */
|
||||
|
||||
@@ -35,7 +35,7 @@ typedef enum
|
||||
{
|
||||
CONSTRAINT_EXCLUSION_OFF, /* do not use c_e */
|
||||
CONSTRAINT_EXCLUSION_ON, /* apply c_e to all rels */
|
||||
CONSTRAINT_EXCLUSION_PARTITION /* apply c_e to otherrels only */
|
||||
CONSTRAINT_EXCLUSION_PARTITION /* apply c_e to otherrels only */
|
||||
} ConstraintExclusionType;
|
||||
|
||||
|
||||
@@ -210,4 +210,4 @@ extern void cost_gather_merge(GatherMergePath *path, PlannerInfo *root,
|
||||
Cost input_startup_cost, Cost input_total_cost,
|
||||
double *rows);
|
||||
|
||||
#endif /* COST_H */
|
||||
#endif /* COST_H */
|
||||
|
||||
@@ -73,7 +73,7 @@ extern double Geqo_seed; /* 0 .. 1 */
|
||||
typedef struct
|
||||
{
|
||||
List *initial_rels; /* the base relations we are joining */
|
||||
unsigned short random_state[3]; /* state for pg_erand48() */
|
||||
unsigned short random_state[3]; /* state for pg_erand48() */
|
||||
} GeqoPrivateData;
|
||||
|
||||
|
||||
@@ -85,4 +85,4 @@ extern RelOptInfo *geqo(PlannerInfo *root,
|
||||
extern Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene);
|
||||
extern RelOptInfo *gimme_tree(PlannerInfo *root, Gene *tour, int num_gene);
|
||||
|
||||
#endif /* GEQO_H */
|
||||
#endif /* GEQO_H */
|
||||
|
||||
@@ -27,4 +27,4 @@
|
||||
|
||||
extern void geqo_copy(PlannerInfo *root, Chromosome *chromo1, Chromosome *chromo2, int string_length);
|
||||
|
||||
#endif /* GEQO_COPY_H */
|
||||
#endif /* GEQO_COPY_H */
|
||||
|
||||
@@ -42,4 +42,4 @@ typedef struct Pool
|
||||
int string_length;
|
||||
} Pool;
|
||||
|
||||
#endif /* GEQO_GENE_H */
|
||||
#endif /* GEQO_GENE_H */
|
||||
|
||||
@@ -29,6 +29,6 @@
|
||||
extern void print_pool(FILE *fp, Pool *pool, int start, int stop);
|
||||
extern void print_gen(FILE *fp, Pool *pool, int generation);
|
||||
extern void print_edge_table(FILE *fp, Edge *edge_table, int num_gene);
|
||||
#endif /* GEQO_DEBUG */
|
||||
#endif /* GEQO_DEBUG */
|
||||
|
||||
#endif /* GEQO_MISC_H */
|
||||
#endif /* GEQO_MISC_H */
|
||||
|
||||
@@ -27,4 +27,4 @@
|
||||
|
||||
extern void geqo_mutation(PlannerInfo *root, Gene *tour, int num_gene);
|
||||
|
||||
#endif /* GEQO_MUTATION_H */
|
||||
#endif /* GEQO_MUTATION_H */
|
||||
|
||||
@@ -37,4 +37,4 @@ extern void spread_chromo(PlannerInfo *root, Chromosome *chromo, Pool *pool);
|
||||
|
||||
extern void sort_pool(PlannerInfo *root, Pool *pool);
|
||||
|
||||
#endif /* GEQO_POOL_H */
|
||||
#endif /* GEQO_POOL_H */
|
||||
|
||||
@@ -38,4 +38,4 @@ extern double geqo_rand(PlannerInfo *root);
|
||||
#define geqo_randint(root, upper, lower) \
|
||||
( (int) floor( geqo_rand(root)*(((upper)-(lower))+0.999999) ) + (lower) )
|
||||
|
||||
#endif /* GEQO_RANDOM_H */
|
||||
#endif /* GEQO_RANDOM_H */
|
||||
|
||||
@@ -86,4 +86,4 @@ extern void ox1(PlannerInfo *root, Gene *mom, Gene *dad, Gene *offspring,
|
||||
extern void ox2(PlannerInfo *root, Gene *mom, Gene *dad, Gene *offspring,
|
||||
int num_gene, City *city_table);
|
||||
|
||||
#endif /* GEQO_RECOMBINATION_H */
|
||||
#endif /* GEQO_RECOMBINATION_H */
|
||||
|
||||
@@ -30,4 +30,4 @@ extern void geqo_selection(PlannerInfo *root,
|
||||
Chromosome *momma, Chromosome *daddy,
|
||||
Pool *pool, double bias);
|
||||
|
||||
#endif /* GEQO_SELECTION_H */
|
||||
#endif /* GEQO_SELECTION_H */
|
||||
|
||||
@@ -27,4 +27,4 @@ extern void remove_join_clause_from_rels(PlannerInfo *root,
|
||||
RestrictInfo *restrictinfo,
|
||||
Relids join_relids);
|
||||
|
||||
#endif /* JOININFO_H */
|
||||
#endif /* JOININFO_H */
|
||||
|
||||
@@ -18,4 +18,4 @@
|
||||
|
||||
extern void extract_restriction_or_clauses(PlannerInfo *root);
|
||||
|
||||
#endif /* ORCLAUSES_H */
|
||||
#endif /* ORCLAUSES_H */
|
||||
|
||||
@@ -286,4 +286,4 @@ extern ParamPathInfo *get_joinrel_parampathinfo(PlannerInfo *root,
|
||||
extern ParamPathInfo *get_appendrel_parampathinfo(RelOptInfo *appendrel,
|
||||
Relids required_outer);
|
||||
|
||||
#endif /* PATHNODE_H */
|
||||
#endif /* PATHNODE_H */
|
||||
|
||||
@@ -228,4 +228,4 @@ extern PathKey *make_canonical_pathkey(PlannerInfo *root,
|
||||
EquivalenceClass *eclass, Oid opfamily,
|
||||
int strategy, bool nulls_first);
|
||||
|
||||
#endif /* PATHS_H */
|
||||
#endif /* PATHS_H */
|
||||
|
||||
@@ -29,4 +29,4 @@ extern void add_placeholders_to_base_rels(PlannerInfo *root);
|
||||
extern void add_placeholders_to_joinrel(PlannerInfo *root, RelOptInfo *joinrel,
|
||||
RelOptInfo *outer_rel, RelOptInfo *inner_rel);
|
||||
|
||||
#endif /* PLACEHOLDER_H */
|
||||
#endif /* PLACEHOLDER_H */
|
||||
|
||||
@@ -57,4 +57,4 @@ extern Selectivity join_selectivity(PlannerInfo *root,
|
||||
|
||||
extern bool has_row_triggers(PlannerInfo *root, Index rti, CmdType event);
|
||||
|
||||
#endif /* PLANCAT_H */
|
||||
#endif /* PLANCAT_H */
|
||||
|
||||
@@ -120,4 +120,4 @@ extern void extract_query_dependencies(Node *query,
|
||||
List **invalItems,
|
||||
bool *hasRowSecurity);
|
||||
|
||||
#endif /* PLANMAIN_H */
|
||||
#endif /* PLANMAIN_H */
|
||||
|
||||
@@ -59,4 +59,4 @@ extern bool plan_cluster_use_sort(Oid tableOid, Oid indexOid);
|
||||
|
||||
extern List *get_partitioned_child_rels(PlannerInfo *root, Index rti);
|
||||
|
||||
#endif /* PLANNER_H */
|
||||
#endif /* PLANNER_H */
|
||||
|
||||
@@ -22,4 +22,4 @@ extern bool predicate_implied_by(List *predicate_list, List *clause_list,
|
||||
extern bool predicate_refuted_by(List *predicate_list, List *clause_list,
|
||||
bool clause_is_check);
|
||||
|
||||
#endif /* PREDTEST_H */
|
||||
#endif /* PREDTEST_H */
|
||||
|
||||
@@ -58,4 +58,4 @@ extern Node *adjust_appendrel_attrs(PlannerInfo *root, Node *node,
|
||||
extern Node *adjust_appendrel_attrs_multilevel(PlannerInfo *root, Node *node,
|
||||
RelOptInfo *child_rel);
|
||||
|
||||
#endif /* PREP_H */
|
||||
#endif /* PREP_H */
|
||||
|
||||
@@ -43,4 +43,4 @@ extern bool join_clause_is_movable_into(RestrictInfo *rinfo,
|
||||
Relids currentrelids,
|
||||
Relids current_and_outer);
|
||||
|
||||
#endif /* RESTRICTINFO_H */
|
||||
#endif /* RESTRICTINFO_H */
|
||||
|
||||
@@ -40,4 +40,4 @@ extern Param *assign_nestloop_param_placeholdervar(PlannerInfo *root,
|
||||
PlaceHolderVar *phv);
|
||||
extern int SS_assign_special_param(PlannerInfo *root);
|
||||
|
||||
#endif /* SUBSELECT_H */
|
||||
#endif /* SUBSELECT_H */
|
||||
|
||||
@@ -69,4 +69,4 @@ extern void split_pathtarget_at_srfs(PlannerInfo *root,
|
||||
#define create_pathtarget(root, tlist) \
|
||||
set_pathtarget_cost_width(root, make_pathtarget_from_tlist(tlist))
|
||||
|
||||
#endif /* TLIST_H */
|
||||
#endif /* TLIST_H */
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
#define PVC_RECURSE_AGGREGATES 0x0002 /* recurse into Aggref arguments */
|
||||
#define PVC_INCLUDE_WINDOWFUNCS 0x0004 /* include WindowFuncs in output list */
|
||||
#define PVC_RECURSE_WINDOWFUNCS 0x0008 /* recurse into WindowFunc arguments */
|
||||
#define PVC_INCLUDE_PLACEHOLDERS 0x0010 /* include PlaceHolderVars in
|
||||
* output list */
|
||||
#define PVC_RECURSE_PLACEHOLDERS 0x0020 /* recurse into PlaceHolderVar
|
||||
* arguments */
|
||||
#define PVC_INCLUDE_PLACEHOLDERS 0x0010 /* include PlaceHolderVars in
|
||||
* output list */
|
||||
#define PVC_RECURSE_PLACEHOLDERS 0x0020 /* recurse into PlaceHolderVar
|
||||
* arguments */
|
||||
|
||||
|
||||
extern Relids pull_varnos(Node *node);
|
||||
@@ -37,4 +37,4 @@ extern int locate_var_of_level(Node *node, int levelsup);
|
||||
extern List *pull_var_clause(Node *node, int flags);
|
||||
extern Node *flatten_join_alias_vars(PlannerInfo *root, Node *node);
|
||||
|
||||
#endif /* VAR_H */
|
||||
#endif /* VAR_H */
|
||||
|
||||
Reference in New Issue
Block a user