data tree REFACTOR use common union in all data nodes
Also, now redundant casting removed where possible.
Fixes #1388
diff --git a/src/tree_data_helpers.c b/src/tree_data_helpers.c
index 78f53af..02bc433 100644
--- a/src/tree_data_helpers.c
+++ b/src/tree_data_helpers.c
@@ -92,7 +92,7 @@
return NULL;
}
- return (struct lyd_node *)(node)->parent;
+ return &node->parent->node;
}
API struct lyd_node *
@@ -106,7 +106,7 @@
if (!node->schema) {
/* opaq node */
- return ((struct lyd_node_opaq *)(node))->child;
+ return ((struct lyd_node_opaq *)node)->child;
}
children = lyd_node_children_p((struct lyd_node *)node);
@@ -128,7 +128,7 @@
if (!node->schema) {
/* opaq node */
- return ((struct lyd_node_opaq *)(node))->child;
+ return ((struct lyd_node_opaq *)node)->child;
}
children = lyd_node_children_p((struct lyd_node *)node);