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:
parent
25e19f89f1
commit
824f423e54
35 changed files with 83 additions and 93 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue