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/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/common')
-rw-r--r-- | src/common/cryptohash.c | 2 | ||||
-rw-r--r-- | src/common/cryptohash_openssl.c | 2 | ||||
-rw-r--r-- | src/common/hmac.c | 2 | ||||
-rw-r--r-- | src/common/hmac_openssl.c | 2 | ||||
-rw-r--r-- | src/common/jsonapi.c | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/src/common/cryptohash.c b/src/common/cryptohash.c index 42dbed72268..c4c322856bd 100644 --- a/src/common/cryptohash.c +++ b/src/common/cryptohash.c @@ -44,7 +44,7 @@ typedef enum pg_cryptohash_errno { PG_CRYPTOHASH_ERROR_NONE = 0, - PG_CRYPTOHASH_ERROR_DEST_LEN + PG_CRYPTOHASH_ERROR_DEST_LEN, } pg_cryptohash_errno; /* Internal pg_cryptohash_ctx structure */ diff --git a/src/common/cryptohash_openssl.c b/src/common/cryptohash_openssl.c index a654cd4ad40..d9ca5a14090 100644 --- a/src/common/cryptohash_openssl.c +++ b/src/common/cryptohash_openssl.c @@ -52,7 +52,7 @@ typedef enum pg_cryptohash_errno { PG_CRYPTOHASH_ERROR_NONE = 0, PG_CRYPTOHASH_ERROR_DEST_LEN, - PG_CRYPTOHASH_ERROR_OPENSSL + PG_CRYPTOHASH_ERROR_OPENSSL, } pg_cryptohash_errno; /* diff --git a/src/common/hmac.c b/src/common/hmac.c index f0b239dcf09..ea3b8c2bedb 100644 --- a/src/common/hmac.c +++ b/src/common/hmac.c @@ -43,7 +43,7 @@ typedef enum pg_hmac_errno { PG_HMAC_ERROR_NONE = 0, PG_HMAC_ERROR_OOM, - PG_HMAC_ERROR_INTERNAL + PG_HMAC_ERROR_INTERNAL, } pg_hmac_errno; /* Internal pg_hmac_ctx structure */ diff --git a/src/common/hmac_openssl.c b/src/common/hmac_openssl.c index 12be542fa27..9164f4fdfee 100644 --- a/src/common/hmac_openssl.c +++ b/src/common/hmac_openssl.c @@ -57,7 +57,7 @@ typedef enum pg_hmac_errno { PG_HMAC_ERROR_NONE = 0, PG_HMAC_ERROR_DEST_LEN, - PG_HMAC_ERROR_OPENSSL + PG_HMAC_ERROR_OPENSSL, } pg_hmac_errno; /* Internal pg_hmac_ctx structure */ diff --git a/src/common/jsonapi.c b/src/common/jsonapi.c index 18cd78b86f6..71631dbb85e 100644 --- a/src/common/jsonapi.c +++ b/src/common/jsonapi.c @@ -40,7 +40,7 @@ typedef enum /* contexts of JSON parser */ JSON_PARSE_OBJECT_LABEL, /* saw object label, expecting ':' */ JSON_PARSE_OBJECT_NEXT, /* saw object value, expecting ',' or '}' */ JSON_PARSE_OBJECT_COMMA, /* saw object ',', expecting next label */ - JSON_PARSE_END /* saw the end of a document, expect nothing */ + JSON_PARSE_END, /* saw the end of a document, expect nothing */ } JsonParseContext; static inline JsonParseErrorType json_lex_string(JsonLexContext *lex); |