data: json: remove extra braces causing designated-initializer errors

When compiling in C++, the designated-initializer error:
	Either all initializer clauses should be designated
	or none of them should be

Will occur due to an extra pair of braces in the Z_JSON_DESCR_OBJ() macro.

Remove the extra pare of braces which allows the code to compile and
function in both C and C++.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
This commit is contained in:
Eric Holmberg 2025-02-04 10:49:00 +13:00 committed by Benjamin Cabé
commit 487830c380

View file

@ -237,12 +237,10 @@ typedef int (*json_append_bytes_t)(const char *bytes, size_t len,
* @param elem_descr_len_ Number of elements in elem_descr_
*/
#define Z_JSON_DESCR_OBJ(elem_descr_, elem_descr_len_) \
{ \
.object = { \
.sub_descr = elem_descr_, \
.sub_descr_len = elem_descr_len_, \
}, \
}
/**
* @brief Helper macro to declare a descriptor for an array of primitives