1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Use macro to define the number of enum values

Refactoring in the interest of code consistency, a follow-up to 2e068db56e.

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
This commit is contained in:
Peter Eisentraut
2024-10-01 09:30:24 -04:00
parent fc1b2ce0ee
commit 10b721821d
5 changed files with 10 additions and 8 deletions

View File

@ -126,10 +126,10 @@ typedef enum pgssStoreKind
*/
PGSS_PLAN = 0,
PGSS_EXEC,
PGSS_NUMKIND /* Must be last value of this enum */
} pgssStoreKind;
#define PGSS_NUMKIND (PGSS_EXEC + 1)
/*
* Hashtable key that defines the identity of a hashtable entry. We separate
* queries by user and by database even if they are otherwise identical.