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/tools/lint/commands.c b/tools/lint/commands.c
index 90c4ae8..0ef960e 100644
--- a/tools/lint/commands.c
+++ b/tools/lint/commands.c
@@ -1275,8 +1275,8 @@
}
if (!task) {
- unsigned int len, max_len = 0;
- unsigned int u;
+ size_t len, max_len = 0;
+ LY_ARRAY_SIZE_TYPE u;
struct lysc_feature *features;
printf("%s features:\n", module->name);
@@ -1296,7 +1296,7 @@
}
LY_ARRAY_FOR(features, u) {
- printf("\t%-*s (%s)\n", max_len, features[u].name, (features[u].flags & LYS_FENABLED) ? "on" : "off");
+ printf("\t%-*s (%s)\n", (int)max_len, features[u].name, (features[u].flags & LYS_FENABLED) ? "on" : "off");
}
if (!u) {
printf("\t(none)\n");
diff --git a/tools/lint/completion.c b/tools/lint/completion.c
index f2e8461..3a5394c 100644
--- a/tools/lint/completion.c
+++ b/tools/lint/completion.c
@@ -79,7 +79,7 @@
static void
get_model_completion(const char *hint, char ***matches, unsigned int *match_count)
{
- unsigned int u;
+ LY_ARRAY_SIZE_TYPE u;
uint32_t idx = 0;
const struct lys_module *module;
void *p;