Commit f83bf385 authored by Tom Lane's avatar Tom Lane

Preliminary work for pgindent run.

Update typedefs.list from current buildfarm results.  Adjust pgindent's
typedef blacklist to block some more unfortunate typedef names that have
snuck in since last time.  Manually tweak a few places where I didn't
like the initial results of pgindent'ing.
parent a0854f10
...@@ -48,13 +48,13 @@ typedef struct ...@@ -48,13 +48,13 @@ typedef struct
/* Trigram bound type */ /* Trigram bound type */
typedef uint8 TrgmBound; typedef uint8 TrgmBound;
#define TRGM_BOUND_LEFT (0x01) /* trigram is left bound of word */ #define TRGM_BOUND_LEFT 0x01 /* trigram is left bound of word */
#define TRGM_BOUND_RIGHT (0x02) /* trigram is right bound of word */ #define TRGM_BOUND_RIGHT 0x02 /* trigram is right bound of word */
/* Word similarity flags */ /* Word similarity flags */
#define WORD_SIMILARITY_CHECK_ONLY (0x01) /* if set then only check existence #define WORD_SIMILARITY_CHECK_ONLY 0x01 /* only check existence of similar
* of similar search pattern in text */ * search pattern in text */
#define WORD_SIMILARITY_STRICT (0x02) /* force bounds of extent to match #define WORD_SIMILARITY_STRICT 0x02 /* force bounds of extent to match
* word bounds */ * word bounds */
/* /*
......
...@@ -114,8 +114,8 @@ run_ssl_passphrase_command(const char *prompt, bool is_server_start, char *buf, ...@@ -114,8 +114,8 @@ run_ssl_passphrase_command(const char *prompt, bool is_server_start, char *buf,
/* strip trailing newline */ /* strip trailing newline */
len = strlen(buf); len = strlen(buf);
if (buf[len - 1] == '\n') if (len > 0 && buf[len - 1] == '\n')
buf[len-- -1] = '\0'; buf[--len] = '\0';
error: error:
pfree(command.data); pfree(command.data);
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
extern void ResetUnloggedRelations(int op); extern void ResetUnloggedRelations(int op);
extern bool parse_filename_for_nontemp_relation( extern bool parse_filename_for_nontemp_relation(const char *name,
const char *name, int *oidchars, ForkNumber *fork); int *oidchars, ForkNumber *fork);
#define UNLOGGED_RELATION_CLEANUP 0x0001 #define UNLOGGED_RELATION_CLEANUP 0x0001
#define UNLOGGED_RELATION_INIT 0x0002 #define UNLOGGED_RELATION_INIT 0x0002
......
...@@ -29,17 +29,20 @@ pg_comp_crc32c_armv8(pg_crc32c crc, const void *data, size_t len) ...@@ -29,17 +29,20 @@ pg_comp_crc32c_armv8(pg_crc32c crc, const void *data, size_t len)
* significantly faster. Process leading bytes so that the loop below * significantly faster. Process leading bytes so that the loop below
* starts with a pointer aligned to eight bytes. * starts with a pointer aligned to eight bytes.
*/ */
if (!PointerIsAligned(p, uint16) && p + 1 <= pend) if (!PointerIsAligned(p, uint16) &&
p + 1 <= pend)
{ {
crc = __crc32cb(crc, *p); crc = __crc32cb(crc, *p);
p += 1; p += 1;
} }
if (!PointerIsAligned(p, uint32) && p + 2 <= pend) if (!PointerIsAligned(p, uint32) &&
p + 2 <= pend)
{ {
crc = __crc32ch(crc, *(uint16 *) p); crc = __crc32ch(crc, *(uint16 *) p);
p += 2; p += 2;
} }
if (!PointerIsAligned(p, uint64) && p + 4 <= pend) if (!PointerIsAligned(p, uint64) &&
p + 4 <= pend)
{ {
crc = __crc32cw(crc, *(uint32 *) p); crc = __crc32cw(crc, *(uint32 *) p);
p += 4; p += 4;
......
...@@ -59,8 +59,10 @@ $excludes ||= "$code_base/src/tools/pgindent/exclude_file_patterns" ...@@ -59,8 +59,10 @@ $excludes ||= "$code_base/src/tools/pgindent/exclude_file_patterns"
# easier to configure. Note that the typedefs need trailing newlines. # easier to configure. Note that the typedefs need trailing newlines.
my @whitelist = ("bool\n"); my @whitelist = ("bool\n");
my %blacklist = map { +"$_\n" => 1 } qw( FD_SET date interval timestamp ANY my %blacklist = map { +"$_\n" => 1 } qw(
abs allocfunc iterator other pointer printfunc reference string type ); ANY FD_SET U abs allocfunc boolean date digit ilist interval iterator other
pointer printfunc reference string timestamp type wrap
);
# globals # globals
my @files; my @files;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment