zephyr/include/zephyr/data
René Beckmann 4978a651a7 lib: json: Use int32_t in examples
All examples in the header showcase the use of the type int in
structs that values should be parsed into (or serialized out of).
However, that is probably a bad idea if we consider the function
get_elem_size in the JSON library that calculates the field size:

static ptrdiff_t get_elem_size(const struct json_obj_descr *descr)
{
	switch (descr->type) {
	case JSON_TOK_NUMBER:
		return sizeof(int32_t);
	...
}

Hence, using int in structs on platforms where an int is not 32
bits wide (as rare as they may be) is probably a bad idea and will
lead to confusing errors and undefined behavior.

Signed-off-by: René Beckmann <rene.beckmann@grandcentrix.net>
2023-03-30 09:41:46 -04:00
..
json.h lib: json: Use int32_t in examples 2023-03-30 09:41:46 -04:00
jwt.h