diff --git a/src/parser_json.c b/src/parser_json.c
index 57d1592..a2bdbfb 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -151,7 +151,7 @@
             *prefix_p = node->schema->module->name;
             break;
         }
-        onode = (struct lyd_node_opaq*)node;
+        onode = (struct lyd_node_opaq *)node;
         if (onode->prefix.module_name) {
             *prefix_p = onode->prefix.module_name;
             break;
@@ -159,7 +159,7 @@
             *prefix_p = onode->prefix.id;
             break;
         }
-        node = (struct lyd_node*)node->parent;
+        node = (struct lyd_node *)node->parent;
     }
     *prefix_len_p = ly_strlen(module_name);
 
@@ -195,10 +195,10 @@
     *snode_p = NULL;
 
     /* get the element module */
-    if (prefix_len || (parent && !parent->schema && (((struct lyd_node_opaq*)parent)->hint & LYD_NODE_OPAQ_ISENVELOPE))) {
+    if (prefix_len || (parent && !parent->schema && (((struct lyd_node_opaq *)parent)->hint & LYD_NODE_OPAQ_ISENVELOPE))) {
         if (!prefix_len) {
             /* opaq parent (envelope) - the second part of the condition */
-            lydjson_get_node_prefix((struct lyd_node*)parent, NULL, 0, &prefix, &prefix_len);
+            lydjson_get_node_prefix((struct lyd_node *)parent, NULL, 0, &prefix, &prefix_len);
         }
         mod = ly_ctx_get_module_implemented2(lydctx->jsonctx->ctx, prefix, prefix_len);
     } else if (parent) {
@@ -220,7 +220,7 @@
         }
     }
 
