mirror of
https://github.com/postgres/postgres.git
synced 2025-08-24 09:27:52 +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:
@@ -24,14 +24,13 @@
|
||||
/*
|
||||
* XLOG records for hash operations
|
||||
*/
|
||||
#define XLOG_HASH_INIT_META_PAGE 0x00 /* initialize the meta page */
|
||||
#define XLOG_HASH_INIT_BITMAP_PAGE 0x10 /* initialize the bitmap page */
|
||||
#define XLOG_HASH_INIT_META_PAGE 0x00 /* initialize the meta page */
|
||||
#define XLOG_HASH_INIT_BITMAP_PAGE 0x10 /* initialize the bitmap page */
|
||||
#define XLOG_HASH_INSERT 0x20 /* add index tuple without split */
|
||||
#define XLOG_HASH_ADD_OVFL_PAGE 0x30 /* add overflow page */
|
||||
#define XLOG_HASH_SPLIT_ALLOCATE_PAGE 0x40 /* allocate new page for split */
|
||||
#define XLOG_HASH_SPLIT_PAGE 0x50 /* split page */
|
||||
#define XLOG_HASH_SPLIT_COMPLETE 0x60 /* completion of split
|
||||
* operation */
|
||||
#define XLOG_HASH_SPLIT_COMPLETE 0x60 /* completion of split operation */
|
||||
#define XLOG_HASH_MOVE_PAGE_CONTENTS 0x70 /* remove tuples from one page
|
||||
* and add to another page */
|
||||
#define XLOG_HASH_SQUEEZE_PAGE 0x80 /* add tuples to one of the previous
|
||||
@@ -41,11 +40,10 @@
|
||||
#define XLOG_HASH_SPLIT_CLEANUP 0xA0 /* clear split-cleanup flag in primary
|
||||
* bucket page after deleting tuples
|
||||
* that are moved due to split */
|
||||
#define XLOG_HASH_UPDATE_META_PAGE 0xB0 /* update meta page after
|
||||
* vacuum */
|
||||
#define XLOG_HASH_UPDATE_META_PAGE 0xB0 /* update meta page after vacuum */
|
||||
|
||||
#define XLOG_HASH_VACUUM_ONE_PAGE 0xC0 /* remove dead tuples from
|
||||
* index page */
|
||||
#define XLOG_HASH_VACUUM_ONE_PAGE 0xC0 /* remove dead tuples from index
|
||||
* page */
|
||||
|
||||
/*
|
||||
* xl_hash_split_allocate_page flag values, 8 bits are available.
|
||||
@@ -151,9 +149,9 @@ typedef struct xl_hash_split_complete
|
||||
typedef struct xl_hash_move_page_contents
|
||||
{
|
||||
uint16 ntups;
|
||||
bool is_prim_bucket_same_wrt; /* TRUE if the page to which
|
||||
* tuples are moved is same as
|
||||
* primary bucket page */
|
||||
bool is_prim_bucket_same_wrt; /* TRUE if the page to which
|
||||
* tuples are moved is same as
|
||||
* primary bucket page */
|
||||
} xl_hash_move_page_contents;
|
||||
|
||||
#define SizeOfHashMovePageContents \
|
||||
@@ -176,13 +174,13 @@ typedef struct xl_hash_squeeze_page
|
||||
BlockNumber prevblkno;
|
||||
BlockNumber nextblkno;
|
||||
uint16 ntups;
|
||||
bool is_prim_bucket_same_wrt; /* TRUE if the page to which
|
||||
* tuples are moved is same as
|
||||
* primary bucket page */
|
||||
bool is_prev_bucket_same_wrt; /* TRUE if the page to which
|
||||
* tuples are moved is the
|
||||
* page previous to the freed
|
||||
* overflow page */
|
||||
bool is_prim_bucket_same_wrt; /* TRUE if the page to which
|
||||
* tuples are moved is same as
|
||||
* primary bucket page */
|
||||
bool is_prev_bucket_same_wrt; /* TRUE if the page to which
|
||||
* tuples are moved is the page
|
||||
* previous to the freed overflow
|
||||
* page */
|
||||
} xl_hash_squeeze_page;
|
||||
|
||||
#define SizeOfHashSqueezePage \
|
||||
@@ -198,8 +196,8 @@ typedef struct xl_hash_squeeze_page
|
||||
*/
|
||||
typedef struct xl_hash_delete
|
||||
{
|
||||
bool clear_dead_marking; /* TRUE if this operation clears
|
||||
* LH_PAGE_HAS_DEAD_TUPLES flag */
|
||||
bool clear_dead_marking; /* TRUE if this operation clears
|
||||
* LH_PAGE_HAS_DEAD_TUPLES flag */
|
||||
bool is_primary_bucket_page; /* TRUE if the operation is for
|
||||
* primary bucket page */
|
||||
} xl_hash_delete;
|
||||
@@ -279,4 +277,4 @@ extern void hash_desc(StringInfo buf, XLogReaderState *record);
|
||||
extern const char *hash_identify(uint8 info);
|
||||
extern void hash_mask(char *pagedata, BlockNumber blkno);
|
||||
|
||||
#endif /* HASH_XLOG_H */
|
||||
#endif /* HASH_XLOG_H */
|
||||
|
Reference in New Issue
Block a user