plugins exts UPDATE require ext storage to be a pointer
There are no other use-cases anyway and it being
a uint64_t number causes issues on 32b platforms.
diff --git a/src/plugins_exts/metadata.c b/src/plugins_exts/metadata.c
index aa6cb43..baec86f 100644
--- a/src/plugins_exts/metadata.c
+++ b/src/plugins_exts/metadata.c
@@ -79,27 +79,27 @@
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[0].stmt = LY_STMT_IF_FEATURE;
- ext->substmts[0].storage = (uint64_t)(uintptr_t)&ann_pdata->iffeatures;
+ ext->substmts[0].storage_p = (void **)&ann_pdata->iffeatures;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[1].stmt = LY_STMT_UNITS;
- ext->substmts[1].storage = (uint64_t)(uintptr_t)&ann_pdata->units;
+ ext->substmts[1].storage_p = (void **)&ann_pdata->units;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[2].stmt = LY_STMT_STATUS;
- ext->substmts[2].storage = (uint64_t)(uintptr_t)&ann_pdata->flags;
+ ext->substmts[2].storage_p = (void **)&ann_pdata->flags;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[3].stmt = LY_STMT_TYPE;
- ext->substmts[3].storage = (uint64_t)(uintptr_t)&ann_pdata->type;
+ ext->substmts[3].storage_p = (void **)&ann_pdata->type;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[4].stmt = LY_STMT_DESCRIPTION;
- ext->substmts[4].storage = (uint64_t)(uintptr_t)&ann_pdata->dsc;
+ ext->substmts[4].storage_p = (void **)&ann_pdata->dsc;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[5].stmt = LY_STMT_REFERENCE;
- ext->substmts[5].storage = (uint64_t)(uintptr_t)&ann_pdata->ref;
+ ext->substmts[5].storage_p = (void **)&ann_pdata->ref;
if ((r = lyplg_ext_parse_extension_instance(pctx, ext))) {
return r;
@@ -139,27 +139,27 @@
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[0].stmt = LY_STMT_IF_FEATURE;
- ext->substmts[0].storage = 0;
+ ext->substmts[0].storage_p = NULL;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[1].stmt = LY_STMT_UNITS;
- ext->substmts[1].storage = (uint64_t)(uintptr_t)&ann_cdata->units;
+ ext->substmts[1].storage_p = (void **)&ann_cdata->units;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[2].stmt = LY_STMT_STATUS;
- ext->substmts[2].storage = (uint64_t)(uintptr_t)&ann_cdata->flags;
+ ext->substmts[2].storage_p = (void **)&ann_cdata->flags;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[3].stmt = LY_STMT_TYPE;
- ext->substmts[3].storage = (uint64_t)(uintptr_t)&ann_cdata->type;
+ ext->substmts[3].storage_p = (void **)&ann_cdata->type;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[4].stmt = LY_STMT_DESCRIPTION;
- ext->substmts[4].storage = (uint64_t)(uintptr_t)&ann_cdata->dsc;
+ ext->substmts[4].storage_p = (void **)&ann_cdata->dsc;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[5].stmt = LY_STMT_REFERENCE;
- ext->substmts[5].storage = (uint64_t)(uintptr_t)&ann_cdata->ref;
+ ext->substmts[5].storage_p = (void **)&ann_cdata->ref;
ret = lyplg_ext_compile_extension_instance(cctx, extp, ext);
return ret;
diff --git a/src/plugins_exts/structure.c b/src/plugins_exts/structure.c
index bc2ea0e..6aa902e 100644
--- a/src/plugins_exts/structure.c
+++ b/src/plugins_exts/structure.c
@@ -90,60 +90,60 @@
/* parse substatements */
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[0].stmt = LY_STMT_MUST;
- ext->substmts[0].storage = (uint64_t)(uintptr_t)&struct_pdata->musts;
+ ext->substmts[0].storage_p = (void **)&struct_pdata->musts;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[1].stmt = LY_STMT_STATUS;
- ext->substmts[1].storage = (uint64_t)(uintptr_t)&struct_pdata->flags;
+ ext->substmts[1].storage_p = (void **)&struct_pdata->flags;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[2].stmt = LY_STMT_DESCRIPTION;
- ext->substmts[2].storage = (uint64_t)(uintptr_t)&struct_pdata->dsc;
+ ext->substmts[2].storage_p = (void **)&struct_pdata->dsc;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[3].stmt = LY_STMT_REFERENCE;
- ext->substmts[3].storage = (uint64_t)(uintptr_t)&struct_pdata->ref;
+ ext->substmts[3].storage_p = (void **)&struct_pdata->ref;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[4].stmt = LY_STMT_TYPEDEF;
- ext->substmts[4].storage = (uint64_t)(uintptr_t)&struct_pdata->typedefs;
+ ext->substmts[4].storage_p = (void **)&struct_pdata->typedefs;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[5].stmt = LY_STMT_GROUPING;
- ext->substmts[5].storage = (uint64_t)(uintptr_t)&struct_pdata->groupings;
+ ext->substmts[5].storage_p = (void **)&struct_pdata->groupings;
/* data-def-stmt */
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[6].stmt = LY_STMT_CONTAINER;
- ext->substmts[6].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
+ ext->substmts[6].storage_p = (void **)&struct_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[7].stmt = LY_STMT_LEAF;
- ext->substmts[7].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
+ ext->substmts[7].storage_p = (void **)&struct_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[8].stmt = LY_STMT_LEAF_LIST;
- ext->substmts[8].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
+ ext->substmts[8].storage_p = (void **)&struct_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[9].stmt = LY_STMT_LIST;
- ext->substmts[9].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
+ ext->substmts[9].storage_p = (void **)&struct_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[10].stmt = LY_STMT_CHOICE;
- ext->substmts[10].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
+ ext->substmts[10].storage_p = (void **)&struct_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[11].stmt = LY_STMT_ANYDATA;
- ext->substmts[11].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
+ ext->substmts[11].storage_p = (void **)&struct_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[12].stmt = LY_STMT_ANYXML;
- ext->substmts[12].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
+ ext->substmts[12].storage_p = (void **)&struct_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[13].stmt = LY_STMT_USES;
- ext->substmts[13].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
+ ext->substmts[13].storage_p = (void **)&struct_pdata->child;
rc = lyplg_ext_parse_extension_instance(pctx, ext);
return rc;
@@ -190,60 +190,60 @@
LY_ARRAY_CREATE_GOTO(cctx->ctx, ext->substmts, 14, rc, emem);
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[0].stmt = LY_STMT_MUST;
- ext->substmts[0].storage = (uint64_t)(uintptr_t)&struct_cdata->musts;
+ ext->substmts[0].storage_p = (void **)&struct_cdata->musts;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[1].stmt = LY_STMT_STATUS;
- ext->substmts[1].storage = (uint64_t)(uintptr_t)&struct_cdata->flags;
+ ext->substmts[1].storage_p = (void **)&struct_cdata->flags;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[2].stmt = LY_STMT_DESCRIPTION;
- ext->substmts[2].storage = (uint64_t)(uintptr_t)&struct_cdata->dsc;
+ ext->substmts[2].storage_p = (void **)&struct_cdata->dsc;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[3].stmt = LY_STMT_REFERENCE;
- ext->substmts[3].storage = (uint64_t)(uintptr_t)&struct_cdata->ref;
+ ext->substmts[3].storage_p = (void **)&struct_cdata->ref;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[4].stmt = LY_STMT_TYPEDEF;
- ext->substmts[4].storage = 0;
+ ext->substmts[4].storage_p = 0;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[5].stmt = LY_STMT_GROUPING;
- ext->substmts[5].storage = 0;
+ ext->substmts[5].storage_p = 0;
/* data-def-stmt */
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[6].stmt = LY_STMT_CONTAINER;
- ext->substmts[6].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
+ ext->substmts[6].storage_p = (void **)&struct_cdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[7].stmt = LY_STMT_LEAF;
- ext->substmts[7].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
+ ext->substmts[7].storage_p = (void **)&struct_cdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[8].stmt = LY_STMT_LEAF_LIST;
- ext->substmts[8].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
+ ext->substmts[8].storage_p = (void **)&struct_cdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[9].stmt = LY_STMT_LIST;
- ext->substmts[9].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
+ ext->substmts[9].storage_p = (void **)&struct_cdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[10].stmt = LY_STMT_CHOICE;
- ext->substmts[10].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
+ ext->substmts[10].storage_p = (void **)&struct_cdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[11].stmt = LY_STMT_ANYDATA;
- ext->substmts[11].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
+ ext->substmts[11].storage_p = (void **)&struct_cdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[12].stmt = LY_STMT_ANYXML;
- ext->substmts[12].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
+ ext->substmts[12].storage_p = (void **)&struct_cdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[13].stmt = LY_STMT_USES;
- ext->substmts[13].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
+ ext->substmts[13].storage_p = (void **)&struct_cdata->child;
*lyplg_ext_compile_get_options(cctx) |= LYS_COMPILE_NO_CONFIG | LYS_COMPILE_NO_DISABLED;
rc = lyplg_ext_compile_extension_instance(cctx, extp, ext);
@@ -339,53 +339,53 @@
/* parse substatements */
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[0].stmt = LY_STMT_STATUS;
- ext->substmts[0].storage = (uint64_t)(uintptr_t)&aug_pdata->flags;
+ ext->substmts[0].storage_p = (void **)&aug_pdata->flags;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[1].stmt = LY_STMT_DESCRIPTION;
- ext->substmts[1].storage = (uint64_t)(uintptr_t)&aug_pdata->dsc;
+ ext->substmts[1].storage_p = (void **)&aug_pdata->dsc;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[2].stmt = LY_STMT_REFERENCE;
- ext->substmts[2].storage = (uint64_t)(uintptr_t)&aug_pdata->ref;
+ ext->substmts[2].storage_p = (void **)&aug_pdata->ref;
/* data-def-stmt */
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[3].stmt = LY_STMT_CONTAINER;
- ext->substmts[3].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
+ ext->substmts[3].storage_p = (void **)&aug_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[4].stmt = LY_STMT_LEAF;
- ext->substmts[4].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
+ ext->substmts[4].storage_p = (void **)&aug_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[5].stmt = LY_STMT_LEAF_LIST;
- ext->substmts[5].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
+ ext->substmts[5].storage_p = (void **)&aug_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[6].stmt = LY_STMT_LIST;
- ext->substmts[6].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
+ ext->substmts[6].storage_p = (void **)&aug_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[7].stmt = LY_STMT_CHOICE;
- ext->substmts[7].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
+ ext->substmts[7].storage_p = (void **)&aug_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[8].stmt = LY_STMT_ANYDATA;
- ext->substmts[8].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
+ ext->substmts[8].storage_p = (void **)&aug_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[9].stmt = LY_STMT_ANYXML;
- ext->substmts[9].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
+ ext->substmts[9].storage_p = (void **)&aug_pdata->child;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[10].stmt = LY_STMT_USES;
- ext->substmts[10].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
+ ext->substmts[10].storage_p = (void **)&aug_pdata->child;
/* case */
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[11].stmt = LY_STMT_CASE;
- ext->substmts[11].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
+ ext->substmts[11].storage_p = (void **)&aug_pdata->child;
if ((rc = lyplg_ext_parse_extension_instance(pctx, ext))) {
return rc;
@@ -394,7 +394,7 @@
/* add fake parsed augment node */
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[12].stmt = LY_STMT_AUGMENT;
- ext->substmts[12].storage = (uint64_t)(uintptr_t)&aug_pdata->aug;
+ ext->substmts[12].storage_p = (void **)&aug_pdata->aug;
aug_pdata->aug = calloc(1, sizeof *aug_pdata->aug);
if (!aug_pdata->aug) {
@@ -476,7 +476,7 @@
assert(ctx);
- aug = (struct lysp_node_augment **)(uintptr_t)ext->substmts[12].storage;
+ aug = (struct lysp_node_augment **)ext->substmts[12].storage_p;
rc = lyplg_ext_sprinter_ptree_add_nodes(ctx, (*aug)->child, structure_sprinter_pnode);
return rc;
diff --git a/src/plugins_exts/yangdata.c b/src/plugins_exts/yangdata.c
index c9c5dd8..1736abc 100644
--- a/src/plugins_exts/yangdata.c
+++ b/src/plugins_exts/yangdata.c
@@ -58,15 +58,15 @@
LY_ARRAY_CREATE_GOTO(lyplg_ext_parse_get_cur_pmod(pctx)->mod->ctx, ext->substmts, 3, ret, emem);
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[0].stmt = LY_STMT_CONTAINER;
- ext->substmts[0].storage = (uint64_t)(uintptr_t)&ext->parsed;
+ ext->substmts[0].storage_p = (void **)&ext->parsed;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[1].stmt = LY_STMT_CHOICE;
- ext->substmts[1].storage = (uint64_t)(uintptr_t)&ext->parsed;
+ ext->substmts[1].storage_p = (void **)&ext->parsed;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[2].stmt = LY_STMT_USES;
- ext->substmts[2].storage = (uint64_t)(uintptr_t)&ext->parsed;
+ ext->substmts[2].storage_p = (void **)&ext->parsed;
if ((ret = lyplg_ext_parse_extension_instance(pctx, ext))) {
return ret;
@@ -96,15 +96,15 @@
LY_ARRAY_CREATE_GOTO(cctx->ctx, ext->substmts, 3, ret, emem);
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[0].stmt = LY_STMT_CONTAINER;
- ext->substmts[0].storage = (uint64_t)(uintptr_t)&ext->compiled;
+ ext->substmts[0].storage_p = (void **)&ext->compiled;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[1].stmt = LY_STMT_CHOICE;
- ext->substmts[1].storage = (uint64_t)(uintptr_t)&ext->compiled;
+ ext->substmts[1].storage_p = (void **)&ext->compiled;
LY_ARRAY_INCREMENT(ext->substmts);
ext->substmts[2].stmt = LY_STMT_USES;
- ext->substmts[2].storage = (uint64_t)(uintptr_t)&ext->compiled;
+ ext->substmts[2].storage_p = (void **)&ext->compiled;
*lyplg_ext_compile_get_options(cctx) |= LYS_COMPILE_NO_CONFIG | LYS_COMPILE_NO_DISABLED;
ret = lyplg_ext_compile_extension_instance(cctx, extp, ext);