public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Andrew Dunstan <[email protected]>
Cc: Jacob Champion <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: WIP Incremental JSON Parser
Date: Thu, 04 Apr 2024 11:16:28 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<CAOYmi+n1fxCt3QGz9g=GfY1+J6__vVqsAud=HYwpUrfZM_VJHw@mail.gmail.com>
	<CAD5tBcLi2ffZkktV2qrsKSBykE-N8CiYgrfbv0vZ-F7=xLFeqw@mail.gmail.com>
	<CAD5tBcJg-Ja3CcY8N+NtziFN8TL8JRWv97s=-siT=Oep2+JGjw@mail.gmail.com>
	<CAOYmi+nY=rF6dJCzaOuA3d-3FbwXCcecOs_S1NutexFA3dRXAw@mail.gmail.com>
	<CAOYmi+m8yeRLFPj68e0zOfZGKm1CAmWwrfsEmCjYxPTWn7itnA@mail.gmail.com>
	<CAD5tBcLm=+LUrGZftmRGxq1tWE9eAcviVJgEF=AX8P_=NDd=eg@mail.gmail.com>
	<CAOYmi+nEs4wVLSU4=sZU1Mf7j-bmsQoYD7CMZoEhwtNvz1jTOQ@mail.gmail.com>
	<CAD5tBcK-RzoWpwb2UBHFOoMxrn1LHaKGt_XJd9wKiQg=rwBjNA@mail.gmail.com>
	<[email protected]>
	<CAOYmi+nGbv3pGgGeWG7xTAnYo=gPXkeJ-sBT+kvZS1kfRF7H1Q@mail.gmail.com>
	<[email protected]>
	<CAOYmi+mQvywAyFZTfujatvY3u2PbzVeqotaWSdB4ipRndB3FbA@mail.gmail.com>
	<[email protected]>
	<b889cff1-! [email protected]>
	<[email protected]! ! h.pa.us>
	<[email protected]>
	<[email protected]>

I wrote:
> I think you just need to follow the standard pattern:

Yeah, the attached is enough to silence it for me.
(But personally I'd add comments saying that the typedef
appears in thus-and-such header file; see examples in
our tree.)

			regards, tom lane



Attachments:

  [text/x-diff] avoid-duplicate-typedefs.patch (1.5K, ../[email protected]/2-avoid-duplicate-typedefs.patch)
  download | inline diff:
diff --git a/src/common/jsonapi.c b/src/common/jsonapi.c
index 3d1bd37ac26..0bb46b43024 100644
--- a/src/common/jsonapi.c
+++ b/src/common/jsonapi.c
@@ -79,7 +79,7 @@ typedef enum
  * and the token and value for scalars that need to be preserved
  * across calls.
  */
-typedef struct JsonParserStack
+struct JsonParserStack
 {
 	int			stack_size;
 	char	   *prediction;
@@ -89,18 +89,18 @@ typedef struct JsonParserStack
 	bool	   *fnull;
 	JsonTokenType scalar_tok;
 	char	   *scalar_val;
-} JsonParserStack;
+};
 
 /*
  * struct containing state used when there is a possible partial token at the
  * end of a json chunk when we are doing incremental parsing.
  */
-typedef struct JsonIncrementalState
+struct JsonIncrementalState
 {
 	bool		is_last_chunk;
 	bool		partial_completed;
 	StringInfoData partial_token;
-} JsonIncrementalState;
+};
 
 /*
  * constants and macros used in the nonrecursive parser
diff --git a/src/common/parse_manifest.c b/src/common/parse_manifest.c
index 040c5597df4..f9c026a6369 100644
--- a/src/common/parse_manifest.c
+++ b/src/common/parse_manifest.c
@@ -91,12 +91,12 @@ typedef struct
 	char	   *manifest_checksum;
 } JsonManifestParseState;
 
-typedef struct JsonManifestParseIncrementalState
+struct JsonManifestParseIncrementalState
 {
 	JsonLexContext lex;
 	JsonSemAction sem;
 	pg_cryptohash_ctx *manifest_ctx;
-} JsonManifestParseIncrementalState;
+};
 
 static JsonParseErrorType json_manifest_object_start(void *state);
 static JsonParseErrorType json_manifest_object_end(void *state);


view thread (44+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: WIP Incremental JSON Parser
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox