--- a/src/cx/json.h Fri Nov 01 17:35:42 2024 +0100 +++ b/src/cx/json.h Fri Nov 01 18:16:32 2024 +0100 @@ -38,6 +38,7 @@ #include "common.h" #include "string.h" +#include "array_list.h" #ifdef __cplusplus extern "C" { @@ -146,15 +147,11 @@ }; struct cx_json_array_s { - CxJsonValue **array; - size_t alloc; - size_t size; + CX_ARRAY_DECLARE(CxJsonValue*, array); }; struct cx_json_object_s { - CxJsonObjValue *values; - size_t alloc; - size_t size; + CX_ARRAY_DECLARE(CxJsonObjValue, values); }; struct cx_json_obj_value_s { @@ -280,7 +277,7 @@ __attribute__((__nonnull__)) static inline size_t cxJsonArrSize(CxJsonValue *value) { - return value->value.array.size; + return value->value.array.array_size; } __attribute__((__nonnull__, __returns_nonnull__))