libyang FEATURE introduce and use new ly_bool type
To indicate simple flags or true/false return values, use a standalone
ly_bool type.
We do not use stdbool's bool type to avoid need to mimic all its
features on platforms that do not provide it. ly_bool is just a simple
rename for uint8_t and the reason to use it is only a better readability
of the meaning of the variables or function's return values.
diff --git a/src/json.c b/src/json.c
index 7656d5c..e1ec822 100644
--- a/src/json.c
+++ b/src/json.c
@@ -87,7 +87,7 @@
* @brief Set value corresponding to the current context's status
*/
static void
-lyjson_ctx_set_value(struct lyjson_ctx *jsonctx, const char *value, size_t value_len, uint8_t dynamic)
+lyjson_ctx_set_value(struct lyjson_ctx *jsonctx, const char *value, size_t value_len, ly_bool dynamic)
{
assert(jsonctx);
@@ -437,7 +437,7 @@
}
}
/* copy the value */
- uint8_t dp_placed;
+ ly_bool dp_placed;
size_t j;
for (dp_placed = dp_position ? 0 : 1, j = minus; j < exponent; j++) {
if (in[j] == '.') {
@@ -681,7 +681,7 @@
lyjson_ctx_next(struct lyjson_ctx *jsonctx, enum LYJSON_PARSER_STATUS *status)
{
LY_ERR ret = LY_SUCCESS;
- uint8_t toplevel = 0;
+ ly_bool toplevel = 0;
enum LYJSON_PARSER_STATUS prev;
assert(jsonctx);