@@ -51,11 +51,11 @@ typedef enum/* contexts of JSON parser */
5151static inline void json_lex (JsonLexContext * lex );
5252static inline void json_lex_string (JsonLexContext * lex );
5353static inline void json_lex_number (JsonLexContext * lex ,char * s );
54- static inline void parse_scalar (JsonLexContext * lex ,JsonSemAction sem );
55- static void parse_object_field (JsonLexContext * lex ,JsonSemAction sem );
56- static void parse_object (JsonLexContext * lex ,JsonSemAction sem );
57- static void parse_array_element (JsonLexContext * lex ,JsonSemAction sem );
58- static void parse_array (JsonLexContext * lex ,JsonSemAction sem );
54+ static inline void parse_scalar (JsonLexContext * lex ,JsonSemAction * sem );
55+ static void parse_object_field (JsonLexContext * lex ,JsonSemAction * sem );
56+ static void parse_object (JsonLexContext * lex ,JsonSemAction * sem );
57+ static void parse_array_element (JsonLexContext * lex ,JsonSemAction * sem );
58+ static void parse_array (JsonLexContext * lex ,JsonSemAction * sem );
5959static void report_parse_error (JsonParseContext ctx ,JsonLexContext * lex );
6060static void report_invalid_token (JsonLexContext * lex );
6161static int report_json_context (JsonLexContext * lex );
@@ -70,12 +70,11 @@ static void array_to_json_internal(Datum array, StringInfo result,
7070bool use_line_feeds );
7171
7272/* the null action object used for pure validation */
73- static jsonSemAction nullSemAction =
73+ static JsonSemAction nullSemAction =
7474{
7575NULL ,NULL ,NULL ,NULL ,NULL ,
7676NULL ,NULL ,NULL ,NULL ,NULL
7777};
78- static JsonSemAction NullSemAction = & nullSemAction ;
7978
8079/* Recursive Descent parser support routines */
8180
@@ -170,7 +169,7 @@ json_in(PG_FUNCTION_ARGS)
170169
171170/* validate it */
172171lex = makeJsonLexContext (result , false);
173- pg_parse_json (lex ,NullSemAction );
172+ pg_parse_json (lex ,& nullSemAction );
174173
175174/* Internal representation is the same as text, for now */
176175PG_RETURN_TEXT_P (result );
@@ -222,7 +221,7 @@ json_recv(PG_FUNCTION_ARGS)
222221
223222/* Validate it. */
224223lex = makeJsonLexContext (result , false);
225- pg_parse_json (lex ,NullSemAction );
224+ pg_parse_json (lex ,& nullSemAction );
226225
227226PG_RETURN_TEXT_P (result );
228227}
@@ -260,7 +259,7 @@ makeJsonLexContext(text *json, bool need_escapes)
260259 * pointer to a state object to be passed to those routines.
261260 */
262261void
263- pg_parse_json (JsonLexContext * lex ,JsonSemAction sem )
262+ pg_parse_json (JsonLexContext * lex ,JsonSemAction * sem )
264263{
265264JsonTokenType tok ;
266265
@@ -296,7 +295,7 @@ pg_parse_json(JsonLexContext *lex, JsonSemAction sem)
296295 * - object field
297296 */
298297static inline void
299- parse_scalar (JsonLexContext * lex ,JsonSemAction sem )
298+ parse_scalar (JsonLexContext * lex ,JsonSemAction * sem )
300299{
301300char * val = NULL ;
302301json_scalar_action sfunc = sem -> scalar ;
@@ -332,7 +331,7 @@ parse_scalar(JsonLexContext *lex, JsonSemAction sem)
332331}
333332
334333static void
335- parse_object_field (JsonLexContext * lex ,JsonSemAction sem )
334+ parse_object_field (JsonLexContext * lex ,JsonSemAction * sem )
336335{
337336/*
338337 * an object field is "fieldname" : value where value can be a scalar,
@@ -380,7 +379,7 @@ parse_object_field(JsonLexContext *lex, JsonSemAction sem)
380379}
381380
382381static void
383- parse_object (JsonLexContext * lex ,JsonSemAction sem )
382+ parse_object (JsonLexContext * lex ,JsonSemAction * sem )
384383{
385384/*
386385 * an object is a possibly empty sequence of object fields, separated by
@@ -428,7 +427,7 @@ parse_object(JsonLexContext *lex, JsonSemAction sem)
428427}
429428
430429static void
431- parse_array_element (JsonLexContext * lex ,JsonSemAction sem )
430+ parse_array_element (JsonLexContext * lex ,JsonSemAction * sem )
432431{
433432json_aelem_action astart = sem -> array_element_start ;
434433json_aelem_action aend = sem -> array_element_end ;
@@ -459,7 +458,7 @@ parse_array_element(JsonLexContext *lex, JsonSemAction sem)
459458}
460459
461460static void
462- parse_array (JsonLexContext * lex ,JsonSemAction sem )
461+ parse_array (JsonLexContext * lex ,JsonSemAction * sem )
463462{
464463/*
465464 * an array is a possibly empty sequence of array elements, separated by