data tree REFACTOR formatting
@@ -2822,6 +2822,7 @@ lyd_create_meta(struct lyd_node *parent, struct lyd_meta **meta, const struct ly
{
LY_ERR ret = LY_SUCCESS;
struct lysc_ext_instance *ant = NULL;
+ const struct lysc_type **ant_type;
struct lyd_meta *mt, *last;
LY_ARRAY_COUNT_TYPE u;
@@ -2849,8 +2850,9 @@ lyd_create_meta(struct lyd_node *parent, struct lyd_meta **meta, const struct ly
LY_CHECK_ERR_GOTO(!mt, LOGMEM(mod->ctx); ret = LY_EMEM, cleanup);
mt->parent = parent;
mt->annotation = ant;
- ret = lyd_value_store(mod->ctx, &mt->value, *(const struct lysc_type **)ant->substmts[ANNOTATION_SUBSTMT_TYPE].storage,
- value, value_len, dynamic, format, prefix_data, hints, parent ? parent->schema : NULL, incomplete);
+ ant_type = ant->substmts[ANNOTATION_SUBSTMT_TYPE].storage;
+ ret = lyd_value_store(mod->ctx, &mt->value, *ant_type, value, value_len, dynamic, format, prefix_data, hints,
+ parent ? parent->schema : NULL, incomplete);
LY_CHECK_ERR_GOTO(ret, free(mt), cleanup);
ret = lydict_insert(mod->ctx, name, name_len, &mt->name);
LY_CHECK_ERR_GOTO(ret, free(mt), cleanup);