-    if (parent && !parent->schema && (((struct lyd_node_opaq*)parent)->hint & LYD_NODE_OPAQ_ISENVELOPE)) {
+    if (parent && !parent->schema && (((struct lyd_node_opaq *)parent)->hint & LYD_NODE_OPAQ_ISENVELOPE)) {
         /* ignore the envelope parent when searchinf for the schema node */
         parent = NULL;
     }
@@ -553,7 +553,7 @@
 
     /* finish linking metadata */
     LY_LIST_FOR_SAFE(*first_p, next, attr) {
-        struct lyd_node_opaq *meta_container = (struct lyd_node_opaq*)attr;
+        struct lyd_node_opaq *meta_container = (struct lyd_node_opaq *)attr;
         unsigned int match = 0;
         int is_attr;
         const char *name, *prefix;
@@ -578,13 +578,13 @@
         LY_LIST_FOR(start, node) {
             if (!node->schema) {
                 /* opaq node - we are going to put into it just a generic attribute. */
-                if (strcmp(&meta_container->name[1], ((struct lyd_node_opaq*)node)->name)) {
+                if (strcmp(&meta_container->name[1], ((struct lyd_node_opaq *)node)->name)) {
                     continue;
                 }
 
-                if (((struct lyd_node_opaq*)node)->hint & LYD_NODE_OPAQ_ISLIST) {
+                if (((struct lyd_node_opaq *)node)->hint & LYD_NODE_OPAQ_ISLIST) {
                     LOGVAL(lydctx->jsonctx->ctx, LY_VLOG_LYD, node, LYVE_SYNTAX,
-                           "Metadata container references a sibling list node %s.", ((struct lyd_node_opaq*)node)->name);
+                           "Metadata container references a sibling list node %s.", ((struct lyd_node_opaq *)node)->name);
                     ret = LY_EVALID;
                     goto cleanup;
                 }
@@ -597,7 +597,7 @@
 
                 LY_LIST_FOR(meta_container->child, meta_iter) {
                     /* convert opaq node to a attribute of the opaq node */
-                    struct lyd_node_opaq *meta = (struct lyd_node_opaq*)meta_iter;
+                    struct lyd_node_opaq *meta = (struct lyd_node_opaq *)meta_iter;
                     struct ly_prefix *val_prefs = NULL;
                     int dynamic = 0;
 
@@ -632,13 +632,13 @@
 
                 LY_LIST_FOR(meta_container->child, meta_iter) {
                     /* convert opaq node to a metadata of the node */
-                    struct lyd_node_opaq *meta = (struct lyd_node_opaq*)meta_iter;
+                    struct lyd_node_opaq *meta = (struct lyd_node_opaq *)meta_iter;
                     struct lys_module *mod = NULL;
                     int dynamic = 0;
 
                     mod = ly_ctx_get_module_implemented(lydctx->jsonctx->ctx, meta->prefix.id);
                     if (mod) {
-                        ret = lyd_parser_create_meta((struct lyd_ctx*)lydctx, node, NULL, mod,
+                        ret = lyd_parser_create_meta((struct lyd_ctx *)lydctx, node, NULL, mod,
                                                      meta->name, strlen(meta->name), meta->value, ly_strlen(meta->value),
                                                      &dynamic, meta->hint, LY_PREF_JSON, NULL, snode);
                         LY_CHECK_GOTO(ret, cleanup);
@@ -780,13 +780,13 @@
     while (status != LYJSON_OBJECT_CLOSED) {
         lydjson_parse_name(lydctx->jsonctx->value, lydctx->jsonctx->value_len, &name, &name_len, &prefix, &prefix_len, &is_attr);
         if (!prefix) {
-            LOGVAL(ctx, LY_VLOG_LYD, (void*)node, LYVE_SYNTAX_JSON,
+            LOGVAL(ctx, LY_VLOG_LYD, (void *)node, LYVE_SYNTAX_JSON,
                    "Metadata in JSON must be namespace-qualified, missing prefix for \"%.*s\".",
                    lydctx->jsonctx->value_len, lydctx->jsonctx->value);
             ret = LY_EVALID;
             goto cleanup;
         } else if (is_attr) {
-            LOGVAL(ctx, LY_VLOG_LYD, (void*)node, LYVE_SYNTAX_JSON,
+            LOGVAL(ctx, LY_VLOG_LYD, (void *)node, LYVE_SYNTAX_JSON,
                    "Invalid format of the Metadata identifier in JSON, unexpected '@' in \"%.*s\"",
                    lydctx->jsonctx->value_len, lydctx->jsonctx->value);
             ret = LY_EVALID;
@@ -797,7 +797,7 @@
         mod = ly_ctx_get_module_implemented2(ctx, prefix, prefix_len);
         if (!mod) {
             if (lydctx->parse_options & LYD_PARSE_STRICT) {
-                LOGVAL(ctx, LY_VLOG_LYD, (void*)node, LYVE_REFERENCE,
+                LOGVAL(ctx, LY_VLOG_LYD, (void *)node, LYVE_REFERENCE,
                        "Prefix \"%.*s\" of the metadata \"%.*s\" does not match any module in the context.",
                        prefix_len, prefix, name_len, name);
                 ret = LY_EVALID;
@@ -820,7 +820,7 @@
         if (node->schema) {
             /* create metadata */
             meta = NULL;
-            ret = lyd_parser_create_meta((struct lyd_ctx*)lydctx, node, &meta, mod, name, name_len, lydctx->jsonctx->value,
+            ret = lyd_parser_create_meta((struct lyd_ctx *)lydctx, node, &meta, mod, name, name_len, lydctx->jsonctx->value,
                                          lydctx->jsonctx->value_len, &lydctx->jsonctx->dynamic, 0, LY_PREF_JSON, NULL, snode);
             LY_CHECK_GOTO(ret, cleanup);
 
@@ -863,9 +863,9 @@
     return ret;
 
 representation_error:
-    LOGVAL(ctx, LY_VLOG_LYD, (void*)node, LYVE_SYNTAX_JSON,
+    LOGVAL(ctx, LY_VLOG_LYD, (void *)node, LYVE_SYNTAX_JSON,
            "The attribute(s) of %s \"%s\" is expected to be represented as JSON %s, but input data contains @%s/%s.",
-           lys_nodetype2str(nodetype), node->schema ? node->schema->name : ((struct lyd_node_opaq*)node)->name,
+           lys_nodetype2str(nodetype), node->schema ? node->schema->name : ((struct lyd_node_opaq *)node)->name,
            expected, lyjson_token2str(status), in_parent ? "" : "name");
 
     return LY_EVALID;
@@ -947,11 +947,11 @@
     }
 
     /* create node */
-    lydjson_get_node_prefix((struct lyd_node*)parent, prefix, prefix_len, &module_name, &module_name_len);
+    lydjson_get_node_prefix((struct lyd_node *)parent, prefix, prefix_len, &module_name, &module_name_len);
     ret = lyd_create_opaq(lydctx->jsonctx->ctx, name, name_len, value, value_len, &dynamic, type_hint,
                           LYD_JSON, val_prefs, prefix, prefix_len, module_name, module_name_len, node_p);
     if (dynamic) {
-        free((char*)value);
+        free((char *)value);
     }
     LY_CHECK_ERR_RET(ret, ly_free_val_prefs(lydctx->jsonctx->ctx, val_prefs), ret);
 
@@ -964,7 +964,7 @@
     } else if (*status_p == LYJSON_ARRAY || *status_p == LYJSON_ARRAY_EMPTY) {
         /* process another instance of the same node */
         /* but first mark the node to be expected a list or a leaf-list */
-        ((struct lyd_node_opaq*)*node_p)->hint |= LYD_NODE_OPAQ_ISLIST;
+        ((struct lyd_node_opaq *)*node_p)->hint |= LYD_NODE_OPAQ_ISLIST;
 
         if (*status_inner_p == LYJSON_OBJECT || *status_inner_p == LYJSON_OBJECT_EMPTY) {
             /* but first process children of the object in the array */
@@ -1520,7 +1520,7 @@
         /* restore the context */
         lyjson_ctx_restore(jsonctx);
         if (dynamic) {
-            free((char*)value);
+            free((char *)value);
         }
     }
     return ret;
@@ -1718,7 +1718,7 @@
     assert(status == LYJSON_OBJECT);
 
     /* read subtree(s) */
-    ret = lydjson_subtree_r(lydctx, act_e ? (struct lyd_node_inner*)act_e : (struct lyd_node_inner*)rpc_e, &tree);
+    ret = lydjson_subtree_r(lydctx, act_e ? (struct lyd_node_inner *)act_e : (struct lyd_node_inner *)rpc_e, &tree);
     LY_CHECK_GOTO(ret, cleanup);
 
     /* finish linking metadata */
@@ -1830,7 +1830,7 @@
 
     /* read subtree(s) */
     while (lydctx->jsonctx->in->current[0] && status != LYJSON_OBJECT_CLOSED) {
-        ret = lydjson_subtree_r(lydctx, (struct lyd_node_inner*)rep_op, lyd_node_children_p(rep_op));
+        ret = lydjson_subtree_r(lydctx, (struct lyd_node_inner *)rep_op, lyd_node_children_p(rep_op));
         LY_CHECK_GOTO(ret, cleanup);
 
         status = lyjson_ctx_status(lydctx->jsonctx, 0);
