libyang CHANGE use LY_ARRAY_SIZE_TYPE for iterator variables in LY_TREE_FOR
Because of the change in sized arrays design (780ade2101), also the
iterators and other variables used with LY_TREE_FOR or LY_TREE_SIZE
should be of LY_ARRAY_SIZE_TYPE.
Also the new LY_PRI_ARRAY_SIZE_TYPE was introduced to correctly print
the value of this type in a formatted print functions.
diff --git a/src/parser_yin.c b/src/parser_yin.c
index b33b33f..89a77fd 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -622,7 +622,7 @@
{
const char **value;
LY_ARRAY_NEW_RET(ctx->xmlctx->ctx, *values, value, LY_EMEM);
- uint32_t index = LY_ARRAY_SIZE(*values) - 1;
+ LY_ARRAY_SIZE_TYPE index = LY_ARRAY_SIZE(*values) - 1;
struct yin_subelement subelems[1] = {
{LY_STMT_EXTENSION_INSTANCE, &index, 0}
};
@@ -2820,7 +2820,7 @@
/* call responsible function */
case LY_STMT_EXTENSION_INSTANCE:
ret = yin_parse_extension_instance(ctx, kw2lyext_substmt(current_element),
- (subelem->dest) ? *((uint32_t*)subelem->dest) : 0, exts);
+ (subelem->dest) ? *((LY_ARRAY_SIZE_TYPE*)subelem->dest) : 0, exts);
break;
case LY_STMT_ACTION:
case LY_STMT_RPC:
@@ -3037,7 +3037,7 @@
}
LY_ERR
-yin_parse_extension_instance(struct lys_yin_parser_ctx *ctx, LYEXT_SUBSTMT subelem, uint32_t subelem_index,
+yin_parse_extension_instance(struct lys_yin_parser_ctx *ctx, LYEXT_SUBSTMT subelem, LY_ARRAY_SIZE_TYPE subelem_index,
struct lysp_ext_instance **exts)
{
struct lysp_ext_instance *e;