misc: Replace assert include and calls by sys/__assert.h equivalent

Replace all calls to the assert macro that comes from libc by calls to
__ASSERT_NO_MSG(). This is usefull as the former might be different
depending on the libc used and the later can be customized to reduce
flash footprint.

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
This commit is contained in:
Xavier Chapron 2020-09-22 14:42:43 +02:00 committed by Carles Cufí
commit 824f423e54
35 changed files with 83 additions and 93 deletions

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <assert.h>
#include <sys/__assert.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
@ -512,7 +512,7 @@ static int arr_parse(struct json_obj *obj,
size_t *elements = (size_t *)((char *)val + elem_descr->offset);
struct token value;
assert(elem_size > 0);
__ASSERT_NO_MSG(elem_size > 0);
*elements = 0;
@ -589,7 +589,7 @@ int json_obj_parse(char *payload, size_t len,
struct json_obj obj;
int ret;
assert(descr_len < (sizeof(ret) * CHAR_BIT - 1));
__ASSERT_NO_MSG(descr_len < (sizeof(ret) * CHAR_BIT - 1));
ret = obj_init(&obj, payload, len);
if (ret < 0) {