diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2024-10-01 09:30:24 -0400 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2024-10-01 09:30:24 -0400 |
commit | 10b721821d6d6e27e594549cf105476dc28514c8 (patch) | |
tree | 52d7fba71044f7c2edcb41fe222777f6500c189d /src/bin | |
parent | fc1b2ce0ee9c9745c5c562b692e021344a3f719a (diff) | |
download | postgresql-10b721821d6d6e27e594549cf105476dc28514c8.tar.gz postgresql-10b721821d6d6e27e594549cf105476dc28514c8.zip |
Use macro to define the number of enum values
Refactoring in the interest of code consistency, a follow-up to 2e068db56e31.
The argument against inserting a special enum value at the end of the enum
definition is that a switch statement might generate a compiler warning unless
it has a default clause.
Aleksander Alekseev, reviewed by Michael Paquier, Dean Rasheed, Peter Eisentraut
Discussion: https://postgr.es/m/CAJ7c6TMsiaV5urU_Pq6zJ2tXPDwk69-NKVh4AMN5XrRiM7N%2BGA%40mail.gmail.com
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/pg_dump/pg_backup.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h index fbf5f1c515e..68ae2970ade 100644 --- a/src/bin/pg_dump/pg_backup.h +++ b/src/bin/pg_dump/pg_backup.h @@ -74,9 +74,10 @@ enum _dumpPreparedQueries PREPQUERY_DUMPTABLEATTACH, PREPQUERY_GETCOLUMNACLS, PREPQUERY_GETDOMAINCONSTRAINTS, - NUM_PREP_QUERIES /* must be last */ }; +#define NUM_PREP_QUERIES (PREPQUERY_GETDOMAINCONSTRAINTS + 1) + /* Parameters needed by ConnectDatabase; same for dump and restore */ typedef struct _connParams { |