diff options
author | Peter Eisentraut | 2023-10-26 07:16:25 +0000 |
---|---|---|
committer | Peter Eisentraut | 2023-10-26 07:20:54 +0000 |
commit | 611806cd726fc92989ac918eac48fd8d684869c7 (patch) | |
tree | 4ed4dc6fc9a1c5825bf42072e28312440484db28 /src/include/common | |
parent | f0efa5aec19358e2282d4968a03db1db56f0ac3f (diff) |
Add trailing commas to enum definitions
Since C99, there can be a trailing comma after the last value in an
enum definition. A lot of new code has been introducing this style on
the fly. Some new patches are now taking an inconsistent approach to
this. Some add the last comma on the fly if they add a new last
value, some are trying to preserve the existing style in each place,
some are even dropping the last comma if there was one. We could
nudge this all in a consistent direction if we just add the trailing
commas everywhere once.
I omitted a few places where there was a fixed "last" value that will
always stay last. I also skipped the header files of libpq and ecpg,
in case people want to use those with older compilers. There were
also a small number of cases where the enum type wasn't used anywhere
(but the enum values were), which ended up confusing pgindent a bit,
so I left those alone.
Discussion: https://www.postgresql.org/message-id/flat/386f8c45-c8ac-4681-8add-e3b0852c1620%40eisentraut.org
Diffstat (limited to 'src/include/common')
-rw-r--r-- | src/include/common/checksum_helper.h | 2 | ||||
-rw-r--r-- | src/include/common/compression.h | 2 | ||||
-rw-r--r-- | src/include/common/cryptohash.h | 2 | ||||
-rw-r--r-- | src/include/common/file_utils.h | 4 | ||||
-rw-r--r-- | src/include/common/jsonapi.h | 4 | ||||
-rw-r--r-- | src/include/common/relpath.h | 2 | ||||
-rw-r--r-- | src/include/common/saslprep.h | 2 |
7 files changed, 9 insertions, 9 deletions
diff --git a/src/include/common/checksum_helper.h b/src/include/common/checksum_helper.h index a74deef67b6..06039142cf1 100644 --- a/src/include/common/checksum_helper.h +++ b/src/include/common/checksum_helper.h @@ -33,7 +33,7 @@ typedef enum pg_checksum_type CHECKSUM_TYPE_SHA224, CHECKSUM_TYPE_SHA256, CHECKSUM_TYPE_SHA384, - CHECKSUM_TYPE_SHA512 + CHECKSUM_TYPE_SHA512, } pg_checksum_type; /* diff --git a/src/include/common/compression.h b/src/include/common/compression.h index 38aae9dd873..c94ace6e8a3 100644 --- a/src/include/common/compression.h +++ b/src/include/common/compression.h @@ -23,7 +23,7 @@ typedef enum pg_compress_algorithm PG_COMPRESSION_NONE, PG_COMPRESSION_GZIP, PG_COMPRESSION_LZ4, - PG_COMPRESSION_ZSTD + PG_COMPRESSION_ZSTD, } pg_compress_algorithm; #define PG_COMPRESSION_OPTION_WORKERS (1 << 0) diff --git a/src/include/common/cryptohash.h b/src/include/common/cryptohash.h index 24b6dbebbd8..ee267039590 100644 --- a/src/include/common/cryptohash.h +++ b/src/include/common/cryptohash.h @@ -23,7 +23,7 @@ typedef enum PG_SHA224, PG_SHA256, PG_SHA384, - PG_SHA512 + PG_SHA512, } pg_cryptohash_type; /* opaque context, private to each cryptohash implementation */ diff --git a/src/include/common/file_utils.h b/src/include/common/file_utils.h index 49d523e611f..3bb20170cbd 100644 --- a/src/include/common/file_utils.h +++ b/src/include/common/file_utils.h @@ -21,13 +21,13 @@ typedef enum PGFileType PGFILETYPE_UNKNOWN, PGFILETYPE_REG, PGFILETYPE_DIR, - PGFILETYPE_LNK + PGFILETYPE_LNK, } PGFileType; typedef enum DataDirSyncMethod { DATA_DIR_SYNC_METHOD_FSYNC, - DATA_DIR_SYNC_METHOD_SYNCFS + DATA_DIR_SYNC_METHOD_SYNCFS, } DataDirSyncMethod; struct iovec; /* avoid including port/pg_iovec.h here */ diff --git a/src/include/common/jsonapi.h b/src/include/common/jsonapi.h index 1207e542f7a..2f8533c2b73 100644 --- a/src/include/common/jsonapi.h +++ b/src/include/common/jsonapi.h @@ -30,7 +30,7 @@ typedef enum JsonTokenType JSON_TOKEN_TRUE, JSON_TOKEN_FALSE, JSON_TOKEN_NULL, - JSON_TOKEN_END + JSON_TOKEN_END, } JsonTokenType; typedef enum JsonParseErrorType @@ -54,7 +54,7 @@ typedef enum JsonParseErrorType JSON_UNICODE_UNTRANSLATABLE, JSON_UNICODE_HIGH_SURROGATE, JSON_UNICODE_LOW_SURROGATE, - JSON_SEM_ACTION_FAILED /* error should already be reported */ + JSON_SEM_ACTION_FAILED, /* error should already be reported */ } JsonParseErrorType; diff --git a/src/include/common/relpath.h b/src/include/common/relpath.h index 511c21682ec..35e73d31114 100644 --- a/src/include/common/relpath.h +++ b/src/include/common/relpath.h @@ -50,7 +50,7 @@ typedef enum ForkNumber MAIN_FORKNUM = 0, FSM_FORKNUM, VISIBILITYMAP_FORKNUM, - INIT_FORKNUM + INIT_FORKNUM, /* * NOTE: if you add a new fork, change MAX_FORKNUM and possibly diff --git a/src/include/common/saslprep.h b/src/include/common/saslprep.h index f622db962f8..a90b8e1320a 100644 --- a/src/include/common/saslprep.h +++ b/src/include/common/saslprep.h @@ -22,7 +22,7 @@ typedef enum SASLPREP_SUCCESS = 0, SASLPREP_OOM = -1, /* out of memory (only in frontend) */ SASLPREP_INVALID_UTF8 = -2, /* input is not a valid UTF-8 string */ - SASLPREP_PROHIBITED = -3 /* output would contain prohibited characters */ + SASLPREP_PROHIBITED = -3, /* output would contain prohibited characters */ } pg_saslprep_rc; extern pg_saslprep_rc pg_saslprep(const char *input, char **output); |