aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2024-04-27 07:02:57 -0400
committerAndrew Dunstan <andrew@dunslane.net>2024-04-27 07:02:57 -0400
commite00b4f79e7367272b436dea6f15d6f421f3d6e1a (patch)
tree1f494bb88094e977f28d5bb5b38251c4b844ae3c
parented52df3b19ee77cca7cb5f202950704f6b12feb9 (diff)
downloadpostgresql-e00b4f79e7367272b436dea6f15d6f421f3d6e1a.tar.gz
postgresql-e00b4f79e7367272b436dea6f15d6f421f3d6e1a.zip
Remove redundant JSON parser typedefs
JsonNonTerminal and JsonParserSem were added in commit 3311ea86ed These names of these two enums are not actually used, so there is no need for typedefs. Instead use plain enums to declare the constants. Noticed by Alvaro Herera.
-rw-r--r--src/common/jsonapi.c8
-rw-r--r--src/tools/pgindent/typedefs.list2
2 files changed, 4 insertions, 6 deletions
diff --git a/src/common/jsonapi.c b/src/common/jsonapi.c
index 12fabcaccf4..fc0cb369749 100644
--- a/src/common/jsonapi.c
+++ b/src/common/jsonapi.c
@@ -50,16 +50,16 @@ typedef enum /* contexts of JSON parser */
* tokens, non-terminals, and semantic action markers.
*/
-typedef enum
+enum JsonNonTerminal
{
JSON_NT_JSON = 32,
JSON_NT_ARRAY_ELEMENTS,
JSON_NT_MORE_ARRAY_ELEMENTS,
JSON_NT_KEY_PAIRS,
JSON_NT_MORE_KEY_PAIRS,
-} JsonNonTerminal;
+};
-typedef enum
+enum JsonParserSem
{
JSON_SEM_OSTART = 64,
JSON_SEM_OEND,
@@ -72,7 +72,7 @@ typedef enum
JSON_SEM_AELEM_END,
JSON_SEM_SCALAR_INIT,
JSON_SEM_SCALAR_CALL,
-} JsonParserSem;
+};
/*
* struct containing the 3 stacks used in non-recursive parsing,
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index 90a7c389b21..e10ff28ee54 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -1312,14 +1312,12 @@ JsonManifestParseIncrementalState
JsonManifestParseState
JsonManifestSemanticState
JsonManifestWALRangeField
-JsonNonTerminal
JsonObjectAgg
JsonObjectConstructor
JsonOutput
JsonParseExpr
JsonParseContext
JsonParseErrorType
-JsonParserSem
JsonParserStack
JsonPath
JsonPathBool