Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f83bf38

Browse files
committed
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.
1 parent a0854f1 commit f83bf38

File tree

6 files changed

+118
-22
lines changed

6 files changed

+118
-22
lines changed

contrib/pg_trgm/trgm_op.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ typedef struct
4848

4949
/* Trigram bound type */
5050
typedef uint8 TrgmBound;
51-
#define TRGM_BOUND_LEFT (0x01) /* trigram is left bound of word */
52-
#define TRGM_BOUND_RIGHT (0x02) /* trigram is right bound of word */
51+
#define TRGM_BOUND_LEFT 0x01 /* trigram is left bound of word */
52+
#define TRGM_BOUND_RIGHT 0x02 /* trigram is right bound of word */
5353

5454
/* Word similarity flags */
55-
#define WORD_SIMILARITY_CHECK_ONLY (0x01) /* if set then only check existence
56-
* of similar search pattern in text */
57-
#define WORD_SIMILARITY_STRICT (0x02) /* force bounds of extent to match
58-
* word bounds */
55+
#define WORD_SIMILARITY_CHECK_ONLY 0x01 /* only check existence of similar
56+
* search pattern in text */
57+
#define WORD_SIMILARITY_STRICT 0x02 /* force bounds of extent to match
58+
* word bounds */
5959

6060
/*
6161
* Module load callback

src/backend/libpq/be-secure-common.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ run_ssl_passphrase_command(const char *prompt, bool is_server_start, char *buf,
114114

115115
/* strip trailing newline */
116116
len = strlen(buf);
117-
if (buf[len - 1] == '\n')
118-
buf[len-- -1] = '\0';
117+
if (len > 0 && buf[len - 1] == '\n')
118+
buf[--len] = '\0';
119119

120120
error:
121121
pfree(command.data);

src/include/storage/reinit.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020

2121
extern void ResetUnloggedRelations(int op);
22-
extern bool parse_filename_for_nontemp_relation(
23-
const char *name, int *oidchars, ForkNumber *fork);
22+
extern bool parse_filename_for_nontemp_relation(const char *name,
23+
int *oidchars, ForkNumber *fork);
2424

2525
#define UNLOGGED_RELATION_CLEANUP 0x0001
2626
#define UNLOGGED_RELATION_INIT 0x0002

src/port/pg_crc32c_armv8.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,20 @@ pg_comp_crc32c_armv8(pg_crc32c crc, const void *data, size_t len)
2929
* significantly faster. Process leading bytes so that the loop below
3030
* starts with a pointer aligned to eight bytes.
3131
*/
32-
if (!PointerIsAligned(p, uint16) && p + 1 <= pend)
32+
if (!PointerIsAligned(p, uint16) &&
33+
p + 1 <= pend)
3334
{
3435
crc = __crc32cb(crc, *p);
3536
p += 1;
3637
}
37-
if (!PointerIsAligned(p, uint32) && p + 2 <= pend)
38+
if (!PointerIsAligned(p, uint32) &&
39+
p + 2 <= pend)
3840
{
3941
crc = __crc32ch(crc, *(uint16 *) p);
4042
p += 2;
4143
}
42-
if (!PointerIsAligned(p, uint64) && p + 4 <= pend)
44+
if (!PointerIsAligned(p, uint64) &&
45+
p + 4 <= pend)
4346
{
4447
crc = __crc32cw(crc, *(uint32 *) p);
4548
p += 4;

src/tools/pgindent/pgindent

+4-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ $excludes ||= "$code_base/src/tools/pgindent/exclude_file_patterns"
5959
# easier to configure. Note that the typedefs need trailing newlines.
6060
my @whitelist = ("bool\n");
6161

62-
my %blacklist = map { +"$_\n" => 1 } qw( FD_SET date interval timestamp ANY
63-
abs allocfunc iterator other pointer printfunc reference string type );
62+
my %blacklist = map { +"$_\n" => 1 } qw(
63+
ANY FD_SET U abs allocfunc boolean date digit ilist interval iterator other
64+
pointer printfunc reference string timestamp type wrap
65+
);
6466

6567
# globals
6668
my @files;

0 commit comments

Comments
 (0)