plugins exts REFACTOR cast warnings
diff --git a/src/plugins_exts/metadata.c b/src/plugins_exts/metadata.c
index 8b12a04..aa6cb43 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)&ann_pdata->iffeatures;
+    ext->substmts[0].storage = (uint64_t)(uintptr_t)&ann_pdata->iffeatures;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[1].stmt = LY_STMT_UNITS;
-    ext->substmts[1].storage = (uint64_t)&ann_pdata->units;
+    ext->substmts[1].storage = (uint64_t)(uintptr_t)&ann_pdata->units;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[2].stmt = LY_STMT_STATUS;
-    ext->substmts[2].storage = (uint64_t)&ann_pdata->flags;
+    ext->substmts[2].storage = (uint64_t)(uintptr_t)&ann_pdata->flags;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[3].stmt = LY_STMT_TYPE;
-    ext->substmts[3].storage = (uint64_t)&ann_pdata->type;
+    ext->substmts[3].storage = (uint64_t)(uintptr_t)&ann_pdata->type;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[4].stmt = LY_STMT_DESCRIPTION;
-    ext->substmts[4].storage = (uint64_t)&ann_pdata->dsc;
+    ext->substmts[4].storage = (uint64_t)(uintptr_t)&ann_pdata->dsc;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[5].stmt = LY_STMT_REFERENCE;
-    ext->substmts[5].storage = (uint64_t)&ann_pdata->ref;
+    ext->substmts[5].storage = (uint64_t)(uintptr_t)&ann_pdata->ref;
 
     if ((r = lyplg_ext_parse_extension_instance(pctx, ext))) {
         return r;
@@ -143,23 +143,23 @@
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[1].stmt = LY_STMT_UNITS;
-    ext->substmts[1].storage = (uint64_t)&ann_cdata->units;
+    ext->substmts[1].storage = (uint64_t)(uintptr_t)&ann_cdata->units;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[2].stmt = LY_STMT_STATUS;
-    ext->substmts[2].storage = (uint64_t)&ann_cdata->flags;
+    ext->substmts[2].storage = (uint64_t)(uintptr_t)&ann_cdata->flags;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[3].stmt = LY_STMT_TYPE;
-    ext->substmts[3].storage = (uint64_t)&ann_cdata->type;
+    ext->substmts[3].storage = (uint64_t)(uintptr_t)&ann_cdata->type;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[4].stmt = LY_STMT_DESCRIPTION;
-    ext->substmts[4].storage = (uint64_t)&ann_cdata->dsc;
+    ext->substmts[4].storage = (uint64_t)(uintptr_t)&ann_cdata->dsc;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[5].stmt = LY_STMT_REFERENCE;
-    ext->substmts[5].storage = (uint64_t)&ann_cdata->ref;
+    ext->substmts[5].storage = (uint64_t)(uintptr_t)&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 9c5a82b..bc2ea0e 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)&struct_pdata->musts;
+    ext->substmts[0].storage = (uint64_t)(uintptr_t)&struct_pdata->musts;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[1].stmt = LY_STMT_STATUS;
-    ext->substmts[1].storage = (uint64_t)&struct_pdata->flags;
+    ext->substmts[1].storage = (uint64_t)(uintptr_t)&struct_pdata->flags;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[2].stmt = LY_STMT_DESCRIPTION;
-    ext->substmts[2].storage = (uint64_t)&struct_pdata->dsc;
+    ext->substmts[2].storage = (uint64_t)(uintptr_t)&struct_pdata->dsc;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[3].stmt = LY_STMT_REFERENCE;
-    ext->substmts[3].storage = (uint64_t)&struct_pdata->ref;
+    ext->substmts[3].storage = (uint64_t)(uintptr_t)&struct_pdata->ref;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[4].stmt = LY_STMT_TYPEDEF;
-    ext->substmts[4].storage = (uint64_t)&struct_pdata->typedefs;
+    ext->substmts[4].storage = (uint64_t)(uintptr_t)&struct_pdata->typedefs;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[5].stmt = LY_STMT_GROUPING;
-    ext->substmts[5].storage = (uint64_t)&struct_pdata->groupings;
+    ext->substmts[5].storage = (uint64_t)(uintptr_t)&struct_pdata->groupings;
 
     /* data-def-stmt */
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[6].stmt = LY_STMT_CONTAINER;
-    ext->substmts[6].storage = (uint64_t)&struct_pdata->child;
+    ext->substmts[6].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[7].stmt = LY_STMT_LEAF;
-    ext->substmts[7].storage = (uint64_t)&struct_pdata->child;
+    ext->substmts[7].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[8].stmt = LY_STMT_LEAF_LIST;
-    ext->substmts[8].storage = (uint64_t)&struct_pdata->child;
+    ext->substmts[8].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[9].stmt = LY_STMT_LIST;
-    ext->substmts[9].storage = (uint64_t)&struct_pdata->child;
+    ext->substmts[9].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[10].stmt = LY_STMT_CHOICE;
-    ext->substmts[10].storage = (uint64_t)&struct_pdata->child;
+    ext->substmts[10].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[11].stmt = LY_STMT_ANYDATA;
-    ext->substmts[11].storage = (uint64_t)&struct_pdata->child;
+    ext->substmts[11].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[12].stmt = LY_STMT_ANYXML;
-    ext->substmts[12].storage = (uint64_t)&struct_pdata->child;
+    ext->substmts[12].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[13].stmt = LY_STMT_USES;
-    ext->substmts[13].storage = (uint64_t)&struct_pdata->child;
+    ext->substmts[13].storage = (uint64_t)(uintptr_t)&struct_pdata->child;
 
     rc = lyplg_ext_parse_extension_instance(pctx, ext);
     return rc;
