diff options
| author | Peter Eisentraut | 2024-06-21 05:50:02 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2024-06-21 05:53:30 +0000 |
| commit | 0b06bf9fa972e2964401622f1bb4c611dbe92bd5 (patch) | |
| tree | 9ad5f17e338e22d13219a5a9e970801ac646c6cc /src/include/common | |
| parent | 7a089f6e6a14ca3a5dc8822c393c6620279968b9 (diff) | |
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 <andrew@dunslane.net>
Discussion: https://www.postgresql.org/message-id/flat/f732b014-f614-4600-a437-dba5a2c3738b%40eisentraut.org
Diffstat (limited to 'src/include/common')
| -rw-r--r-- | src/include/common/jsonapi.h | 8 | ||||
| -rw-r--r-- | src/include/common/parse_manifest.h | 2 |
2 files changed, 5 insertions, 5 deletions
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 */ diff --git a/src/include/common/parse_manifest.h b/src/include/common/parse_manifest.h index 0d04239c38d..2777b1e9d22 100644 --- a/src/include/common/parse_manifest.h +++ b/src/include/common/parse_manifest.h @@ -51,7 +51,7 @@ extern void json_parse_manifest(JsonManifestParseContext *context, char *buffer, size_t size); extern JsonManifestParseIncrementalState *json_parse_manifest_incremental_init(JsonManifestParseContext *context); extern void json_parse_manifest_incremental_chunk( - JsonManifestParseIncrementalState *incstate, char *chunk, int size, + JsonManifestParseIncrementalState *incstate, char *chunk, size_t size, bool is_last); extern void json_parse_manifest_incremental_shutdown(JsonManifestParseIncrementalState *incstate); |
