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/lib | |
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/[email protected]
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/include/lib')
-rw-r--r-- | src/include/lib/binaryheap.h | 2 | ||||
-rw-r--r-- | src/include/lib/bipartite_match.h | 2 | ||||
-rw-r--r-- | src/include/lib/hyperloglog.h | 2 | ||||
-rw-r--r-- | src/include/lib/ilist.h | 4 | ||||
-rw-r--r-- | src/include/lib/knapsack.h | 2 | ||||
-rw-r--r-- | src/include/lib/pairingheap.h | 2 | ||||
-rw-r--r-- | src/include/lib/rbtree.h | 2 | ||||
-rw-r--r-- | src/include/lib/simplehash.h | 6 | ||||
-rw-r--r-- | src/include/lib/stringinfo.h | 2 |
9 files changed, 12 insertions, 12 deletions
diff --git a/src/include/lib/binaryheap.h b/src/include/lib/binaryheap.h index a4bbb390eab..da7504bd55d 100644 --- a/src/include/lib/binaryheap.h +++ b/src/include/lib/binaryheap.h @@ -51,4 +51,4 @@ extern void binaryheap_replace_first(binaryheap *heap, Datum d); #define binaryheap_empty(h) ((h)->bh_size == 0) -#endif /* BINARYHEAP_H */ +#endif /* BINARYHEAP_H */ diff --git a/src/include/lib/bipartite_match.h b/src/include/lib/bipartite_match.h index d662b3821e3..8f580bbd972 100644 --- a/src/include/lib/bipartite_match.h +++ b/src/include/lib/bipartite_match.h @@ -43,4 +43,4 @@ extern BipartiteMatchState *BipartiteMatch(int u_size, int v_size, short **adjac extern void BipartiteMatchFree(BipartiteMatchState *state); -#endif /* BIPARTITE_MATCH_H */ +#endif /* BIPARTITE_MATCH_H */ diff --git a/src/include/lib/hyperloglog.h b/src/include/lib/hyperloglog.h index dd40fe9b003..7a249cd2521 100644 --- a/src/include/lib/hyperloglog.h +++ b/src/include/lib/hyperloglog.h @@ -65,4 +65,4 @@ extern void addHyperLogLog(hyperLogLogState *cState, uint32 hash); extern double estimateHyperLogLog(hyperLogLogState *cState); extern void freeHyperLogLog(hyperLogLogState *cState); -#endif /* HYPERLOGLOG_H */ +#endif /* HYPERLOGLOG_H */ diff --git a/src/include/lib/ilist.h b/src/include/lib/ilist.h index 8a44c90c4fd..e5ac5c218a4 100644 --- a/src/include/lib/ilist.h +++ b/src/include/lib/ilist.h @@ -266,7 +266,7 @@ extern void slist_check(slist_head *head); */ #define dlist_check(head) ((void) (head)) #define slist_check(head) ((void) (head)) -#endif /* ILIST_DEBUG */ +#endif /* ILIST_DEBUG */ /* doubly linked list implementation */ @@ -724,4 +724,4 @@ slist_delete_current(slist_mutable_iter *iter) (iter).cur = (iter).next, \ (iter).next = (iter).next ? (iter).next->next : NULL) -#endif /* ILIST_H */ +#endif /* ILIST_H */ diff --git a/src/include/lib/knapsack.h b/src/include/lib/knapsack.h index 8d1e6d0aa04..4485738e2a8 100644 --- a/src/include/lib/knapsack.h +++ b/src/include/lib/knapsack.h @@ -14,4 +14,4 @@ extern Bitmapset *DiscreteKnapsack(int max_weight, int num_items, int *item_weights, double *item_values); -#endif /* KNAPSACK_H */ +#endif /* KNAPSACK_H */ diff --git a/src/include/lib/pairingheap.h b/src/include/lib/pairingheap.h index 0b03a24fa13..c8dd60255f1 100644 --- a/src/include/lib/pairingheap.h +++ b/src/include/lib/pairingheap.h @@ -99,4 +99,4 @@ extern char *pairingheap_dump(pairingheap *heap, #define pairingheap_is_singular(h) \ ((h)->ph_root && (h)->ph_root->first_child == NULL) -#endif /* PAIRINGHEAP_H */ +#endif /* PAIRINGHEAP_H */ diff --git a/src/include/lib/rbtree.h b/src/include/lib/rbtree.h index 7e2b7ae71b9..a7183bb0b48 100644 --- a/src/include/lib/rbtree.h +++ b/src/include/lib/rbtree.h @@ -79,4 +79,4 @@ extern void rb_begin_iterate(RBTree *rb, RBOrderControl ctrl, RBTreeIterator *iter); extern RBNode *rb_iterate(RBTreeIterator *iter); -#endif /* RBTREE_H */ +#endif /* RBTREE_H */ diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h index 061d9c373f1..c5af5b96a73 100644 --- a/src/include/lib/simplehash.h +++ b/src/include/lib/simplehash.h @@ -149,7 +149,7 @@ SH_SCOPE void SH_START_ITERATE_AT(SH_TYPE * tb, SH_ITERATOR * iter, uint32 at); SH_SCOPE SH_ELEMENT_TYPE *SH_ITERATE(SH_TYPE * tb, SH_ITERATOR * iter); SH_SCOPE void SH_STAT(SH_TYPE * tb); -#endif /* SH_DECLARE */ +#endif /* SH_DECLARE */ /* generate implementation of the hash table */ @@ -788,7 +788,7 @@ SH_START_ITERATE_AT(SH_TYPE * tb, SH_ITERATOR * iter, uint32 at) * Iterate backwards, that allows the current element to be deleted, even * if there are backward shifts. */ - iter->cur = at & tb->sizemask; /* ensure at is within a valid range */ + iter->cur = at & tb->sizemask; /* ensure at is within a valid range */ iter->end = iter->cur; iter->done = false; } @@ -899,7 +899,7 @@ SH_STAT(SH_TYPE * tb) total_collisions, max_collisions, avg_collisions); } -#endif /* SH_DEFINE */ +#endif /* SH_DEFINE */ /* undefine external parameters, so next hash table can be defined */ diff --git a/src/include/lib/stringinfo.h b/src/include/lib/stringinfo.h index 316c196565b..9694ea3f219 100644 --- a/src/include/lib/stringinfo.h +++ b/src/include/lib/stringinfo.h @@ -149,4 +149,4 @@ extern void appendBinaryStringInfo(StringInfo str, */ extern void enlargeStringInfo(StringInfo str, int needed); -#endif /* STRINGINFO_H */ +#endif /* STRINGINFO_H */ |