@@ -190,19 +190,19 @@
     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)&struct_cdata->musts;
+    ext->substmts[0].storage = (uint64_t)(uintptr_t)&struct_cdata->musts;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[1].stmt = LY_STMT_STATUS;
-    ext->substmts[1].storage = (uint64_t)&struct_cdata->flags;
+    ext->substmts[1].storage = (uint64_t)(uintptr_t)&struct_cdata->flags;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[2].stmt = LY_STMT_DESCRIPTION;
-    ext->substmts[2].storage = (uint64_t)&struct_cdata->dsc;
+    ext->substmts[2].storage = (uint64_t)(uintptr_t)&struct_cdata->dsc;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[3].stmt = LY_STMT_REFERENCE;
-    ext->substmts[3].storage = (uint64_t)&struct_cdata->ref;
+    ext->substmts[3].storage = (uint64_t)(uintptr_t)&struct_cdata->ref;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[4].stmt = LY_STMT_TYPEDEF;
@@ -215,35 +215,35 @@
     /* data-def-stmt */
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[6].stmt = LY_STMT_CONTAINER;
-    ext->substmts[6].storage = (uint64_t)&struct_cdata->child;
+    ext->substmts[6].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[7].stmt = LY_STMT_LEAF;
-    ext->substmts[7].storage = (uint64_t)&struct_cdata->child;
+    ext->substmts[7].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[8].stmt = LY_STMT_LEAF_LIST;
-    ext->substmts[8].storage = (uint64_t)&struct_cdata->child;
+    ext->substmts[8].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[9].stmt = LY_STMT_LIST;
-    ext->substmts[9].storage = (uint64_t)&struct_cdata->child;
+    ext->substmts[9].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[10].stmt = LY_STMT_CHOICE;
-    ext->substmts[10].storage = (uint64_t)&struct_cdata->child;
+    ext->substmts[10].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[11].stmt = LY_STMT_ANYDATA;
-    ext->substmts[11].storage = (uint64_t)&struct_cdata->child;
+    ext->substmts[11].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[12].stmt = LY_STMT_ANYXML;
-    ext->substmts[12].storage = (uint64_t)&struct_cdata->child;
+    ext->substmts[12].storage = (uint64_t)(uintptr_t)&struct_cdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[13].stmt = LY_STMT_USES;
-    ext->substmts[13].storage = (uint64_t)&struct_cdata->child;
+    ext->substmts[13].storage = (uint64_t)(uintptr_t)&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)&aug_pdata->flags;
+    ext->substmts[0].storage = (uint64_t)(uintptr_t)&aug_pdata->flags;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[1].stmt = LY_STMT_DESCRIPTION;
-    ext->substmts[1].storage = (uint64_t)&aug_pdata->dsc;
+    ext->substmts[1].storage = (uint64_t)(uintptr_t)&aug_pdata->dsc;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[2].stmt = LY_STMT_REFERENCE;
-    ext->substmts[2].storage = (uint64_t)&aug_pdata->ref;
+    ext->substmts[2].storage = (uint64_t)(uintptr_t)&aug_pdata->ref;
 
     /* data-def-stmt */
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[3].stmt = LY_STMT_CONTAINER;
-    ext->substmts[3].storage = (uint64_t)&aug_pdata->child;
+    ext->substmts[3].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[4].stmt = LY_STMT_LEAF;
-    ext->substmts[4].storage = (uint64_t)&aug_pdata->child;
+    ext->substmts[4].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[5].stmt = LY_STMT_LEAF_LIST;
-    ext->substmts[5].storage = (uint64_t)&aug_pdata->child;
+    ext->substmts[5].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[6].stmt = LY_STMT_LIST;
-    ext->substmts[6].storage = (uint64_t)&aug_pdata->child;
+    ext->substmts[6].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[7].stmt = LY_STMT_CHOICE;
-    ext->substmts[7].storage = (uint64_t)&aug_pdata->child;
+    ext->substmts[7].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[8].stmt = LY_STMT_ANYDATA;
-    ext->substmts[8].storage = (uint64_t)&aug_pdata->child;
+    ext->substmts[8].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[9].stmt = LY_STMT_ANYXML;
-    ext->substmts[9].storage = (uint64_t)&aug_pdata->child;
+    ext->substmts[9].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[10].stmt = LY_STMT_USES;
-    ext->substmts[10].storage = (uint64_t)&aug_pdata->child;
+    ext->substmts[10].storage = (uint64_t)(uintptr_t)&aug_pdata->child;
 
     /* case */
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[11].stmt = LY_STMT_CASE;
-    ext->substmts[11].storage = (uint64_t)&aug_pdata->child;
+    ext->substmts[11].storage = (uint64_t)(uintptr_t)&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)&aug_pdata->aug;
+    ext->substmts[12].storage = (uint64_t)(uintptr_t)&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 **)ext->substmts[12].storage;
+    aug = (struct lysp_node_augment **)(uintptr_t)ext->substmts[12].storage;
     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 a07ef23..c9c5dd8 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)&ext->parsed;
+    ext->substmts[0].storage = (uint64_t)(uintptr_t)&ext->parsed;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[1].stmt = LY_STMT_CHOICE;
-    ext->substmts[1].storage = (uint64_t)&ext->parsed;
+    ext->substmts[1].storage = (uint64_t)(uintptr_t)&ext->parsed;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[2].stmt = LY_STMT_USES;
-    ext->substmts[2].storage = (uint64_t)&ext->parsed;
+    ext->substmts[2].storage = (uint64_t)(uintptr_t)&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)&ext->compiled;
+    ext->substmts[0].storage = (uint64_t)(uintptr_t)&ext->compiled;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[1].stmt = LY_STMT_CHOICE;
-    ext->substmts[1].storage = (uint64_t)&ext->compiled;
+    ext->substmts[1].storage = (uint64_t)(uintptr_t)&ext->compiled;
 
     LY_ARRAY_INCREMENT(ext->substmts);
     ext->substmts[2].stmt = LY_STMT_USES;
-    ext->substmts[2].storage = (uint64_t)&ext->compiled;
+    ext->substmts[2].storage = (uint64_t)(uintptr_t)&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);