diff options
| author | Tom Lane | 2017-06-21 19:18:54 +0000 |
|---|---|---|
| committer | Tom Lane | 2017-06-21 19:19:25 +0000 |
| commit | c7b8998ebbf310a156aa38022555a24d98fdbfb4 (patch) | |
| tree | e85979fb1213a731b7b557f8a830df541f26b135 /src/include/rewrite | |
| parent | f669c09989bda894d6ba01634ccb229f0687c08a (diff) | |
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 e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 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
Diffstat (limited to 'src/include/rewrite')
| -rw-r--r-- | src/include/rewrite/prs2lock.h | 2 | ||||
| -rw-r--r-- | src/include/rewrite/rewriteDefine.h | 2 | ||||
| -rw-r--r-- | src/include/rewrite/rewriteHandler.h | 2 | ||||
| -rw-r--r-- | src/include/rewrite/rewriteManip.h | 4 | ||||
| -rw-r--r-- | src/include/rewrite/rewriteRemove.h | 2 | ||||
| -rw-r--r-- | src/include/rewrite/rewriteSupport.h | 2 | ||||
| -rw-r--r-- | src/include/rewrite/rowsecurity.h | 2 |
7 files changed, 8 insertions, 8 deletions
diff --git a/src/include/rewrite/prs2lock.h b/src/include/rewrite/prs2lock.h index 36dca02a7e3..419d140bd50 100644 --- a/src/include/rewrite/prs2lock.h +++ b/src/include/rewrite/prs2lock.h @@ -43,4 +43,4 @@ typedef struct RuleLock RewriteRule **rules; } RuleLock; -#endif /* REWRITE_H */ +#endif /* REWRITE_H */ diff --git a/src/include/rewrite/rewriteDefine.h b/src/include/rewrite/rewriteDefine.h index 54957009705..2e25288bb4b 100644 --- a/src/include/rewrite/rewriteDefine.h +++ b/src/include/rewrite/rewriteDefine.h @@ -41,4 +41,4 @@ extern void setRuleCheckAsUser(Node *node, Oid userid); extern void EnableDisableRule(Relation rel, const char *rulename, char fires_when); -#endif /* REWRITEDEFINE_H */ +#endif /* REWRITEDEFINE_H */ diff --git a/src/include/rewrite/rewriteHandler.h b/src/include/rewrite/rewriteHandler.h index 9857b4823b8..494fa29f10e 100644 --- a/src/include/rewrite/rewriteHandler.h +++ b/src/include/rewrite/rewriteHandler.h @@ -30,4 +30,4 @@ extern int relation_is_updatable(Oid reloid, bool include_triggers, Bitmapset *include_cols); -#endif /* REWRITEHANDLER_H */ +#endif /* REWRITEHANDLER_H */ diff --git a/src/include/rewrite/rewriteManip.h b/src/include/rewrite/rewriteManip.h index 3910bceb2aa..c76538c1338 100644 --- a/src/include/rewrite/rewriteManip.h +++ b/src/include/rewrite/rewriteManip.h @@ -28,7 +28,7 @@ struct replace_rte_variables_context void *callback_arg; /* context data for callback function */ int target_varno; /* RTE index to search for */ int sublevels_up; /* (current) nesting depth */ - bool inserted_sublink; /* have we inserted a SubLink? */ + bool inserted_sublink; /* have we inserted a SubLink? */ }; typedef enum ReplaceVarsNoMatchOption @@ -82,4 +82,4 @@ extern Node *ReplaceVarsFromTargetList(Node *node, int nomatch_varno, bool *outer_hasSubLinks); -#endif /* REWRITEMANIP_H */ +#endif /* REWRITEMANIP_H */ diff --git a/src/include/rewrite/rewriteRemove.h b/src/include/rewrite/rewriteRemove.h index 28c9be72dbc..d7d53b01372 100644 --- a/src/include/rewrite/rewriteRemove.h +++ b/src/include/rewrite/rewriteRemove.h @@ -18,4 +18,4 @@ extern void RemoveRewriteRuleById(Oid ruleOid); -#endif /* REWRITEREMOVE_H */ +#endif /* REWRITEREMOVE_H */ diff --git a/src/include/rewrite/rewriteSupport.h b/src/include/rewrite/rewriteSupport.h index d287bbda789..60800aae250 100644 --- a/src/include/rewrite/rewriteSupport.h +++ b/src/include/rewrite/rewriteSupport.h @@ -23,4 +23,4 @@ extern void SetRelationRuleStatus(Oid relationId, bool relHasRules); extern Oid get_rewrite_oid(Oid relid, const char *rulename, bool missing_ok); -#endif /* REWRITESUPPORT_H */ +#endif /* REWRITESUPPORT_H */ diff --git a/src/include/rewrite/rowsecurity.h b/src/include/rewrite/rowsecurity.h index 260a79c3d28..0dbc1a4beed 100644 --- a/src/include/rewrite/rowsecurity.h +++ b/src/include/rewrite/rowsecurity.h @@ -46,4 +46,4 @@ extern void get_row_security_policies(Query *root, List **securityQuals, List **withCheckOptions, bool *hasRowSecurity, bool *hasSubLinks); -#endif /* ROWSECURITY_H */ +#endif /* ROWSECURITY_H */ |
