From 0b06bf9fa972e2964401622f1bb4c611dbe92bd5 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 21 Jun 2024 07:50:02 +0200 Subject: jsonapi: Use size_t Use size_t instead of int for object sizes in the jsonapi. This makes the API better self-documenting. Reviewed-by: Andrew Dunstan Discussion: https://www.postgresql.org/message-id/flat/f732b014-f614-4600-a437-dba5a2c3738b%40eisentraut.org --- src/include/common/jsonapi.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/include/common/jsonapi.h') diff --git a/src/include/common/jsonapi.h b/src/include/common/jsonapi.h index f1ab17fc9f2..5d3ae4e09b8 100644 --- a/src/include/common/jsonapi.h +++ b/src/include/common/jsonapi.h @@ -89,7 +89,7 @@ typedef struct JsonIncrementalState JsonIncrementalState; typedef struct JsonLexContext { char *input; - int input_length; + size_t input_length; int input_encoding; char *token_start; char *token_terminator; @@ -158,7 +158,7 @@ extern JsonParseErrorType pg_parse_json(JsonLexContext *lex, extern JsonParseErrorType pg_parse_json_incremental(JsonLexContext *lex, JsonSemAction *sem, char *json, - int len, + size_t len, bool is_last); /* the null action object used for pure validation */ @@ -193,7 +193,7 @@ extern JsonParseErrorType json_count_array_elements(JsonLexContext *lex, */ extern JsonLexContext *makeJsonLexContextCstringLen(JsonLexContext *lex, char *json, - int len, + size_t len, int encoding, bool need_escapes); @@ -219,6 +219,6 @@ extern char *json_errdetail(JsonParseErrorType error, JsonLexContext *lex); * * str argument does not need to be nul-terminated. */ -extern bool IsValidJsonNumber(const char *str, int len); +extern bool IsValidJsonNumber(const char *str, size_t len); #endif /* JSONAPI_H */ -- cgit v1.2.3