uncrustify FEATURE all spacing connected to *
diff --git a/src/common.c b/src/common.c
index 18db4f2..3a1f904 100644
--- a/src/common.c
+++ b/src/common.c
@@ -31,7 +31,7 @@
 #include "tree_schema.h"
 #include "tree_schema_internal.h"
 
-const char *const ly_stmt_list[] = {
+const char * const ly_stmt_list[] = {
     [LY_STMT_ACTION] = "action",
     [LY_STMT_ANYDATA] = "anydata",
     [LY_STMT_ANYXML] = "anyxml",
@@ -108,7 +108,7 @@
     [LY_STMT_ARG_VALUE] = "value",
 };
 
-const char *const lyext_substmt_list[] = {
+const char * const lyext_substmt_list[] = {
     [LYEXT_SUBSTMT_ARGUMENT] = "argument",
     [LYEXT_SUBSTMT_BASE] = "base",
     [LYEXT_SUBSTMT_BELONGSTO] = "belongs-to",
@@ -143,7 +143,7 @@
     [LYEXT_SUBSTMT_IFFEATURE] = "if-feature",
 };
 
-const char *const ly_devmod_list[] = {
+const char * const ly_devmod_list[] = {
     [LYS_DEV_NOT_SUPPORTED] = "not-supported",
     [LYS_DEV_ADD] = "add",
     [LYS_DEV_DELETE] = "delete",
diff --git a/src/common.h b/src/common.h
index 5f944a3..a4110ba 100644
--- a/src/common.h
+++ b/src/common.h
@@ -279,15 +279,15 @@
  *****************************************************************************/
 
 /* list of the YANG statements strings */
-extern const char *const ly_stmt_list[];
+extern const char * const ly_stmt_list[];
 #define ly_stmt2str(STMT) ly_stmt_list[STMT]
 
 /* list of the extensions' substatements strings */
-extern const char *const lyext_substmt_list[];
+extern const char * const lyext_substmt_list[];
 #define lyext_substmt2str(STMT) lyext_substmt_list[STMT]
 
 /* list of the deviate modifications strings */
-extern const char *const ly_devmod_list[];
+extern const char * const ly_devmod_list[];
 #define ly_devmod2str(TYPE) ly_devmod_list[TYPE]
 
 /******************************************************************************
diff --git a/src/context.c b/src/context.c
index 5ffca2c..59051d3 100644
--- a/src/context.c
+++ b/src/context.c
@@ -54,13 +54,13 @@
     uint8_t implemented;
     LYS_INFORMAT format;
 } internal_modules[] = {
-    {"ietf-yang-metadata", "2016-08-05", (const char*)ietf_yang_metadata_2016_08_05_yang, 1, LYS_IN_YANG},
-    {"yang", "2020-06-17", (const char*)yang_2020_06_17_yang, 1, LYS_IN_YANG},
-    {"ietf-inet-types", "2013-07-15", (const char*)ietf_inet_types_2013_07_15_yang, 0, LYS_IN_YANG},
-    {"ietf-yang-types", "2013-07-15", (const char*)ietf_yang_types_2013_07_15_yang, 0, LYS_IN_YANG},
+    {"ietf-yang-metadata", "2016-08-05", (const char *)ietf_yang_metadata_2016_08_05_yang, 1, LYS_IN_YANG},
+    {"yang", "2020-06-17", (const char *)yang_2020_06_17_yang, 1, LYS_IN_YANG},
+    {"ietf-inet-types", "2013-07-15", (const char *)ietf_inet_types_2013_07_15_yang, 0, LYS_IN_YANG},
+    {"ietf-yang-types", "2013-07-15", (const char *)ietf_yang_types_2013_07_15_yang, 0, LYS_IN_YANG},
     /* ietf-datastores and ietf-yang-library must be right here at the end of the list! */
-    {"ietf-datastores", "2018-02-14", (const char*)ietf_datastores_2018_02_14_yang, 1, LYS_IN_YANG},
-    {"ietf-yang-library", IETF_YANG_LIB_REV, (const char*)ietf_yang_library_2019_01_04_yang, 1, LYS_IN_YANG}
+    {"ietf-datastores", "2018-02-14", (const char *)ietf_datastores_2018_02_14_yang, 1, LYS_IN_YANG},
+    {"ietf-yang-library", IETF_YANG_LIB_REV, (const char *)ietf_yang_library_2019_01_04_yang, 1, LYS_IN_YANG}
 };
 
 #define LY_INTERNAL_MODS_COUNT sizeof(internal_modules) / sizeof(struct internal_modules_s)
@@ -359,7 +359,7 @@
 
     for ( ; *index < ctx->list.count; ++(*index)) {
         mod = ctx->list.objs[*index];
-        value = *(const char**)(((int8_t*)(mod)) + key_offset);
+        value = *(const char **)(((int8_t *)(mod)) + key_offset);
         if ((!key_size && !strcmp(key, value)) || (key_size && !strncmp(key, value, key_size) && value[key_size] == '\0')) {
             /* increment index for the next run */
             ++(*index);
diff --git a/src/json.c b/src/json.c
index fd3c946..2cd60dd 100644
--- a/src/json.c
+++ b/src/json.c
@@ -29,7 +29,7 @@
 #define JSON_POP_STATUS_RET(CTX) \
     assert(CTX->status.count); CTX->status.count--;
 
-const char*
+const char *
 lyjson_token2str(enum LYJSON_PARSER_STATUS status)
 {
     switch (status) {
@@ -92,7 +92,7 @@
     assert(jsonctx);
 
     if (dynamic) {
-        free((char*)jsonctx->value);
+        free((char *)jsonctx->value);
     }
     jsonctx->value = value;
     jsonctx->value_len = value_len;
@@ -667,7 +667,7 @@
         free((char *)jsonctx->value);
     }
     jsonctx->status.count = jsonctx->backup.status_count;
-    jsonctx->status.objs[jsonctx->backup.status_count - 1] = (void*)jsonctx->backup.status;
+    jsonctx->status.objs[jsonctx->backup.status_count - 1] = (void *)jsonctx->backup.status;
     jsonctx->value = jsonctx->backup.value;
     jsonctx->value_len = jsonctx->backup.value_len;
     jsonctx->in->current = jsonctx->backup.input;
@@ -774,7 +774,7 @@
     }
 
     if (jsonctx->dynamic) {
-        free((char*)jsonctx->value);
+        free((char *)jsonctx->value);
     }
     if (jsonctx->backup.dynamic) {
         free((char *)jsonctx->backup.value);
diff --git a/src/json.h b/src/json.h
index 470d9bf..d53f673 100644
--- a/src/json.h
+++ b/src/json.h
@@ -97,7 +97,7 @@
  * @param[in] status Context status (aka JSON token)
  * @return String representation of the @p status.
  */
-const char*lyjson_token2str(enum LYJSON_PARSER_STATUS status);
+const char *lyjson_token2str(enum LYJSON_PARSER_STATUS status);
 
 /**
  * @brief Move to the next JSON artefact and update parser status.
diff --git a/src/log.c b/src/log.c
index 4991622..1b4e229 100644
--- a/src/log.c
+++ b/src/log.c
@@ -413,7 +413,7 @@
         LY_CHECK_ERR_RET(!(*path), LOGMEM(ctx), LY_EMEM);
         break;
     case LY_VLOG_LINE:
-        rc = asprintf(path, "Line number %" PRIu64 ".", *((uint64_t*)elem));
+        rc = asprintf(path, "Line number %" PRIu64 ".", *((uint64_t *)elem));
         LY_CHECK_ERR_RET(rc == -1, LOGMEM(ctx), LY_EMEM);
         break;
     case LY_VLOG_LYSC:
@@ -436,7 +436,7 @@
 ly_vlog(const struct ly_ctx *ctx, enum LY_VLOG_ELEM elem_type, const void *elem, LY_VECODE code, const char *format, ...)
 {
     va_list ap;
-    char* path = NULL;
+    char *path = NULL;
     const struct ly_err_item *first;
 
     if (path_flag && (elem_type != LY_VLOG_NONE)) {
diff --git a/src/parser.c b/src/parser.c
index fb95fe8..ffbe1d9 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -83,7 +83,7 @@
             return -1;
         }
 
-        ly_munmap((char*)in->start, in->length);
+        ly_munmap((char *)in->start, in->length);
 
         in->method.fd = fd;
         in->current = in->start = addr;
@@ -299,9 +299,9 @@
 
     if (destroy) {
         if (in->type == LY_IN_MEMORY) {
-            free((char*)in->start);
+            free((char *)in->start);
         } else {
-            ly_munmap((char*)in->start, in->length);
+            ly_munmap((char *)in->start, in->length);
 
             if (in->type == LY_IN_FILE) {
                 fclose(in->method.f);
@@ -314,7 +314,7 @@
             }
         }
     } else if (in->type != LY_IN_MEMORY) {
-        ly_munmap((char*)in->start, in->length);
+        ly_munmap((char *)in->start, in->length);
 
         if (in->type == LY_IN_FILEPATH) {
             close(in->method.fpath.fd);
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);
diff --git a/src/parser_lyb.c b/src/parser_lyb.c
index 0bcad90..ce04658 100644
--- a/src/parser_lyb.c
+++ b/src/parser_lyb.c
@@ -1047,7 +1047,7 @@
         assert(parent);
 
         if (op_p) {
-            *op_p = (struct lyd_node*)(*parent);
+            *op_p = (struct lyd_node *)(*parent);
         }
         for (iter = *parent; iter->parent; iter = iter->parent) {}
         tree = (struct lyd_node *)iter;
diff --git a/src/parser_stmt.c b/src/parser_stmt.c
index 05a8997..c9b5809 100644
--- a/src/parser_stmt.c
+++ b/src/parser_stmt.c
@@ -801,7 +801,7 @@
 
     switch (kw) {
     case LY_STMT_STATUS: {
-        ret = lysp_stmt_status((struct lys_parser_ctx *)&pctx, stmt, *(uint16_t**)result, exts);
+        ret = lysp_stmt_status((struct lys_parser_ctx *)&pctx, stmt, *(uint16_t **)result, exts);
         break;
     }
     case LY_STMT_TYPE: {
diff --git a/src/parser_xml.c b/src/parser_xml.c
index a28e432..7e2647a 100644
--- a/src/parser_xml.c
+++ b/src/parser_xml.c
@@ -485,7 +485,7 @@
         }
     } else if (snode->nodetype & LYD_NODE_TERM) {
         /* create node */
-        LY_CHECK_GOTO(ret = lyd_parser_create_term((struct lyd_ctx*)lydctx, snode, xmlctx->value, xmlctx->value_len,
+        LY_CHECK_GOTO(ret = lyd_parser_create_term((struct lyd_ctx *)lydctx, snode, xmlctx->value, xmlctx->value_len,
                                         &xmlctx->dynamic, 0, LY_PREF_XML, &xmlctx->ns, &node), error);
 
         if (parent && (node->schema->flags & LYS_KEY)) {
diff --git a/src/parser_yang.c b/src/parser_yang.c
index c09700b..88cd2b1 100644
--- a/src/parser_yang.c
+++ b/src/parser_yang.c
@@ -2610,7 +2610,7 @@
     }
 
     /* initiate structure */
-    inout_p->nodetype = &((struct lysp_action*)parent)->input == inout_p ? LYS_INPUT : LYS_OUTPUT;
+    inout_p->nodetype = &((struct lysp_action *)parent)->input == inout_p ? LYS_INPUT : LYS_OUTPUT;
     inout_p->parent = parent;
 
     /* parse substatements */
@@ -2620,35 +2620,35 @@
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", ly_stmt2str(inout_kw));
         /* fall through */
         case LY_STMT_ANYXML:
-            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)inout_p, &inout_p->data));
+            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node *)inout_p, &inout_p->data));
             break;
         case LY_STMT_CHOICE:
-            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node*)inout_p, &inout_p->data));
+            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node *)inout_p, &inout_p->data));
             break;
         case LY_STMT_CONTAINER:
-            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node*)inout_p, &inout_p->data));
+            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node *)inout_p, &inout_p->data));
             break;
         case LY_STMT_LEAF:
-            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node*)inout_p, &inout_p->data));
+            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node *)inout_p, &inout_p->data));
             break;
         case LY_STMT_LEAF_LIST:
-            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node*)inout_p, &inout_p->data));
+            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node *)inout_p, &inout_p->data));
             break;
         case LY_STMT_LIST:
-            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node*)inout_p, &inout_p->data));
+            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node *)inout_p, &inout_p->data));
             break;
         case LY_STMT_USES:
-            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node*)inout_p, &inout_p->data));
+            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node *)inout_p, &inout_p->data));
             break;
         case LY_STMT_TYPEDEF:
-            LY_CHECK_RET(parse_typedef(ctx, (struct lysp_node*)inout_p, in, &inout_p->typedefs));
+            LY_CHECK_RET(parse_typedef(ctx, (struct lysp_node *)inout_p, in, &inout_p->typedefs));
             break;
         case LY_STMT_MUST:
             PARSER_CHECK_STMTVER2_RET(ctx, "must", ly_stmt2str(inout_kw));
             LY_CHECK_RET(parse_restrs(ctx, in, kw, &inout_p->musts));
             break;
         case LY_STMT_GROUPING:
-            LY_CHECK_RET(parse_grouping(ctx, in, (struct lysp_node*)inout_p, &inout_p->groupings));
+            LY_CHECK_RET(parse_grouping(ctx, in, (struct lysp_node *)inout_p, &inout_p->groupings));
             break;
         case LY_STMT_EXTENSION_INSTANCE:
             LY_CHECK_RET(parse_ext(ctx, in, word, word_len, LYEXT_SUBSTMT_SELF, 0, &inout_p->exts));
@@ -2714,17 +2714,17 @@
             break;
 
         case LY_STMT_INPUT:
-            LY_CHECK_RET(parse_inout(ctx, in, kw, (struct lysp_node*)act, &act->input));
+            LY_CHECK_RET(parse_inout(ctx, in, kw, (struct lysp_node *)act, &act->input));
             break;
         case LY_STMT_OUTPUT:
-            LY_CHECK_RET(parse_inout(ctx, in, kw, (struct lysp_node*)act, &act->output));
+            LY_CHECK_RET(parse_inout(ctx, in, kw, (struct lysp_node *)act, &act->output));
             break;
 
         case LY_STMT_TYPEDEF:
-            LY_CHECK_RET(parse_typedef(ctx, (struct lysp_node*)act, in, &act->typedefs));
+            LY_CHECK_RET(parse_typedef(ctx, (struct lysp_node *)act, in, &act->typedefs));
             break;
         case LY_STMT_GROUPING:
-            LY_CHECK_RET(parse_grouping(ctx, in, (struct lysp_node*)act, &act->groupings));
+            LY_CHECK_RET(parse_grouping(ctx, in, (struct lysp_node *)act, &act->groupings));
             break;
         case LY_STMT_EXTENSION_INSTANCE:
             LY_CHECK_RET(parse_ext(ctx, in, word, word_len, LYEXT_SUBSTMT_SELF, 0, &act->exts));
@@ -2787,25 +2787,25 @@
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "notification");
         /* fall through */
         case LY_STMT_ANYXML:
-            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)notif, &notif->data));
+            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node *)notif, &notif->data));
             break;
         case LY_STMT_CHOICE:
-            LY_CHECK_RET(parse_case(ctx, in, (struct lysp_node*)notif, &notif->data));
+            LY_CHECK_RET(parse_case(ctx, in, (struct lysp_node *)notif, &notif->data));
             break;
         case LY_STMT_CONTAINER:
-            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node*)notif, &notif->data));
+            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node *)notif, &notif->data));
             break;
         case LY_STMT_LEAF:
-            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node*)notif, &notif->data));
+            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node *)notif, &notif->data));
             break;
         case LY_STMT_LEAF_LIST:
-            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node*)notif, &notif->data));
+            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node *)notif, &notif->data));
             break;
         case LY_STMT_LIST:
-            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node*)notif, &notif->data));
+            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node *)notif, &notif->data));
             break;
         case LY_STMT_USES:
-            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node*)notif, &notif->data));
+            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node *)notif, &notif->data));
             break;
 
         case LY_STMT_MUST:
@@ -2813,10 +2813,10 @@
             LY_CHECK_RET(parse_restrs(ctx, in, kw, &notif->musts));
             break;
         case LY_STMT_TYPEDEF:
-            LY_CHECK_RET(parse_typedef(ctx, (struct lysp_node*)notif, in, &notif->typedefs));
+            LY_CHECK_RET(parse_typedef(ctx, (struct lysp_node *)notif, in, &notif->typedefs));
             break;
         case LY_STMT_GROUPING:
-            LY_CHECK_RET(parse_grouping(ctx, in, (struct lysp_node*)notif, &notif->groupings));
+            LY_CHECK_RET(parse_grouping(ctx, in, (struct lysp_node *)notif, &notif->groupings));
             break;
         case LY_STMT_EXTENSION_INSTANCE:
             LY_CHECK_RET(parse_ext(ctx, in, word, word_len, LYEXT_SUBSTMT_SELF, 0, &notif->exts));
@@ -2876,40 +2876,40 @@
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "grouping");
         /* fall through */
         case LY_STMT_ANYXML:
-            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)grp, &grp->data));
+            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node *)grp, &grp->data));
             break;
         case LY_STMT_CHOICE:
-            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node*)grp, &grp->data));
+            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node *)grp, &grp->data));
             break;
         case LY_STMT_CONTAINER:
-            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node*)grp, &grp->data));
+            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node *)grp, &grp->data));
             break;
         case LY_STMT_LEAF:
-            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node*)grp, &grp->data));
+            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node *)grp, &grp->data));
             break;
         case LY_STMT_LEAF_LIST:
-            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node*)grp, &grp->data));
+            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node *)grp, &grp->data));
             break;
         case LY_STMT_LIST:
-            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node*)grp, &grp->data));
+            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node *)grp, &grp->data));
             break;
         case LY_STMT_USES:
-            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node*)grp, &grp->data));
+            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node *)grp, &grp->data));
             break;
 
         case LY_STMT_TYPEDEF:
-            LY_CHECK_RET(parse_typedef(ctx, (struct lysp_node*)grp, in, &grp->typedefs));
+            LY_CHECK_RET(parse_typedef(ctx, (struct lysp_node *)grp, in, &grp->typedefs));
             break;
         case LY_STMT_ACTION:
             PARSER_CHECK_STMTVER2_RET(ctx, "action", "grouping");
-            LY_CHECK_RET(parse_action(ctx, in, (struct lysp_node*)grp, &grp->actions));
+            LY_CHECK_RET(parse_action(ctx, in, (struct lysp_node *)grp, &grp->actions));
             break;
         case LY_STMT_GROUPING:
-            LY_CHECK_RET(parse_grouping(ctx, in, (struct lysp_node*)grp, &grp->groupings));
+            LY_CHECK_RET(parse_grouping(ctx, in, (struct lysp_node *)grp, &grp->groupings));
             break;
         case LY_STMT_NOTIFICATION:
             PARSER_CHECK_STMTVER2_RET(ctx, "notification", "grouping");
-            LY_CHECK_RET(parse_notif(ctx, in, (struct lysp_node*)grp, &grp->notifs));
+            LY_CHECK_RET(parse_notif(ctx, in, (struct lysp_node *)grp, &grp->notifs));
             break;
         case LY_STMT_EXTENSION_INSTANCE:
             LY_CHECK_RET(parse_ext(ctx, in, word, word_len, LYEXT_SUBSTMT_SELF, 0, &grp->exts));
@@ -2976,37 +2976,37 @@
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "augment");
         /* fall through */
         case LY_STMT_ANYXML:
-            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)aug, &aug->child));
+            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node *)aug, &aug->child));
             break;
         case LY_STMT_CASE:
-            LY_CHECK_RET(parse_case(ctx, in, (struct lysp_node*)aug, &aug->child));
+            LY_CHECK_RET(parse_case(ctx, in, (struct lysp_node *)aug, &aug->child));
             break;
         case LY_STMT_CHOICE:
-            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node*)aug, &aug->child));
+            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node *)aug, &aug->child));
             break;
         case LY_STMT_CONTAINER:
-            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node*)aug, &aug->child));
+            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node *)aug, &aug->child));
             break;
         case LY_STMT_LEAF:
-            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node*)aug, &aug->child));
+            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node *)aug, &aug->child));
             break;
         case LY_STMT_LEAF_LIST:
-            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node*)aug, &aug->child));
+            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node *)aug, &aug->child));
             break;
         case LY_STMT_LIST:
-            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node*)aug, &aug->child));
+            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node *)aug, &aug->child));
             break;
         case LY_STMT_USES:
-            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node*)aug, &aug->child));
+            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node *)aug, &aug->child));
             break;
 
         case LY_STMT_ACTION:
             PARSER_CHECK_STMTVER2_RET(ctx, "action", "augment");
-            LY_CHECK_RET(parse_action(ctx, in, (struct lysp_node*)aug, &aug->actions));
+            LY_CHECK_RET(parse_action(ctx, in, (struct lysp_node *)aug, &aug->actions));
             break;
         case LY_STMT_NOTIFICATION:
             PARSER_CHECK_STMTVER2_RET(ctx, "notification", "augment");
-            LY_CHECK_RET(parse_notif(ctx, in, (struct lysp_node*)aug, &aug->notifs));
+            LY_CHECK_RET(parse_notif(ctx, in, (struct lysp_node *)aug, &aug->notifs));
             break;
         case LY_STMT_EXTENSION_INSTANCE:
             LY_CHECK_RET(parse_ext(ctx, in, word, word_len, LYEXT_SUBSTMT_SELF, 0, &aug->exts));
@@ -3074,7 +3074,7 @@
             LY_CHECK_RET(parse_refine(ctx, in, &uses->refines));
             break;
         case LY_STMT_AUGMENT:
-            LY_CHECK_RET(parse_augment(ctx, in, (struct lysp_node*)uses, &uses->augments));
+            LY_CHECK_RET(parse_augment(ctx, in, (struct lysp_node *)uses, &uses->augments));
             break;
         case LY_STMT_EXTENSION_INSTANCE:
             LY_CHECK_RET(parse_ext(ctx, in, word, word_len, LYEXT_SUBSTMT_SELF, 0, &uses->exts));
@@ -3141,25 +3141,25 @@
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "case");
         /* fall through */
         case LY_STMT_ANYXML:
-            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)cas, &cas->child));
+            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node *)cas, &cas->child));
             break;
         case LY_STMT_CHOICE:
-            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node*)cas, &cas->child));
+            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node *)cas, &cas->child));
             break;
         case LY_STMT_CONTAINER:
-            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node*)cas, &cas->child));
+            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node *)cas, &cas->child));
             break;
         case LY_STMT_LEAF:
-            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node*)cas, &cas->child));
+            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node *)cas, &cas->child));
             break;
         case LY_STMT_LEAF_LIST:
-            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node*)cas, &cas->child));
+            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node *)cas, &cas->child));
             break;
         case LY_STMT_LIST:
-            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node*)cas, &cas->child));
+            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node *)cas, &cas->child));
             break;
         case LY_STMT_USES:
-            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node*)cas, &cas->child));
+            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node *)cas, &cas->child));
             break;
         case LY_STMT_EXTENSION_INSTANCE:
             LY_CHECK_RET(parse_ext(ctx, in, word, word_len, LYEXT_SUBSTMT_SELF, 0, &cas->exts));
@@ -3231,26 +3231,26 @@
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "choice");
         /* fall through */
         case LY_STMT_ANYXML:
-            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)choice, &choice->child));
+            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node *)choice, &choice->child));
             break;
         case LY_STMT_CASE:
-            LY_CHECK_RET(parse_case(ctx, in, (struct lysp_node*)choice, &choice->child));
+            LY_CHECK_RET(parse_case(ctx, in, (struct lysp_node *)choice, &choice->child));
             break;
         case LY_STMT_CHOICE:
             PARSER_CHECK_STMTVER2_RET(ctx, "choice", "choice");
-            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node*)choice, &choice->child));
+            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node *)choice, &choice->child));
             break;
         case LY_STMT_CONTAINER:
-            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node*)choice, &choice->child));
+            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node *)choice, &choice->child));
             break;
         case LY_STMT_LEAF:
-            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node*)choice, &choice->child));
+            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node *)choice, &choice->child));
             break;
         case LY_STMT_LEAF_LIST:
-            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node*)choice, &choice->child));
+            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node *)choice, &choice->child));
             break;
         case LY_STMT_LIST:
-            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node*)choice, &choice->child));
+            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node *)choice, &choice->child));
             break;
         case LY_STMT_EXTENSION_INSTANCE:
             LY_CHECK_RET(parse_ext(ctx, in, word, word_len, LYEXT_SUBSTMT_SELF, 0, &choice->exts));
@@ -3325,43 +3325,43 @@
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "container");
         /* fall through */
         case LY_STMT_ANYXML:
-            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)cont, &cont->child));
+            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node *)cont, &cont->child));
             break;
         case LY_STMT_CHOICE:
-            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node*)cont, &cont->child));
+            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node *)cont, &cont->child));
             break;
         case LY_STMT_CONTAINER:
-            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node*)cont, &cont->child));
+            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node *)cont, &cont->child));
             break;
         case LY_STMT_LEAF:
-            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node*)cont, &cont->child));
+            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node *)cont, &cont->child));
             break;
         case LY_STMT_LEAF_LIST:
-            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node*)cont, &cont->child));
+            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node *)cont, &cont->child));
             break;
         case LY_STMT_LIST:
-            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node*)cont, &cont->child));
+            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node *)cont, &cont->child));
             break;
         case LY_STMT_USES:
-            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node*)cont, &cont->child));
+            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node *)cont, &cont->child));
             break;
 
         case LY_STMT_TYPEDEF:
-            LY_CHECK_RET(parse_typedef(ctx, (struct lysp_node*)cont, in, &cont->typedefs));
+            LY_CHECK_RET(parse_typedef(ctx, (struct lysp_node *)cont, in, &cont->typedefs));
             break;
         case LY_STMT_MUST:
             LY_CHECK_RET(parse_restrs(ctx, in, kw, &cont->musts));
             break;
         case LY_STMT_ACTION:
             PARSER_CHECK_STMTVER2_RET(ctx, "action", "container");
-            LY_CHECK_RET(parse_action(ctx, in, (struct lysp_node*)cont, &cont->actions));
+            LY_CHECK_RET(parse_action(ctx, in, (struct lysp_node *)cont, &cont->actions));
             break;
         case LY_STMT_GROUPING:
-            LY_CHECK_RET(parse_grouping(ctx, in, (struct lysp_node*)cont, &cont->groupings));
+            LY_CHECK_RET(parse_grouping(ctx, in, (struct lysp_node *)cont, &cont->groupings));
             break;
         case LY_STMT_NOTIFICATION:
             PARSER_CHECK_STMTVER2_RET(ctx, "notification", "container");
-            LY_CHECK_RET(parse_notif(ctx, in, (struct lysp_node*)cont, &cont->notifs));
+            LY_CHECK_RET(parse_notif(ctx, in, (struct lysp_node *)cont, &cont->notifs));
             break;
         case LY_STMT_EXTENSION_INSTANCE:
             LY_CHECK_RET(parse_ext(ctx, in, word, word_len, LYEXT_SUBSTMT_SELF, 0, &cont->exts));
@@ -3445,43 +3445,43 @@
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "list");
         /* fall through */
         case LY_STMT_ANYXML:
-            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)list, &list->child));
+            LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node *)list, &list->child));
             break;
         case LY_STMT_CHOICE:
-            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node*)list, &list->child));
+            LY_CHECK_RET(parse_choice(ctx, in, (struct lysp_node *)list, &list->child));
             break;
         case LY_STMT_CONTAINER:
-            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node*)list, &list->child));
+            LY_CHECK_RET(parse_container(ctx, in, (struct lysp_node *)list, &list->child));
             break;
         case LY_STMT_LEAF:
-            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node*)list, &list->child));
+            LY_CHECK_RET(parse_leaf(ctx, in, (struct lysp_node *)list, &list->child));
             break;
         case LY_STMT_LEAF_LIST:
-            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node*)list, &list->child));
+            LY_CHECK_RET(parse_leaflist(ctx, in, (struct lysp_node *)list, &list->child));
             break;
         case LY_STMT_LIST:
-            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node*)list, &list->child));
+            LY_CHECK_RET(parse_list(ctx, in, (struct lysp_node *)list, &list->child));
             break;
         case LY_STMT_USES:
-            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node*)list, &list->child));
+            LY_CHECK_RET(parse_uses(ctx, in, (struct lysp_node *)list, &list->child));
             break;
 
         case LY_STMT_TYPEDEF:
-            LY_CHECK_RET(parse_typedef(ctx, (struct lysp_node*)list, in, &list->typedefs));
+            LY_CHECK_RET(parse_typedef(ctx, (struct lysp_node *)list, in, &list->typedefs));
             break;
         case LY_STMT_MUST:
             LY_CHECK_RET(parse_restrs(ctx, in, kw, &list->musts));
             break;
         case LY_STMT_ACTION:
             PARSER_CHECK_STMTVER2_RET(ctx, "action", "list");
-            LY_CHECK_RET(parse_action(ctx, in, (struct lysp_node*)list, &list->actions));
+            LY_CHECK_RET(parse_action(ctx, in, (struct lysp_node *)list, &list->actions));
             break;
         case LY_STMT_GROUPING:
-            LY_CHECK_RET(parse_grouping(ctx, in, (struct lysp_node*)list, &list->groupings));
+            LY_CHECK_RET(parse_grouping(ctx, in, (struct lysp_node *)list, &list->groupings));
             break;
         case LY_STMT_NOTIFICATION:
             PARSER_CHECK_STMTVER2_RET(ctx, "notification", "list");
-            LY_CHECK_RET(parse_notif(ctx, in, (struct lysp_node*)list, &list->notifs));
+            LY_CHECK_RET(parse_notif(ctx, in, (struct lysp_node *)list, &list->notifs));
             break;
         case LY_STMT_EXTENSION_INSTANCE:
             LY_CHECK_RET(parse_ext(ctx, in, word, word_len, LYEXT_SUBSTMT_SELF, 0, &list->exts));
diff --git a/src/parser_yin.c b/src/parser_yin.c
index 33a3e3c..c907f97 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -43,7 +43,7 @@
  */
 #define IS_YIN_NS(ns) (strcmp(ns, YIN_NS_URI) == 0)
 
-const char *const yin_attr_list[] = {
+const char * const yin_attr_list[] = {
     [YIN_ARG_NAME] = "name",
     [YIN_ARG_TARGET_NODE] = "target-node",
     [YIN_ARG_MODULE] = "module",
@@ -2853,7 +2853,7 @@
             /* call responsible function */
             case LY_STMT_EXTENSION_INSTANCE:
                 ret = yin_parse_extension_instance(ctx, kw2lyext_substmt(current_element),
-                                (subelem->dest) ? *((LY_ARRAY_COUNT_TYPE*)subelem->dest) : 0, exts);
+                                (subelem->dest) ? *((LY_ARRAY_COUNT_TYPE *)subelem->dest) : 0, exts);
                 break;
             case LY_STMT_ACTION:
             case LY_STMT_RPC:
diff --git a/src/parser_yin.h b/src/parser_yin.h
index 47d3246..a7896f0 100644
--- a/src/parser_yin.h
+++ b/src/parser_yin.h
@@ -24,7 +24,7 @@
 #include "tree_schema_internal.h"
 
 /* list of yin attribute strings */
-extern const char *const yin_attr_list[];
+extern const char * const yin_attr_list[];
 #define yin_attr2str(STMT) yin_attr_list[STMT]
 
 #define VALID_VALS1 " Only valid value is \"%s\"."
diff --git a/src/plugins_exts_metadata.c b/src/plugins_exts_metadata.c
index 3a85eed..359ffb5 100644
--- a/src/plugins_exts_metadata.c
+++ b/src/plugins_exts_metadata.c
@@ -97,7 +97,7 @@
         return;
     }
 
-    struct lyext_metadata *annotation = (struct lyext_metadata*)ext->data;
+    struct lyext_metadata *annotation = (struct lyext_metadata *)ext->data;
     annotation_substmt[0].storage = &annotation->iffeatures;
     annotation_substmt[1].storage = &annotation->units;
     annotation_substmt[2].storage = &annotation->flags;
diff --git a/src/plugins_exts_nacm.c b/src/plugins_exts_nacm.c
index 9565e86..7e353ff 100644
--- a/src/plugins_exts_nacm.c
+++ b/src/plugins_exts_nacm.c
@@ -41,9 +41,9 @@
 
     /* store the NACM flag */
     if (!strcmp(c_ext->def->name, "default-deny-write")) {
-        c_ext->data = (void*)&nacm_deny_write;
+        c_ext->data = (void *)&nacm_deny_write;
     } else if (!strcmp(c_ext->def->name, "default-deny-all")) {
-        c_ext->data = (void*)&nacm_deny_all;
+        c_ext->data = (void *)&nacm_deny_all;
     } else {
         return LY_EINT;
     }
@@ -54,7 +54,7 @@
                   p_ext->name, lyext_parent2str(c_ext->parent_type));
         return LY_EVALID;
     } else {
-        parent = (struct lysc_node*)c_ext->parent;
+        parent = (struct lysc_node *)c_ext->parent;
         if (!(parent->nodetype & (LYS_CONTAINER | LYS_LEAF | LYS_LEAFLIST | LYS_LIST | LYS_CHOICE | LYS_ANYDATA
                 | LYS_CASE | LYS_RPC | LYS_ACTION | LYS_NOTIF))) {
             /* note LYS_AUGMENT and LYS_USES is not in the list since they are not present in the compiled tree. Instead, libyang
@@ -64,7 +64,7 @@
                       "Extension %s is not allowed in %s statement.", p_ext->name, lys_nodetype2str(parent->nodetype));
             return LY_EVALID;
         }
-        if (c_ext->data == (void*)&nacm_deny_write && (parent->nodetype & (LYS_RPC | LYS_ACTION | LYS_NOTIF))) {
+        if (c_ext->data == (void *)&nacm_deny_write && (parent->nodetype & (LYS_RPC | LYS_ACTION | LYS_NOTIF))) {
             goto invalid_parent;
         }
     }
diff --git a/src/plugins_types.c b/src/plugins_types.c
index dd8cf5a..9be990b 100644
--- a/src/plugins_types.c
+++ b/src/plugins_types.c
@@ -426,7 +426,7 @@
             /* error */
             PCRE2_UCHAR pcre2_errmsg[256] = {0};
             pcre2_get_error_message(rc, pcre2_errmsg, 256);
-            *err = ly_err_new(LY_LLERR, LY_ESYS, 0, strdup((const char*)pcre2_errmsg), NULL, NULL);
+            *err = ly_err_new(LY_LLERR, LY_ESYS, 0, strdup((const char *)pcre2_errmsg), NULL, NULL);
             ret = LY_ESYS;
             goto cleanup;
         }
@@ -579,7 +579,7 @@
 {
     LY_ERR ret;
     uint64_t num;
-    struct lysc_type_num* type_num = (struct lysc_type_num*)type;
+    struct lysc_type_num *type_num = (struct lysc_type_num *)type;
     char *str;
 
     if (options & LY_TYPE_OPTS_SECOND_CALL) {
@@ -632,7 +632,7 @@
         const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
 {
     int64_t d;
-    struct lysc_type_dec* type_dec = (struct lysc_type_dec*)type;
+    struct lysc_type_dec *type_dec = (struct lysc_type_dec *)type;
     char buf[22];
 
     if (options & LY_TYPE_OPTS_SECOND_CALL) {
@@ -849,7 +849,7 @@
     size_t index;
     LY_ARRAY_COUNT_TYPE u, v;
     char *errmsg = NULL;
-    struct lysc_type_bits *type_bits = (struct lysc_type_bits*)type;
+    struct lysc_type_bits *type_bits = (struct lysc_type_bits *)type;
     int iscanonical = 1;
     size_t ws_count;
     size_t lws_count; /* leading whitespace count */
@@ -892,7 +892,7 @@
                     }
                 }
 
-                if (iscanonical && items->count && type_bits->bits[u].position < ((struct lysc_type_bitenum_item*)items->objs[items->count - 1])->position) {
+                if (iscanonical && items->count && type_bits->bits[u].position < ((struct lysc_type_bitenum_item *)items->objs[items->count - 1])->position) {
                     iscanonical = 0;
                 }
                 inserted = ly_set_add(items, &type_bits->bits[u], 0);
@@ -1031,7 +1031,7 @@
 {
     LY_ARRAY_COUNT_TYPE u, v;
     char *errmsg = NULL;
-    struct lysc_type_enum *type_enum = (struct lysc_type_enum*)type;
+    struct lysc_type_enum *type_enum = (struct lysc_type_enum *)type;
     int erc = 0;
 
     if (options & LY_TYPE_OPTS_SECOND_CALL) {
@@ -1114,7 +1114,7 @@
     }
 
     if (options & LY_TYPE_OPTS_DYNAMIC) {
-        storage->canonical = lydict_insert_zc(ctx, (char*)value);
+        storage->canonical = lydict_insert_zc(ctx, (char *)value);
     } else {
         storage->canonical = lydict_insert(ctx, value, value_len);
     }
@@ -1497,7 +1497,7 @@
                     break;
                 case LY_PATH_PREDTYPE_LIST:
                     /* key-predicate */
-                    if (pred1->key != pred2->key || ((struct lysc_node_leaf*)pred1->key)->type->plugin->compare(&pred1->value, &pred2->value)) {
+                    if (pred1->key != pred2->key || ((struct lysc_node_leaf *)pred1->key)->type->plugin->compare(&pred1->value, &pred2->value)) {
                         return LY_ENOT;
                     }
                     break;
@@ -1556,7 +1556,7 @@
                     ly_strcat(&result, "[%s:%s=%c%s%c]", ly_get_prefix(pred->key->module, format, prefix_data),
                               pred->key->name, quot, value, quot);
                     if (d) {
-                        free((char*)value);
+                        free((char *)value);
                     }
                     break;
                 }
@@ -1571,7 +1571,7 @@
                     }
                     ly_strcat(&result, "[.=%c%s%c]", quot, value, quot);
                     if (d) {
-                        free((char*)value);
+                        free((char *)value);
                     }
                     break;
                 }
@@ -1608,7 +1608,7 @@
                     }
                     ly_strcat(&result, "[%s=%c%s%c]", pred->key->name, quot, value, quot);
                     if (d) {
-                        free((char*)value);
+                        free((char *)value);
                     }
                     break;
                 }
@@ -1623,7 +1623,7 @@
                     }
                     ly_strcat(&result, "[.=%c%s%c]", quot, value, quot);
                     if (d) {
-                        free((char*)value);
+                        free((char *)value);
                     }
                     break;
                 }
diff --git a/src/printer_json.c b/src/printer_json.c
index ad9fc3a..e411ab6 100644
--- a/src/printer_json.c
+++ b/src/printer_json.c
@@ -75,8 +75,8 @@
     }
     if (!node1->schema) {
         /* compare node names */
-        struct lyd_node_opaq *onode1 = (struct lyd_node_opaq*)node1;
-        struct lyd_node_opaq *onode2 = (struct lyd_node_opaq*)node2;
+        struct lyd_node_opaq *onode1 = (struct lyd_node_opaq *)node1;
+        struct lyd_node_opaq *onode2 = (struct lyd_node_opaq *)node2;
         if (onode1->name != onode2->name || onode1->prefix.id != onode2->prefix.id) {
             return 0;
         }
@@ -96,7 +96,7 @@
 {
     /* leaf-list's content is always printed on a single line */
     ly_print_(ctx->out, "[%s", (!node->schema || node->schema->nodetype != LYS_LEAFLIST) && DO_FORMAT ? "\n" : "");
-    ly_set_add(&ctx->open, (void*)node, 0);
+    ly_set_add(&ctx->open, (void *)node, 0);
     LEVEL_INC;
 }
 
@@ -111,7 +111,7 @@
 static int
 is_open_array(struct jsonpr_ctx *ctx, const struct lyd_node *node)
 {
-    if (ctx->open.count && matching_node(node, (const struct lyd_node*)ctx->open.objs[ctx->open.count - 1])) {
+    if (ctx->open.count && matching_node(node, (const struct lyd_node *)ctx->open.objs[ctx->open.count - 1])) {
         return 1;
     } else {
         return 0;
@@ -126,7 +126,7 @@
 static void
 json_print_array_close(struct jsonpr_ctx *ctx)
 {
-    const struct lysc_node *schema = ((const struct lyd_node*)ctx->open.objs[ctx->open.count - 1])->schema;
+    const struct lysc_node *schema = ((const struct lyd_node *)ctx->open.objs[ctx->open.count - 1])->schema;
 
     LEVEL_DEC;
     ly_set_rm_index(&ctx->open, ctx->open.count - 1, NULL);
@@ -150,7 +150,7 @@
     if (node->schema) {
         return node->schema->module->name;
     } else {
-        struct lyd_node_opaq *onode = (struct lyd_node_opaq*)node;
+        struct lyd_node_opaq *onode = (struct lyd_node_opaq *)node;
         const struct lys_module *mod;
 
         switch (onode->format) {
@@ -261,7 +261,7 @@
 json_print_member(struct jsonpr_ctx *ctx, const struct lyd_node *node, int is_attr)
 {
     PRINT_COMMA;
-    if (LEVEL == 1 || json_nscmp(node, (const struct lyd_node*)node->parent)) {
+    if (LEVEL == 1 || json_nscmp(node, (const struct lyd_node *)node->parent)) {
         /* print "namespace" */
         ly_print_(ctx->out, "%*s\"%s%s:%s\":%s", INDENT, is_attr ? "@" : "",
                  node_prefix(node), node->schema->name, DO_FORMAT ? " " : "");
@@ -369,7 +369,7 @@
     }
 
     if (dynamic) {
-        free((char*)value);
+        free((char *)value);
     }
 
     return LY_SUCCESS;
@@ -395,7 +395,7 @@
 
     for (attr = node->attr; attr; attr = attr->next) {
         PRINT_COMMA;
-        json_print_member2(ctx, (struct lyd_node*)node, attr->format, &attr->prefix, attr->name, 0);
+        json_print_member2(ctx, (struct lyd_node *)node, attr->format, &attr->prefix, attr->name, 0);
 
         if (attr->hint & (LYD_NODE_OPAQ_ISBOOLEAN | LYD_NODE_OPAQ_ISNUMBER)) {
             ly_print_(ctx->out, "%s", attr->value[0] ? attr->value : "null");
@@ -469,16 +469,16 @@
         LEVEL_DEC;
         ly_print_(ctx->out, "%s%*s}", DO_FORMAT ? "\n" : "", INDENT);
         LEVEL_PRINTED;
-    } else if (!node->schema && ((struct lyd_node_opaq*)node)->attr) {
+    } else if (!node->schema && ((struct lyd_node_opaq *)node)->attr) {
         if (inner) {
             LY_CHECK_RET(json_print_member2(ctx, NULL, LYD_JSON, NULL, "", 1));
         } else {
-            LY_CHECK_RET(json_print_member2(ctx, node, ((struct lyd_node_opaq*)node)->format,
-                                            &((struct lyd_node_opaq*)node)->prefix, ((struct lyd_node_opaq*)node)->name, 1));
+            LY_CHECK_RET(json_print_member2(ctx, node, ((struct lyd_node_opaq *)node)->format,
+                                            &((struct lyd_node_opaq *)node)->prefix, ((struct lyd_node_opaq *)node)->name, 1));
         }
         ly_print_(ctx->out, "{%s", (DO_FORMAT ? "\n" : ""));
         LEVEL_INC;
-        LY_CHECK_RET(json_print_attribute(ctx, (struct lyd_node_opaq*)node, wdmod));
+        LY_CHECK_RET(json_print_attribute(ctx, (struct lyd_node_opaq *)node, wdmod));
         LEVEL_DEC;
         ly_print_(ctx->out, "%s%*s}", DO_FORMAT ? "\n" : "", INDENT);
         LEVEL_PRINTED;
@@ -498,7 +498,7 @@
 json_print_leaf(struct jsonpr_ctx *ctx, const struct lyd_node *node)
 {
     LY_CHECK_RET(json_print_member(ctx, node, 0));
-    LY_CHECK_RET(json_print_value(ctx, &((const struct lyd_node_term*)node)->value));
+    LY_CHECK_RET(json_print_value(ctx, &((const struct lyd_node_term *)node)->value));
     LEVEL_PRINTED;
 
     /* print attributes as sibling */
@@ -592,7 +592,7 @@
 
     if (node->meta || children) {
         has_content = 1;
-    } else if (node->schema && (node->schema->nodetype & LYD_NODE_ANY) && ((struct lyd_node_any*)node)->value.tree) {
+    } else if (node->schema && (node->schema->nodetype & LYD_NODE_ANY) && ((struct lyd_node_any *)node)->value.tree) {
         has_content = 1;
     }
 
@@ -676,7 +676,7 @@
         }
     } else {
         assert(node->schema->nodetype == LYS_LEAFLIST);
-        LY_CHECK_RET(json_print_value(ctx, &((const struct lyd_node_term*)node)->value));
+        LY_CHECK_RET(json_print_value(ctx, &((const struct lyd_node_term *)node)->value));
 
         if (node->meta && !ctx->print_sibling_metadata) {
             ctx->print_sibling_metadata = node;
@@ -751,12 +751,12 @@
     int first = 1, last = 1;
 
     if (node->hint & LYD_NODE_OPAQ_ISLIST) {
-        const struct lyd_node_opaq *prev = (const struct lyd_node_opaq*)node->prev;
-        const struct lyd_node_opaq *next = (const struct lyd_node_opaq*)node->next;
-        if (prev->next && matching_node((const struct lyd_node*)prev, (const struct lyd_node*)node)) {
+        const struct lyd_node_opaq *prev = (const struct lyd_node_opaq *)node->prev;
+        const struct lyd_node_opaq *next = (const struct lyd_node_opaq *)node->next;
+        if (prev->next && matching_node((const struct lyd_node *)prev, (const struct lyd_node *)node)) {
             first = 0;
         }
-        if (next && matching_node((const struct lyd_node*)node, (const struct lyd_node*)next)) {
+        if (next && matching_node((const struct lyd_node *)node, (const struct lyd_node *)next)) {
             last = 0;
         }
     }
@@ -765,12 +765,12 @@
         LY_CHECK_RET(json_print_member2(ctx, node->parent, node->format, &node->prefix, node->name, 0));
 
         if (node->hint & LYD_NODE_OPAQ_ISLIST) {
-            json_print_array_open(ctx, (struct lyd_node*)node);
+            json_print_array_open(ctx, (struct lyd_node *)node);
             LEVEL_INC;
         }
     }
     if (node->child || (node->hint & LYD_NODE_OPAQ_ISLIST)) {
-        LY_CHECK_RET(json_print_inner(ctx, (struct lyd_node*)node));
+        LY_CHECK_RET(json_print_inner(ctx, (struct lyd_node *)node));
         LEVEL_PRINTED;
     } else {
         if (node->hint & LYD_VALUE_PARSE_ISEMPTY) {
@@ -784,7 +784,7 @@
         LEVEL_PRINTED;
 
         /* attributes */
-        json_print_attributes(ctx, (const struct lyd_node*)node, 0);
+        json_print_attributes(ctx, (const struct lyd_node *)node, 0);
 
     }
     if (last && (node->hint & LYD_NODE_OPAQ_ISLIST)) {
diff --git a/src/printer_xml.c b/src/printer_xml.c
index c588963..ad878e7 100644
--- a/src/printer_xml.c
+++ b/src/printer_xml.c
@@ -103,7 +103,7 @@
     return ctx->prefix.objs[i];
 }
 
-static const char*
+static const char *
 xml_print_ns_opaq(struct xmlpr_ctx *ctx, LYD_FORMAT format, const struct ly_prefix *prefix, int prefix_opts)
 {
 
diff --git a/src/printer_yang.c b/src/printer_yang.c
index a50bd92..77deb2b 100644
--- a/src/printer_yang.c
+++ b/src/printer_yang.c
@@ -326,13 +326,13 @@
 
     LEVEL++;
     LY_ARRAY_FOR(ext, u) {
-        if (((struct lysp_ext_instance*)ext)[u].insubstmt != substmt || ((struct lysp_ext_instance*)ext)[u].insubstmt_index != substmt_index) {
+        if (((struct lysp_ext_instance *)ext)[u].insubstmt != substmt || ((struct lysp_ext_instance *)ext)[u].insubstmt_index != substmt_index) {
             continue;
         }
         if (ctx->schema == YPR_PARSED) {
-            yprp_extension_instances(ctx, substmt, substmt_index, &((struct lysp_ext_instance*)ext)[u], &extflag, 1);
+            yprp_extension_instances(ctx, substmt, substmt_index, &((struct lysp_ext_instance *)ext)[u], &extflag, 1);
         } else {
-            yprc_extension_instances(ctx, substmt, substmt_index, &((struct lysc_ext_instance*)ext)[u], &extflag, 1);
+            yprc_extension_instances(ctx, substmt, substmt_index, &((struct lysc_ext_instance *)ext)[u], &extflag, 1);
         }
     }
     LEVEL--;
@@ -935,7 +935,7 @@
     str = value->realtype->plugin->print(value, LY_PREF_JSON, NULL, &dynamic);
     ypr_substmt(ctx, LYEXT_SUBSTMT_DEFAULT, 0, str, exts);
     if (dynamic) {
-        free((void*)str);
+        free((void *)str);
     }
 }
 
@@ -952,7 +952,7 @@
 
     switch (type->basetype) {
     case LY_TYPE_BINARY: {
-        struct lysc_type_bin *bin = (struct lysc_type_bin*)type;
+        struct lysc_type_bin *bin = (struct lysc_type_bin *)type;
         yprc_range(ctx, bin->length, type->basetype, &flag);
         break;
     }
@@ -964,12 +964,12 @@
     case LY_TYPE_INT16:
     case LY_TYPE_INT32:
     case LY_TYPE_INT64: {
-        struct lysc_type_num *num = (struct lysc_type_num*)type;
+        struct lysc_type_num *num = (struct lysc_type_num *)type;
         yprc_range(ctx, num->range, type->basetype, &flag);
         break;
     }
     case LY_TYPE_STRING: {
-        struct lysc_type_str *str = (struct lysc_type_str*)type;
+        struct lysc_type_str *str = (struct lysc_type_str *)type;
         yprc_range(ctx, str->length, type->basetype, &flag);
         LY_ARRAY_FOR(str->patterns, u) {
             yprc_pattern(ctx, str->patterns[u], &flag);
@@ -979,7 +979,7 @@
     case LY_TYPE_BITS:
     case LY_TYPE_ENUM: {
         /* bits and enums structures are compatible */
-        struct lysc_type_bits *bits = (struct lysc_type_bits*)type;
+        struct lysc_type_bits *bits = (struct lysc_type_bits *)type;
         LY_ARRAY_FOR(bits->bits, u) {
             struct lysc_type_bitenum_item *item = &bits->bits[u];
             int inner_flag = 0;
@@ -1009,14 +1009,14 @@
         /* nothing to do */
         break;
     case LY_TYPE_DEC64: {
-        struct lysc_type_dec *dec = (struct lysc_type_dec*)type;
+        struct lysc_type_dec *dec = (struct lysc_type_dec *)type;
         ypr_open(ctx->out, &flag);
         ypr_unsigned(ctx, LYEXT_SUBSTMT_FRACDIGITS, 0, type->exts, dec->fraction_digits, &flag);
         yprc_range(ctx, dec->range, dec->basetype, &flag);
         break;
     }
     case LY_TYPE_IDENT: {
-        struct lysc_type_identityref *ident = (struct lysc_type_identityref*)type;
+        struct lysc_type_identityref *ident = (struct lysc_type_identityref *)type;
         LY_ARRAY_FOR(ident->bases, u) {
             ypr_open(ctx->out, &flag);
             ypr_substmt(ctx, LYEXT_SUBSTMT_BASE, u, ident->bases[u]->name, type->exts);
@@ -1024,13 +1024,13 @@
         break;
     }
     case LY_TYPE_INST: {
-        struct lysc_type_instanceid *inst = (struct lysc_type_instanceid*)type;
+        struct lysc_type_instanceid *inst = (struct lysc_type_instanceid *)type;
         ypr_open(ctx->out, &flag);
         ypr_substmt(ctx, LYEXT_SUBSTMT_REQINSTANCE, 0, inst->require_instance ? "true" : "false", inst->exts);
         break;
     }
     case LY_TYPE_LEAFREF: {
-        struct lysc_type_leafref *lr = (struct lysc_type_leafref*)type;
+        struct lysc_type_leafref *lr = (struct lysc_type_leafref *)type;
         ypr_open(ctx->out, &flag);
         ypr_substmt(ctx, LYEXT_SUBSTMT_PATH, 0, lr->path->expr, lr->exts);
         ypr_substmt(ctx, LYEXT_SUBSTMT_REQINSTANCE, 0, lr->require_instance ? "true" : "false", lr->exts);
@@ -1038,7 +1038,7 @@
         break;
     }
     case LY_TYPE_UNION: {
-        struct lysc_type_union *un = (struct lysc_type_union*)type;
+        struct lysc_type_union *un = (struct lysc_type_union *)type;
         LY_ARRAY_FOR(un->types, u) {
             ypr_open(ctx->out, &flag);
             yprc_type(ctx, un->types[u]);
@@ -1472,11 +1472,11 @@
     int flag = 0;
     struct lysc_node *child;
 
-    yprc_node_common1(ctx, (struct lysc_node*)cs, &flag);
-    yprc_node_common2(ctx, (struct lysc_node*)cs, &flag);
+    yprc_node_common1(ctx, (struct lysc_node *)cs, &flag);
+    yprc_node_common2(ctx, (struct lysc_node *)cs, &flag);
 
     if (!(ctx->options & LYS_OUTPUT_NO_SUBSTMT)) {
-        for (child = cs->child; child && child->parent == (struct lysc_node*)cs; child = child->next) {
+        for (child = cs->child; child && child->parent == (struct lysc_node *)cs; child = child->next) {
             ypr_open(ctx->out, &flag);
             yprc_node(ctx, child);
         }
@@ -1527,7 +1527,7 @@
 
     yprc_node_common2(ctx, node, &flag);
 
-    for (cs = choice->cases; cs; cs = (struct lysc_node_case*)cs->next) {
+    for (cs = choice->cases; cs; cs = (struct lysc_node_case *)cs->next) {
         ypr_open(ctx->out, &flag);
         yprc_case(ctx, cs);
     }
@@ -2034,7 +2034,7 @@
                 continue;
             }
         } else if (elem->mod == LYS_DEV_ADD) {
-            add = (struct lysp_deviate_add*)elem;
+            add = (struct lysp_deviate_add *)elem;
             ly_print_(ctx->out, "add {\n");
             LEVEL++;
 
@@ -2062,7 +2062,7 @@
                 }
             }
         } else if (elem->mod == LYS_DEV_REPLACE) {
-            rpl = (struct lysp_deviate_rpl*)elem;
+            rpl = (struct lysp_deviate_rpl *)elem;
             ly_print_(ctx->out, "replace {\n");
             LEVEL++;
 
@@ -2085,7 +2085,7 @@
                 }
             }
         } else if (elem->mod == LYS_DEV_DELETE) {
-            del = (struct lysp_deviate_del*)elem;
+            del = (struct lysp_deviate_del *)elem;
             ly_print_(ctx->out, "delete {\n");
             LEVEL++;
 
diff --git a/src/printer_yin.c b/src/printer_yin.c
index ddc7cc2..bef314a 100644
--- a/src/printer_yin.c
+++ b/src/printer_yin.c
@@ -108,10 +108,10 @@
 
     LEVEL++;
     LY_ARRAY_FOR(ext, u) {
-        if (((struct lysp_ext_instance*)ext)[u].insubstmt != substmt || ((struct lysp_ext_instance*)ext)[u].insubstmt_index != substmt_index) {
+        if (((struct lysp_ext_instance *)ext)[u].insubstmt != substmt || ((struct lysp_ext_instance *)ext)[u].insubstmt_index != substmt_index) {
             continue;
         }
-        yprp_extension_instances(ctx, substmt, substmt_index, &((struct lysp_ext_instance*)ext)[u], &extflag, 1);
+        yprp_extension_instances(ctx, substmt, substmt_index, &((struct lysp_ext_instance *)ext)[u], &extflag, 1);
     }
 
     /* argument as yin-element */
@@ -1093,7 +1093,7 @@
                 continue;
             }
         } else if (elem->mod == LYS_DEV_ADD) {
-            add = (struct lysp_deviate_add*)elem;
+            add = (struct lysp_deviate_add *)elem;
             ly_print_(ctx->out, "add\">\n");
             LEVEL++;
 
@@ -1121,7 +1121,7 @@
                 }
             }
         } else if (elem->mod == LYS_DEV_REPLACE) {
-            rpl = (struct lysp_deviate_rpl*)elem;
+            rpl = (struct lysp_deviate_rpl *)elem;
             ly_print_(ctx->out, "replace\">\n");
             LEVEL++;
 
@@ -1144,7 +1144,7 @@
                 }
             }
         } else if (elem->mod == LYS_DEV_DELETE) {
-            del = (struct lysp_deviate_del*)elem;
+            del = (struct lysp_deviate_del *)elem;
             ly_print_(ctx->out, "delete\">\n");
             LEVEL++;
 
diff --git a/src/tree.h b/src/tree.h
index 0fe7264..cf1ac16 100644
--- a/src/tree.h
+++ b/src/tree.h
@@ -189,7 +189,7 @@
 /**
  * @brief Stringified YANG built-in data types
  */
-extern const char* ly_data_type2str[LY_DATA_TYPE_COUNT];
+extern const char *ly_data_type2str[LY_DATA_TYPE_COUNT];
 
 /** @} trees */
 
diff --git a/src/tree_data.c b/src/tree_data.c
index ad484fc..e2b6efb 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -67,7 +67,7 @@
 
     ctx = node->schema->module->ctx;
 
-    type = ((struct lysc_node_leaf*)node->schema)->type;
+    type = ((struct lysc_node_leaf *)node->schema)->type;
     ret = type->plugin->store(ctx, type, value, value_len, options, format, prefix_data,
                               tree ? (void *)node : (void *)node->schema, tree, &node->value, &err);
     if (ret && (ret != LY_EINCOMPLETE)) {
@@ -168,7 +168,7 @@
         return LY_EINVAL;
     }
 
-    type = ((struct lysc_node_leaf*)node)->type;
+    type = ((struct lysc_node_leaf *)node)->type;
     /* just validate, no storing of enything */
     rc = type->plugin->store(ctx ? ctx : node->module->ctx, type, value, value_len, LY_TYPE_OPTS_INCOMPLETE_DATA,
                              format, prefix_data, node, NULL, &storage, &err);
@@ -209,9 +209,9 @@
 
     LY_CHECK_ARG_RET(ctx, node, value, LY_EINVAL);
 
-    type = ((struct lysc_node_leaf*)node->schema)->type;
+    type = ((struct lysc_node_leaf *)node->schema)->type;
     rc = type->plugin->store(ctx ? ctx : node->schema->module->ctx, type, value, value_len, options, LY_PREF_JSON, NULL,
-                             tree ? (void*)node : (void*)node->schema, tree, &val, &err);
+                             tree ? (void *)node : (void *)node->schema, tree, &val, &err);
     if (rc == LY_EINCOMPLETE) {
         return rc;
     } else if (rc) {
@@ -246,7 +246,7 @@
     LY_CHECK_ARG_RET(node ? node->schema->module->ctx : NULL, node, value, LY_EINVAL);
 
     ctx = node->schema->module->ctx;
-    type = ((struct lysc_node_leaf*)node->schema)->type;
+    type = ((struct lysc_node_leaf *)node->schema)->type;
     rc = type->plugin->store(ctx, type, value, value_len, options, LY_PREF_JSON, NULL, (struct lyd_node *)node, tree, &data,
                              &err);
     if (rc == LY_EINCOMPLETE) {
@@ -2335,8 +2335,8 @@
                 }
             }
             if (options & LYD_COMPARE_FULL_RECURSION) {
-                iter1 = ((struct lyd_node_inner*)node1)->child;
-                iter2 = ((struct lyd_node_inner*)node2)->child;
+                iter1 = ((struct lyd_node_inner *)node1)->child;
+                iter2 = ((struct lyd_node_inner *)node2)->child;
                 goto all_children_compare;
             }
             return LY_SUCCESS;
@@ -2356,12 +2356,12 @@
             }
             return LY_SUCCESS;
         case LYS_LIST:
-            iter1 = ((struct lyd_node_inner*)node1)->child;
-            iter2 = ((struct lyd_node_inner*)node2)->child;
+            iter1 = ((struct lyd_node_inner *)node1)->child;
+            iter2 = ((struct lyd_node_inner *)node2)->child;
 
             if (!(node1->schema->flags & LYS_KEYLESS) && !(options & LYD_COMPARE_FULL_RECURSION)) {
                 /* lists with keys, their equivalence is based on their keys */
-                for (struct lysc_node *key = ((struct lysc_node_list*)node1->schema)->child;
+                for (struct lysc_node *key = ((struct lysc_node_list *)node1->schema)->child;
                         key && (key->flags & LYS_KEY);
                         key = key->next) {
                     if (lyd_compare_single(iter1, iter2, options)) {
@@ -2391,8 +2391,8 @@
             return LY_SUCCESS;
         case LYS_ANYXML:
         case LYS_ANYDATA:
-            any1 = (struct lyd_node_any*)node1;
-            any2 = (struct lyd_node_any*)node2;
+            any1 = (struct lyd_node_any *)node1;
+            any2 = (struct lyd_node_any *)node2;
 
             if (any1->value_type != any2->value_type) {
                 return LY_ENOT;
@@ -3037,7 +3037,7 @@
             }
 
             /* realloc string */
-            len = 1 + (mod ? strlen(mod->name) + 1 : 0) + (iter->schema ? strlen(iter->schema->name) : strlen(((struct lyd_node_opaq*)iter)->name));
+            len = 1 + (mod ? strlen(mod->name) + 1 : 0) + (iter->schema ? strlen(iter->schema->name) : strlen(((struct lyd_node_opaq *)iter)->name));
             rc = lyd_path_str_enlarge(&buffer, &buflen, bufused + len, is_static);
             if (rc != LY_SUCCESS) {
                 break;
@@ -3045,7 +3045,7 @@
 
             /* print next node */
             bufused += sprintf(buffer + bufused, "/%s%s%s", mod ? mod->name : "", mod ? ":" : "",
-                               iter->schema ? iter->schema->name : ((struct lyd_node_opaq*)iter)->name);
+                               iter->schema ? iter->schema->name : ((struct lyd_node_opaq *)iter)->name);
 
             /* do not always print the last (first) predicate */
             if (iter->schema && (bufused || (pathtype == LYD_PATH_LOG))) {
diff --git a/src/tree_data_hash.c b/src/tree_data_hash.c
index beca3b0..e299b7d 100644
--- a/src/tree_data_hash.c
+++ b/src/tree_data_hash.c
@@ -35,7 +35,7 @@
         switch (iter->schema->nodetype) {
         case LYS_CONTAINER:
         case LYS_LIST:
-            lyd_hash_keyless_list_dfs(((struct lyd_node_inner*)iter)->child, hash);
+            lyd_hash_keyless_list_dfs(((struct lyd_node_inner *)iter)->child, hash);
             break;
         case LYS_LEAFLIST:
         case LYS_ANYXML:
@@ -62,7 +62,7 @@
     node->hash = dict_hash_multi(node->hash, node->schema->name, strlen(node->schema->name));
 
     if (node->schema->nodetype == LYS_LIST) {
-        struct lyd_node_inner *list = (struct lyd_node_inner*)node;
+        struct lyd_node_inner *list = (struct lyd_node_inner *)node;
         if (!(node->schema->flags & LYS_KEYLESS)) {
             /* list's hash is made of its keys */
             for (iter = list->child; iter && (iter->schema->flags & LYS_KEY); iter = iter->next) {
diff --git a/src/tree_schema.c b/src/tree_schema.c
index 3b7d8b2..2f4df6e 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -59,8 +59,8 @@
         if (parent) {
             /* schema subtree */
             if (parent->nodetype == LYS_CHOICE && (options & LYS_GETNEXT_WITHCASE)) {
-                if (((struct lysc_node_choice*)parent)->cases) {
-                    next = last = (const struct lysc_node*)&((struct lysc_node_choice*)parent)->cases[0];
+                if (((struct lysc_node_choice *)parent)->cases) {
+                    next = last = (const struct lysc_node *)&((struct lysc_node_choice *)parent)->cases[0];
                 }
             } else {
                 snode = lysc_node_children_p(parent, (options & LYS_GETNEXT_OUTPUT) ? LYS_CONFIG_R : LYS_CONFIG_W);
@@ -88,12 +88,12 @@
             actions = module->rpcs;
         }
         LY_ARRAY_FOR(actions, u) {
-            if (&actions[u] == (struct lysc_action*)last) {
+            if (&actions[u] == (struct lysc_action *)last) {
                 break;
             }
         }
         if (u + 1 < LY_ARRAY_COUNT(actions)) {
-            next = (struct lysc_node*)(&actions[u + 1]);
+            next = (struct lysc_node *)(&actions[u + 1]);
         }
         goto repeat;
     } else if (last->nodetype == LYS_NOTIF) {
@@ -104,12 +104,12 @@
             notifs = module->notifs;
         }
         LY_ARRAY_FOR(notifs, u) {
-            if (&notifs[u] == (struct lysc_notif*)last) {
+            if (&notifs[u] == (struct lysc_notif *)last) {
                 break;
             }
         }
         if (u + 1 < LY_ARRAY_COUNT(notifs)) {
-            next = (struct lysc_node*)(&notifs[u + 1]);
+            next = (struct lysc_node *)(&notifs[u + 1]);
         }
         goto repeat;
     }
@@ -128,10 +128,10 @@
             goto next;
         } else if (!action_flag) {
             action_flag = 1;
-            next = parent ? (struct lysc_node*)lysc_node_actions(parent) : (struct lysc_node*)module->rpcs;
+            next = parent ? (struct lysc_node *)lysc_node_actions(parent) : (struct lysc_node *)module->rpcs;
         } else if (!notif_flag) {
             notif_flag = 1;
-            next = parent ? (struct lysc_node*)lysc_node_notifs(parent) : (struct lysc_node*)module->notifs;
+            next = parent ? (struct lysc_node *)lysc_node_notifs(parent) : (struct lysc_node *)module->notifs;
         } else {
             return NULL;
         }
@@ -168,7 +168,7 @@
         } else {
             /* go into */
             if (options & LYS_GETNEXT_WITHCASE) {
-                next = (struct lysc_node*)((struct lysc_node_choice *)next)->cases;
+                next = (struct lysc_node *)((struct lysc_node_choice *)next)->cases;
             } else {
                 next = ((struct lysc_node_choice *)next)->cases->child;
             }
@@ -669,7 +669,7 @@
          * its if-feature statements. The reverse logic, automatically enable feature when its feature is enabled
          * is not done - by default, features are disabled and must be explicitely enabled. */
         f = changed->objs[u];
-        LY_ARRAY_FOR(f->depfeatures, struct lysc_feature*, df) {
+        LY_ARRAY_FOR(f->depfeatures, struct lysc_feature *, df) {
             if (!((*df)->flags & LYS_FENABLED)) {
                 /* not enabled, nothing to do */
                 continue;
@@ -696,7 +696,7 @@
 {
     LY_CHECK_ARG_RET(NULL, module, feature, LY_EINVAL);
 
-    return lys_feature_change((struct lys_module*)module, feature, 1, 0);
+    return lys_feature_change((struct lys_module *)module, feature, 1, 0);
 }
 
 API LY_ERR
@@ -704,7 +704,7 @@
 {
     LY_CHECK_ARG_RET(NULL, module, feature, LY_EINVAL);
 
-    return lys_feature_change((struct lys_module*)module, feature, 0, 0);
+    return lys_feature_change((struct lys_module *)module, feature, 0, 0);
 }
 
 API LY_ERR
@@ -712,7 +712,7 @@
 {
     LY_CHECK_ARG_RET(NULL, module, feature, LY_EINVAL);
 
-    return lys_feature_change((struct lys_module*)module, feature, 1, 1);
+    return lys_feature_change((struct lys_module *)module, feature, 1, 1);
 }
 
 API LY_ERR
@@ -720,7 +720,7 @@
 {
     LY_CHECK_ARG_RET(NULL, module, feature, LY_EINVAL);
 
-    return lys_feature_change((struct lys_module*)module, feature, 0, 1);
+    return lys_feature_change((struct lys_module *)module, feature, 0, 1);
 }
 
 API LY_ERR
@@ -792,7 +792,7 @@
 }
 
 API LY_ERR
-lysc_node_set_private(const struct lysc_node *node, void *priv, void** prev_priv_p)
+lysc_node_set_private(const struct lysc_node *node, void *priv, void **prev_priv_p)
 {
     LY_CHECK_ARG_RET(NULL, node, LY_EINVAL);
 
@@ -877,7 +877,7 @@
 
 LY_ERR
 lys_parse_mem_submodule(struct ly_ctx *ctx, struct ly_in *in, LYS_INFORMAT format, struct lys_parser_ctx *main_ctx,
-        LY_ERR (*custom_check)(const struct ly_ctx*, struct lysp_module*, struct lysp_submodule*, void*),
+        LY_ERR (*custom_check)(const struct ly_ctx *, struct lysp_module *, struct lysp_submodule *, void *),
         void *check_data, struct lysp_submodule **submodule)
 {
     LY_ERR ret;
@@ -1003,7 +1003,7 @@
     }
 
     /* decide the latest revision */
-    latest = (struct lys_module*)ly_ctx_get_module_latest(ctx, mod->name);
+    latest = (struct lys_module *)ly_ctx_get_module_latest(ctx, mod->name);
     if (latest) {
         if (mod->revision) {
             if (!latest->revision) {
@@ -1038,7 +1038,7 @@
     }
 
     /* check for duplicity in the context */
-    mod_dup = (struct lys_module*)ly_ctx_get_module(ctx, mod->name, mod->revision);
+    mod_dup = (struct lys_module *)ly_ctx_get_module(ctx, mod->name, mod->revision);
     if (mod_dup) {
         if (mod_dup->parsed) {
             /* error */
diff --git a/src/tree_schema.h b/src/tree_schema.h
index 56cd450..9d6b36a 100644
--- a/src/tree_schema.h
+++ b/src/tree_schema.h
@@ -620,7 +620,7 @@
     const char *nodeid;              /**< target absolute schema nodeid (mandatory) */
     const char *dsc;                 /**< description statement */
     const char *ref;                 /**< reference statement */
-    struct lysp_deviate* deviates;   /**< list of deviate specifications (linked list) */
+    struct lysp_deviate *deviates;   /**< list of deviate specifications (linked list) */
     struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */
 };
 
@@ -921,7 +921,7 @@
 
     /* choice */
     struct lysp_node *child;         /**< list of data nodes (linked list) */
-    const char* dflt;                /**< default case */
+    const char *dflt;                /**< default case */
 };
 
 struct lysp_node_case {
diff --git a/src/tree_schema_compile.c b/src/tree_schema_compile.c
index 763e72e..cae0cd0 100644
--- a/src/tree_schema_compile.c
+++ b/src/tree_schema_compile.c
@@ -299,7 +299,7 @@
  * @param[in] orig The pattern structure to duplicate.
  * @return The duplicated structure to use.
  */
-static struct lysc_pattern*
+static struct lysc_pattern *
 lysc_pattern_dup(struct lysc_pattern *orig)
 {
     ++orig->refcount;
@@ -316,7 +316,7 @@
  * @return New sized array as a copy of @p orig.
  * @return NULL in case of memory allocation error.
  */
-static struct lysc_pattern**
+static struct lysc_pattern **
 lysc_patterns_dup(struct ly_ctx *ctx, struct lysc_pattern **orig)
 {
     struct lysc_pattern **dup = NULL;
@@ -340,7 +340,7 @@
  * @return New compiled range structure as a copy of @p orig.
  * @return NULL in case of memory allocation error.
  */
-struct lysc_range*
+struct lysc_range *
 lysc_range_dup(struct ly_ctx *ctx, const struct lysc_range *orig)
 {
     struct lysc_range *dup;
@@ -556,7 +556,7 @@
     ext->parent = parent;
     ext->parent_type = parent_type;
 
-    lysc_update_path(ctx, ext->parent_type == LYEXT_PAR_NODE ? (struct lysc_node*)ext->parent : NULL, "{extension}");
+    lysc_update_path(ctx, ext->parent_type == LYEXT_PAR_NODE ? (struct lysc_node *)ext->parent : NULL, "{extension}");
 
     /* get module where the extension definition should be placed */
     for (u = strlen(ext_p->name); u && ext_p->name[u - 1] != ':'; --u) {}
@@ -664,7 +664,7 @@
 
     if (ext->def->plugin && ext->def->plugin->compile) {
         if (ext->argument) {
-            lysc_update_path(ctx, (struct lysc_node*)ext, ext->argument);
+            lysc_update_path(ctx, (struct lysc_node *)ext, ext->argument);
         }
         LY_CHECK_GOTO(ext->def->plugin->compile(ctx, ext_p, ext), cleanup);
         if (ext->argument) {
@@ -2223,7 +2223,7 @@
 /**
  * @brief stringification of the YANG built-in data types
  */
-const char* ly_data_type2str[LY_DATA_TYPE_COUNT] = {"unknown", "binary", "8bit unsigned integer", "16bit unsigned integer",
+const char *ly_data_type2str[LY_DATA_TYPE_COUNT] = {"unknown", "binary", "8bit unsigned integer", "16bit unsigned integer",
     "32bit unsigned integer", "64bit unsigned integer", "string", "bits", "boolean", "decimal64", "empty", "enumeration",
     "identityref", "instance-identifier", "leafref", "union", "8bit integer", "16bit integer", "32bit integer", "64bit integer"};
 
@@ -2542,12 +2542,12 @@
 
     switch (basetype) {
     case LY_TYPE_BINARY:
-        bin = (struct lysc_type_bin*)(*type);
+        bin = (struct lysc_type_bin *)(*type);
 
         /* RFC 7950 9.8.1, 9.4.4 - length, number of octets it contains */
         if (type_p->length) {
             LY_CHECK_RET(lys_compile_type_range(ctx, type_p->length, basetype, 1, 0,
-                                                base ? ((struct lysc_type_bin*)base)->length : NULL, &bin->length));
+                                                base ? ((struct lysc_type_bin *)base)->length : NULL, &bin->length));
             if (!tpdfname) {
                 COMPILE_EXTS_GOTO(ctx, type_p->length->exts, bin->length->exts, bin->length, LYEXT_PAR_LENGTH, ret, done);
             }
@@ -2560,11 +2560,11 @@
         break;
     case LY_TYPE_BITS:
         /* RFC 7950 9.7 - bits */
-        bits = (struct lysc_type_bits*)(*type);
+        bits = (struct lysc_type_bits *)(*type);
         if (type_p->bits) {
             LY_CHECK_RET(lys_compile_type_enums(ctx, type_p->bits, basetype,
-                                                base ? (struct lysc_type_bitenum_item*)((struct lysc_type_bits*)base)->bits : NULL,
-                    (struct lysc_type_bitenum_item**)&bits->bits));
+                                                base ? (struct lysc_type_bitenum_item *)((struct lysc_type_bits *)base)->bits : NULL,
+                    (struct lysc_type_bitenum_item **)&bits->bits));
         }
 
         if (!base && !type_p->flags) {
@@ -2633,25 +2633,25 @@
         }
         break;
     case LY_TYPE_STRING:
-        str = (struct lysc_type_str*)(*type);
+        str = (struct lysc_type_str *)(*type);
 
         /* RFC 7950 9.4.4 - length */
         if (type_p->length) {
             LY_CHECK_RET(lys_compile_type_range(ctx, type_p->length, basetype, 1, 0,
-                                                base ? ((struct lysc_type_str*)base)->length : NULL, &str->length));
+                                                base ? ((struct lysc_type_str *)base)->length : NULL, &str->length));
             if (!tpdfname) {
                 COMPILE_EXTS_GOTO(ctx, type_p->length->exts, str->length->exts, str->length, LYEXT_PAR_LENGTH, ret, done);
             }
-        } else if (base && ((struct lysc_type_str*)base)->length) {
-            str->length = lysc_range_dup(ctx->ctx, ((struct lysc_type_str*)base)->length);
+        } else if (base && ((struct lysc_type_str *)base)->length) {
+            str->length = lysc_range_dup(ctx->ctx, ((struct lysc_type_str *)base)->length);
         }
 
         /* RFC 7950 9.4.5 - pattern */
         if (type_p->patterns) {
             LY_CHECK_RET(lys_compile_type_patterns(ctx, type_p->patterns,
-                                                   base ? ((struct lysc_type_str*)base)->patterns : NULL, &str->patterns));
-        } else if (base && ((struct lysc_type_str*)base)->patterns) {
-            str->patterns = lysc_patterns_dup(ctx->ctx, ((struct lysc_type_str*)base)->patterns);
+                                                   base ? ((struct lysc_type_str *)base)->patterns : NULL, &str->patterns));
+        } else if (base && ((struct lysc_type_str *)base)->patterns) {
+            str->patterns = lysc_patterns_dup(ctx->ctx, ((struct lysc_type_str *)base)->patterns);
         }
 
         if (tpdfname) {
@@ -2660,12 +2660,12 @@
         }
         break;
     case LY_TYPE_ENUM:
-        enumeration = (struct lysc_type_enum*)(*type);
+        enumeration = (struct lysc_type_enum *)(*type);
 
         /* RFC 7950 9.6 - enum */
         if (type_p->enums) {
             LY_CHECK_RET(lys_compile_type_enums(ctx, type_p->enums, basetype,
-                                                base ? ((struct lysc_type_enum*)base)->enums : NULL, &enumeration->enums));
+                                                base ? ((struct lysc_type_enum *)base)->enums : NULL, &enumeration->enums));
         }
 
         if (!base && !type_p->flags) {
@@ -2693,12 +2693,12 @@
     case LY_TYPE_UINT32:
     case LY_TYPE_INT64:
     case LY_TYPE_UINT64:
-        num = (struct lysc_type_num*)(*type);
+        num = (struct lysc_type_num *)(*type);
 
         /* RFC 6020 9.2.4 - range */
         if (type_p->range) {
             LY_CHECK_RET(lys_compile_type_range(ctx, type_p->range, basetype, 0, 0,
-                                                base ? ((struct lysc_type_num*)base)->range : NULL, &num->range));
+                                                base ? ((struct lysc_type_num *)base)->range : NULL, &num->range));
             if (!tpdfname) {
                 COMPILE_EXTS_GOTO(ctx, type_p->range->exts, num->range->exts, num->range, LYEXT_PAR_RANGE, ret, done);
             }
@@ -2710,7 +2710,7 @@
         }
         break;
     case LY_TYPE_IDENT:
-        idref = (struct lysc_type_identityref*)(*type);
+        idref = (struct lysc_type_identityref *)(*type);
 
         /* RFC 7950 9.10.2 - base */
         if (type_p->bases) {
@@ -2749,7 +2749,7 @@
         }
         break;
     case LY_TYPE_LEAFREF:
-        lref = (struct lysc_type_leafref*)*type;
+        lref = (struct lysc_type_leafref *)*type;
 
         /* RFC 7950 9.9.3 - require-instance */
         if (type_p->flags & LYS_SET_REQINST) {
@@ -2777,8 +2777,8 @@
             lref->path = lyxp_expr_dup(ctx->ctx, type_p->path);
             lref->path_context = module;
         } else if (base) {
-            lref->path = lyxp_expr_dup(ctx->ctx, ((struct lysc_type_leafref*)base)->path);
-            lref->path_context = ((struct lysc_type_leafref*)base)->path_context;
+            lref->path = lyxp_expr_dup(ctx->ctx, ((struct lysc_type_leafref *)base)->path);
+            lref->path_context = ((struct lysc_type_leafref *)base)->path_context;
         } else if (tpdfname) {
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LY_VCODE_MISSCHILDSTMT, "path", "leafref type ", tpdfname);
             return LY_EVALID;
@@ -2796,10 +2796,10 @@
     case LY_TYPE_INST:
         /* RFC 7950 9.9.3 - require-instance */
         if (type_p->flags & LYS_SET_REQINST) {
-            ((struct lysc_type_instanceid*)(*type))->require_instance = type_p->require_instance;
+            ((struct lysc_type_instanceid *)(*type))->require_instance = type_p->require_instance;
         } else {
             /* default is true */
-            ((struct lysc_type_instanceid*)(*type))->require_instance = 1;
+            ((struct lysc_type_instanceid *)(*type))->require_instance = 1;
         }
 
         if (tpdfname) {
@@ -2808,7 +2808,7 @@
         }
         break;
     case LY_TYPE_UNION:
-        un = (struct lysc_type_union*)(*type);
+        un = (struct lysc_type_union *)(*type);
 
         /* RFC 7950 7.4 - type */
         if (type_p->types) {
@@ -2834,22 +2834,22 @@
                 if (un->types[u + additional]->basetype == LY_TYPE_UNION) {
                     /* add space for additional types from the union subtype */
                     un_aux = (struct lysc_type_union *)un->types[u + additional];
-                    LY_ARRAY_RESIZE_ERR_RET(ctx->ctx, un->types, (*((uint64_t*)(type_p->types) - 1)) + additional + LY_ARRAY_COUNT(un_aux->types) - 1,
-                                            lysc_type_free(ctx->ctx, (struct lysc_type*)un_aux), LY_EMEM);
+                    LY_ARRAY_RESIZE_ERR_RET(ctx->ctx, un->types, (*((uint64_t *)(type_p->types) - 1)) + additional + LY_ARRAY_COUNT(un_aux->types) - 1,
+                                            lysc_type_free(ctx->ctx, (struct lysc_type *)un_aux), LY_EMEM);
 
                     /* copy subtypes of the subtype union */
                     for (LY_ARRAY_COUNT_TYPE v = 0; v < LY_ARRAY_COUNT(un_aux->types); ++v) {
                         if (un_aux->types[v]->basetype == LY_TYPE_LEAFREF) {
                             /* duplicate the whole structure because of the instance-specific path resolving for realtype */
                             un->types[u + additional] = calloc(1, sizeof(struct lysc_type_leafref));
-                            LY_CHECK_ERR_RET(!un->types[u + additional], LOGMEM(ctx->ctx); lysc_type_free(ctx->ctx, (struct lysc_type*)un_aux), LY_EMEM);
+                            LY_CHECK_ERR_RET(!un->types[u + additional], LOGMEM(ctx->ctx); lysc_type_free(ctx->ctx, (struct lysc_type *)un_aux), LY_EMEM);
                             lref = (struct lysc_type_leafref *)un->types[u + additional];
 
                             lref->basetype = LY_TYPE_LEAFREF;
-                            lref->path = lyxp_expr_dup(ctx->ctx, ((struct lysc_type_leafref*)un_aux->types[v])->path);
+                            lref->path = lyxp_expr_dup(ctx->ctx, ((struct lysc_type_leafref *)un_aux->types[v])->path);
                             lref->refcount = 1;
-                            lref->require_instance = ((struct lysc_type_leafref*)un_aux->types[v])->require_instance;
-                            lref->path_context = ((struct lysc_type_leafref*)un_aux->types[v])->path_context;
+                            lref->require_instance = ((struct lysc_type_leafref *)un_aux->types[v])->require_instance;
+                            lref->path_context = ((struct lysc_type_leafref *)un_aux->types[v])->path_context;
                             /* TODO extensions */
 
                         } else {
@@ -2863,7 +2863,7 @@
                     --additional;
 
                     /* free the replaced union subtype */
-                    lysc_type_free(ctx->ctx, (struct lysc_type*)un_aux);
+                    lysc_type_free(ctx->ctx, (struct lysc_type *)un_aux);
                 } else {
                     LY_ARRAY_INCREMENT(un->types);
                 }
@@ -2962,7 +2962,7 @@
             *dflt_mod = tctx->mod->mod;
         }
         if (dummyloops && (!units || *units) && dflt && *dflt) {
-            basetype = ((struct type_context*)tpdf_chain.objs[tpdf_chain.count - 1])->tpdf->type.compiled->basetype;
+            basetype = ((struct type_context *)tpdf_chain.objs[tpdf_chain.count - 1])->tpdf->type.compiled->basetype;
             break;
         }
 
@@ -2983,7 +2983,7 @@
         /* circular typedef reference detection */
         for (u = 0; u < tpdf_chain.count; u++) {
             /* local part */
-            tctx_iter = (struct type_context*)tpdf_chain.objs[u];
+            tctx_iter = (struct type_context *)tpdf_chain.objs[u];
             if (tctx_iter->mod == tctx->mod && tctx_iter->node == tctx->node && tctx_iter->tpdf == tctx->tpdf) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
                        "Invalid \"%s\" type reference - circular chain of types detected.", tctx->tpdf->name);
@@ -2994,7 +2994,7 @@
         }
         for (u = 0; u < ctx->tpdf_chain.count; u++) {
             /* global part for unions corner case */
-            tctx_iter = (struct type_context*)ctx->tpdf_chain.objs[u];
+            tctx_iter = (struct type_context *)ctx->tpdf_chain.objs[u];
             if (tctx_iter->mod == tctx->mod && tctx_iter->node == tctx->node && tctx_iter->tpdf == tctx->tpdf) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
                        "Invalid \"%s\" type reference - circular chain of types detected.", tctx->tpdf->name);
@@ -3076,7 +3076,7 @@
 
     /* get restrictions from the referred typedefs */
     for (u = tpdf_chain.count - 1; u + 1 > 0; --u) {
-        tctx = (struct type_context*)tpdf_chain.objs[u];
+        tctx = (struct type_context *)tpdf_chain.objs[u];
 
         /* remember the typedef context for circular check */
         ly_set_add(&ctx->tpdf_chain, tctx, LY_SET_OPT_USEASLIST);
@@ -3086,7 +3086,7 @@
             continue;
         } else if (basetype != LY_TYPE_LEAFREF && (u != tpdf_chain.count - 1) && !(tctx->tpdf->type.flags)) {
             /* no change, just use the type information from the base */
-            base = ((struct lysp_tpdf*)tctx->tpdf)->type.compiled = ((struct type_context*)tpdf_chain.objs[u + 1])->tpdf->type.compiled;
+            base = ((struct lysp_tpdf *)tctx->tpdf)->type.compiled = ((struct type_context *)tpdf_chain.objs[u + 1])->tpdf->type.compiled;
             ++base->refcount;
             continue;
         }
@@ -3109,7 +3109,7 @@
         /* TODO user type plugins */
         (*type)->plugin = &ly_builtin_type_plugins[basetype];
         prev_type = *type;
-        ret = lys_compile_type_(ctx, tctx->node, tctx->tpdf->flags, tctx->mod, tctx->tpdf->name, &((struct lysp_tpdf*)tctx->tpdf)->type,
+        ret = lys_compile_type_(ctx, tctx->node, tctx->tpdf->flags, tctx->mod, tctx->tpdf->name, &((struct lysp_tpdf *)tctx->tpdf)->type,
                                 basetype & (LY_TYPE_LEAFREF | LY_TYPE_UNION) ? lysp_find_module(ctx->ctx, tctx->mod) : NULL,
                                 basetype, tctx->tpdf->name, base, type);
         LY_CHECK_GOTO(ret, cleanup);
@@ -3287,23 +3287,23 @@
     COMPILE_EXTS_GOTO(ctx, action_p->exts, action->exts, action, LYEXT_PAR_NODE, ret, cleanup);
 
     /* input */
-    lysc_update_path(ctx, (struct lysc_node*)action, "input");
+    lysc_update_path(ctx, (struct lysc_node *)action, "input");
     COMPILE_ARRAY_GOTO(ctx, action_p->input.musts, action->input.musts, u, lys_compile_must, ret, cleanup);
     COMPILE_EXTS_GOTO(ctx, action_p->input.exts, action->input_exts, &action->input, LYEXT_PAR_INPUT, ret, cleanup);
     ctx->options |= LYSC_OPT_RPC_INPUT;
     LY_LIST_FOR(action_p->input.data, child_p) {
-        LY_CHECK_RET(lys_compile_node(ctx, child_p, (struct lysc_node*)action, uses_status));
+        LY_CHECK_RET(lys_compile_node(ctx, child_p, (struct lysc_node *)action, uses_status));
     }
     lysc_update_path(ctx, NULL, NULL);
     ctx->options = opt_prev;
 
     /* output */
-    lysc_update_path(ctx, (struct lysc_node*)action, "output");
+    lysc_update_path(ctx, (struct lysc_node *)action, "output");
     COMPILE_ARRAY_GOTO(ctx, action_p->output.musts, action->output.musts, u, lys_compile_must, ret, cleanup);
     COMPILE_EXTS_GOTO(ctx, action_p->output.exts, action->output_exts, &action->output, LYEXT_PAR_OUTPUT, ret, cleanup);
     ctx->options |= LYSC_OPT_RPC_OUTPUT;
     LY_LIST_FOR(action_p->output.data, child_p) {
-        LY_CHECK_RET(lys_compile_node(ctx, child_p, (struct lysc_node*)action, uses_status));
+        LY_CHECK_RET(lys_compile_node(ctx, child_p, (struct lysc_node *)action, uses_status));
     }
     lysc_update_path(ctx, NULL, NULL);
     lysc_update_path(ctx, NULL, NULL);
@@ -3378,7 +3378,7 @@
 
     ctx->options |= LYSC_OPT_NOTIFICATION;
     LY_LIST_FOR(notif_p->data, child_p) {
-        LY_CHECK_RET(lys_compile_node(ctx, child_p, (struct lysc_node*)notif, uses_status));
+        LY_CHECK_RET(lys_compile_node(ctx, child_p, (struct lysc_node *)notif, uses_status));
     }
 
     lysc_update_path(ctx, NULL, NULL);
@@ -3398,8 +3398,8 @@
 static LY_ERR
 lys_compile_node_container(struct lysc_ctx *ctx, struct lysp_node *node_p, struct lysc_node *node)
 {
-    struct lysp_node_container *cont_p = (struct lysp_node_container*)node_p;
-    struct lysc_node_container *cont = (struct lysc_node_container*)node;
+    struct lysp_node_container *cont_p = (struct lysp_node_container *)node_p;
+    struct lysc_node_container *cont = (struct lysc_node_container *)node;
     struct lysp_node *child_p;
     LY_ARRAY_COUNT_TYPE u;
     LY_ERR ret = LY_SUCCESS;
@@ -3507,8 +3507,8 @@
 static LY_ERR
 lys_compile_node_leaf(struct lysc_ctx *ctx, struct lysp_node *node_p, struct lysc_node *node)
 {
-    struct lysp_node_leaf *leaf_p = (struct lysp_node_leaf*)node_p;
-    struct lysc_node_leaf *leaf = (struct lysc_node_leaf*)node;
+    struct lysp_node_leaf *leaf_p = (struct lysp_node_leaf *)node_p;
+    struct lysc_node_leaf *leaf = (struct lysc_node_leaf *)node;
     LY_ARRAY_COUNT_TYPE u;
     LY_ERR ret = LY_SUCCESS;
 
@@ -3546,8 +3546,8 @@
 static LY_ERR
 lys_compile_node_leaflist(struct lysc_ctx *ctx, struct lysp_node *node_p, struct lysc_node *node)
 {
-    struct lysp_node_leaflist *llist_p = (struct lysp_node_leaflist*)node_p;
-    struct lysc_node_leaflist *llist = (struct lysc_node_leaflist*)node;
+    struct lysp_node_leaflist *llist_p = (struct lysp_node_leaflist *)node_p;
+    struct lysc_node_leaflist *llist = (struct lysc_node_leaflist *)node;
     LY_ARRAY_COUNT_TYPE u;
     LY_ERR ret = LY_SUCCESS;
 
@@ -3617,8 +3617,8 @@
 
             /* unique node must be present */
             LY_ARRAY_NEW_RET(ctx->ctx, *unique, key, LY_EMEM);
-            ret = lysc_resolve_schema_nodeid(ctx, keystr, len, (struct lysc_node*)list, context_module, LYS_LEAF, 0,
-                            (const struct lysc_node**)key, &flags);
+            ret = lysc_resolve_schema_nodeid(ctx, keystr, len, (struct lysc_node *)list, context_module, LYS_LEAF, 0,
+                            (const struct lysc_node **)key, &flags);
             if (ret != LY_SUCCESS) {
                 if (ret == LY_EDENIED) {
                     LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
@@ -3680,8 +3680,8 @@
 static LY_ERR
 lys_compile_node_list(struct lysc_ctx *ctx, struct lysp_node *node_p, struct lysc_node *node)
 {
-    struct lysp_node_list *list_p = (struct lysp_node_list*)node_p;
-    struct lysc_node_list *list = (struct lysc_node_list*)node;
+    struct lysp_node_list *list_p = (struct lysp_node_list *)node_p;
+    struct lysc_node_list *list = (struct lysc_node_list *)node;
     struct lysp_node *child_p;
     struct lysc_node_leaf *key, *prev_key = NULL;
     size_t len;
@@ -3729,7 +3729,7 @@
         }
 
         /* key node must be present */
-        key = (struct lysc_node_leaf*)lys_find_child(node, node->module, keystr, len, LYS_LEAF, LYS_GETNEXT_NOCHOICE | LYS_GETNEXT_NOSTATECHECK);
+        key = (struct lysc_node_leaf *)lys_find_child(node, node->module, keystr, len, LYS_LEAF, LYS_GETNEXT_NOCHOICE | LYS_GETNEXT_NOSTATECHECK);
         if (!(key)) {
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
                    "The list's key \"%.*s\" not found.", len, keystr);
@@ -3743,7 +3743,7 @@
             return LY_EVALID;
         }
 
-        lysc_update_path(ctx, (struct lysc_node*)list, key->name);
+        lysc_update_path(ctx, (struct lysc_node *)list, key->name);
         /* key must have the same config flag as the list itself */
         if ((list->flags & LYS_CONFIG_MASK) != (key->flags & LYS_CONFIG_MASK)) {
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS, "Key of the configuration list must not be status leaf.");
@@ -3785,7 +3785,7 @@
         key->flags |= LYS_KEY;
 
         /* move it to the correct position */
-        if ((prev_key && (struct lysc_node*)prev_key != key->prev) || (!prev_key && key->prev->next)) {
+        if ((prev_key && (struct lysc_node *)prev_key != key->prev) || (!prev_key && key->prev->next)) {
             /* fix links in closest previous siblings of the key */
             if (key->next) {
                 key->next->prev = key->prev;
@@ -3798,7 +3798,7 @@
             }
             /* fix links in the key */
             if (prev_key) {
-                key->prev = (struct lysc_node*)prev_key;
+                key->prev = (struct lysc_node *)prev_key;
                 key->next = prev_key->next;
             } else {
                 key->prev = list->child->prev;
@@ -3807,17 +3807,17 @@
             /* fix links in closes future siblings of the key */
             if (prev_key) {
                 if (prev_key->next) {
-                    prev_key->next->prev = (struct lysc_node*)key;
+                    prev_key->next->prev = (struct lysc_node *)key;
                 } else {
-                    list->child->prev = (struct lysc_node*)key;
+                    list->child->prev = (struct lysc_node *)key;
                 }
-                prev_key->next = (struct lysc_node*)key;
+                prev_key->next = (struct lysc_node *)key;
             } else {
-                list->child->prev = (struct lysc_node*)key;
+                list->child->prev = (struct lysc_node *)key;
             }
             /* fix links in parent */
             if (!key->prev->next) {
-                list->child = (struct lysc_node*)key;
+                list->child = (struct lysc_node *)key;
             }
         }
 
@@ -3853,7 +3853,7 @@
 static LY_ERR
 lys_compile_node_choice_dflt(struct lysc_ctx *ctx, const char *dflt, struct lysc_node_choice *ch)
 {
-    struct lysc_node *iter, *node = (struct lysc_node*)ch;
+    struct lysc_node *iter, *node = (struct lysc_node *)ch;
     const char *prefix = NULL, *name;
     size_t prefix_len = 0;
 
@@ -3873,7 +3873,7 @@
                prefix_len, prefix);
         return LY_EVALID;
     }
-    ch->dflt = (struct lysc_node_case*)lys_find_child(node, node->module, name, 0, LYS_CASE, LYS_GETNEXT_NOSTATECHECK | LYS_GETNEXT_WITHCASE);
+    ch->dflt = (struct lysc_node_case *)lys_find_child(node, node->module, name, 0, LYS_CASE, LYS_GETNEXT_NOSTATECHECK | LYS_GETNEXT_WITHCASE);
     if (!ch->dflt) {
         LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS,
                "Default case \"%s\" not found.", dflt);
@@ -3881,7 +3881,7 @@
     }
     /* no mandatory nodes directly under the default case */
     LY_LIST_FOR(ch->dflt->child, iter) {
-        if (iter->parent != (struct lysc_node*)ch->dflt) {
+        if (iter->parent != (struct lysc_node *)ch->dflt) {
             break;
         }
         if (iter->flags & LYS_MAND_TRUE) {
@@ -3924,7 +3924,7 @@
         mod = ctx->mod;
     }
     /* get the default case */
-    cs = (struct lysc_node_case*)lys_find_child((struct lysc_node*)ch, mod, name, 0, LYS_CASE, LYS_GETNEXT_NOSTATECHECK | LYS_GETNEXT_WITHCASE);
+    cs = (struct lysc_node_case *)lys_find_child((struct lysc_node *)ch, mod, name, 0, LYS_CASE, LYS_GETNEXT_NOSTATECHECK | LYS_GETNEXT_WITHCASE);
     if (!cs) {
         LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
                "Invalid deviation adding \"default\" property \"%s\" of choice - the specified case does not exists.", dflt);
@@ -3933,7 +3933,7 @@
 
     /* check that there is no mandatory node */
     LY_LIST_FOR(cs->child, node) {
-        if (node->parent != (struct lysc_node*)cs) {
+        if (node->parent != (struct lysc_node *)cs) {
             break;
         }
         if (node->flags & LYS_MAND_TRUE) {
@@ -3962,14 +3962,14 @@
 static LY_ERR
 lys_compile_node_choice(struct lysc_ctx *ctx, struct lysp_node *node_p, struct lysc_node *node)
 {
-    struct lysp_node_choice *ch_p = (struct lysp_node_choice*)node_p;
-    struct lysc_node_choice *ch = (struct lysc_node_choice*)node;
+    struct lysp_node_choice *ch_p = (struct lysp_node_choice *)node_p;
+    struct lysc_node_choice *ch = (struct lysc_node_choice *)node;
     struct lysp_node *child_p, *case_child_p;
     LY_ERR ret = LY_SUCCESS;
 
     LY_LIST_FOR(ch_p->child, child_p) {
         if (child_p->nodetype == LYS_CASE) {
-            LY_LIST_FOR(((struct lysp_node_case*)child_p)->child, case_child_p) {
+            LY_LIST_FOR(((struct lysp_node_case *)child_p)->child, case_child_p) {
                 LY_CHECK_RET(lys_compile_node(ctx, case_child_p, node, 0));
             }
         } else {
@@ -3996,8 +3996,8 @@
 static LY_ERR
 lys_compile_node_any(struct lysc_ctx *ctx, struct lysp_node *node_p, struct lysc_node *node)
 {
-    struct lysp_node_anydata *any_p = (struct lysp_node_anydata*)node_p;
-    struct lysc_node_anydata *any = (struct lysc_node_anydata*)node;
+    struct lysp_node_anydata *any_p = (struct lysp_node_anydata *)node_p;
+    struct lysc_node_anydata *any = (struct lysc_node_anydata *)node;
     unsigned int u;
     LY_ERR ret = LY_SUCCESS;
 
@@ -4033,7 +4033,7 @@
     const struct lys_module *mod;
 
     if (node->nodetype == LYS_CASE) {
-        children = (struct lysc_node**)&((struct lysc_node_choice*)parent)->cases;
+        children = (struct lysc_node **)&((struct lysc_node_choice *)parent)->cases;
     } else {
         children = lysc_node_children_p(parent, ctx->options);
     }
@@ -4097,7 +4097,7 @@
  * @return The case structure where the child node belongs to, NULL in case of error. Note that the child is not connected into the siblings list,
  * it is linked from the case structure only in case it is its first child.
  */
-static struct lysc_node_case*
+static struct lysc_node_case *
 lys_compile_node_case(struct lysc_ctx *ctx, struct lysp_node *node_p, struct lysc_node_choice *ch, struct lysc_node *child)
 {
     struct lysc_node *iter;
@@ -4120,19 +4120,19 @@
         /* we have to add an implicit case node into the parent choice */
         cs = calloc(1, sizeof(struct lysc_node_case));
         DUP_STRING(ctx->ctx, child->name, cs->name);
-        cs->parent = (struct lysc_node*)ch;
+        cs->parent = (struct lysc_node *)ch;
         cs->flags = ch->flags & LYS_STATUS_MASK;
     } else if (node_p->nodetype == LYS_CASE) {
         if (ch->cases && (node_p == ch->cases->prev->sp)) {
             /* the case is already present since the child is not its first children */
-            return (struct lysc_node_case*)ch->cases->prev;
+            return (struct lysc_node_case *)ch->cases->prev;
         }
         UNIQUE_CHECK(node_p->name, ctx->mod);
 
         /* explicit parent case is not present (this is its first child) */
         cs = calloc(1, sizeof(struct lysc_node_case));
         DUP_STRING(ctx->ctx, node_p->name, cs->name);
-        cs->parent = (struct lysc_node*)ch;
+        cs->parent = (struct lysc_node *)ch;
         cs->flags = LYS_STATUS_MASK & node_p->flags;
         cs->sp = node_p;
 
@@ -4155,15 +4155,15 @@
         goto error;
     }
     cs->module = ctx->mod;
-    cs->prev = (struct lysc_node*)cs;
+    cs->prev = (struct lysc_node *)cs;
     cs->nodetype = LYS_CASE;
-    lys_compile_node_connect(ctx, (struct lysc_node*)ch, (struct lysc_node*)cs);
+    lys_compile_node_connect(ctx, (struct lysc_node *)ch, (struct lysc_node *)cs);
     cs->child = child;
 
     return cs;
 error:
     if (cs) {
-        lysc_node_free(ctx->ctx, (struct lysc_node*)cs);
+        lysc_node_free(ctx->ctx, (struct lysc_node *)cs);
     }
     return NULL;
 
@@ -4221,7 +4221,7 @@
     node->flags |= config;
 
     /* inherit the change into the children */
-    LY_LIST_FOR((struct lysc_node*)lysc_node_children(node, 0), child) {
+    LY_LIST_FOR((struct lysc_node *)lysc_node_children(node, 0), child) {
         LY_CHECK_RET(lys_compile_change_config(ctx, child, config_flag, 1, refine_flag));
     }
 
@@ -4250,7 +4250,7 @@
         }
     } else { /* unset flag */
         for ( ; parent && parent->nodetype == LYS_CONTAINER && (parent->flags & LYS_MAND_TRUE); parent = parent->parent) {
-            for (iter = (struct lysc_node*)lysc_node_children(parent, 0); iter; iter = iter->next) {
+            for (iter = (struct lysc_node *)lysc_node_children(parent, 0); iter; iter = iter->next) {
                 if (iter->flags & LYS_MAND_TRUE) {
                     /* there is another mandatory node */
                     return;
@@ -4374,7 +4374,7 @@
 
     ret = lysc_resolve_schema_nodeid(ctx, aug_p->nodeid, 0, parent, parent ? parent->module : ctx->mod_def,
                                                LYS_CONTAINER | LYS_LIST | LYS_CHOICE | LYS_CASE | LYS_INOUT | LYS_NOTIF,
-                                               1, (const struct lysc_node**)&target, &flags);
+                                               1, (const struct lysc_node **)&target, &flags);
     if (ret != LY_SUCCESS) {
         if (ret == LY_EDENIED) {
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
@@ -4420,13 +4420,13 @@
          * here we gets the last created node as last children of our parent */
         if (target->nodetype == LYS_CASE) {
             /* the compiled node is the last child of the target (but it is a case, so we have to be careful and stop) */
-            for (node = (struct lysc_node*)lysc_node_children(target, flags); node->next && node->next->parent == node->parent; node = node->next) {}
+            for (node = (struct lysc_node *)lysc_node_children(target, flags); node->next && node->next->parent == node->parent; node = node->next) {}
         } else if (target->nodetype == LYS_CHOICE) {
             /* to pass when statement, we need the last case no matter if it is explicit or implicit case */
-            node = ((struct lysc_node_choice*)target)->cases->prev;
+            node = ((struct lysc_node_choice *)target)->cases->prev;
         } else {
             /* the compiled node is the last child of the target */
-            node = (struct lysc_node*)lysc_node_children(target, flags);
+            node = (struct lysc_node *)lysc_node_children(target, flags);
             if (!node) {
                 /* there is no data children (compiled nodes is e.g. notification or action or nothing) */
                 break;
@@ -4470,15 +4470,15 @@
     ctx->options |= flags;
     switch (target->nodetype) {
     case LYS_CONTAINER:
-        COMPILE_ARRAY1_GOTO(ctx, aug_p->actions, ((struct lysc_node_container*)target)->actions, target,
+        COMPILE_ARRAY1_GOTO(ctx, aug_p->actions, ((struct lysc_node_container *)target)->actions, target,
                             u, lys_compile_action, 0, ret, error);
-        COMPILE_ARRAY1_GOTO(ctx, aug_p->notifs, ((struct lysc_node_container*)target)->notifs, target,
+        COMPILE_ARRAY1_GOTO(ctx, aug_p->notifs, ((struct lysc_node_container *)target)->notifs, target,
                             u, lys_compile_notif, 0, ret, error);
         break;
     case LYS_LIST:
-        COMPILE_ARRAY1_GOTO(ctx, aug_p->actions, ((struct lysc_node_list*)target)->actions, target,
+        COMPILE_ARRAY1_GOTO(ctx, aug_p->actions, ((struct lysc_node_list *)target)->actions, target,
                             u, lys_compile_action, 0, ret, error);
-        COMPILE_ARRAY1_GOTO(ctx, aug_p->notifs, ((struct lysc_node_list*)target)->notifs, target,
+        COMPILE_ARRAY1_GOTO(ctx, aug_p->notifs, ((struct lysc_node_list *)target)->notifs, target,
                             u, lys_compile_notif, 0, ret, error);
         break;
     default:
@@ -4596,7 +4596,7 @@
         .module = ctx->mod,
         .flags = parent ? parent->flags : 0,
         .child = NULL, .next = NULL,
-        .prev = (struct lysc_node*)&context_node_fake,
+        .prev = (struct lysc_node *)&context_node_fake,
         .actions = NULL, .notifs = NULL};
     struct lysp_grp *grp = NULL;
     LY_ARRAY_COUNT_TYPE u, v;
@@ -4632,7 +4632,7 @@
     }
     if (mod == ctx->mod_def) {
         for (node_p = uses_p->parent; !found && node_p; node_p = node_p->parent) {
-            grp = (struct lysp_grp*)lysp_node_groupings(node_p);
+            grp = (struct lysp_grp *)lysp_node_groupings(node_p);
             LY_ARRAY_FOR(grp, u) {
                 if (!strcmp(grp[u].name, name)) {
                     grp = &grp[u];
@@ -4676,7 +4676,7 @@
 
     /* grouping must not reference themselves - stack in ctx maintains list of groupings currently being applied */
     grp_stack_count = ctx->groupings.count;
-    ly_set_add(&ctx->groupings, (void*)grp, 0);
+    ly_set_add(&ctx->groupings, (void *)grp, 0);
     if (grp_stack_count == ctx->groupings.count) {
         /* the target grouping is already in the stack, so we are already inside it -> circular dependency */
         LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
@@ -4699,9 +4699,9 @@
      * applu refine and augment only to the nodes from the uses */
     if (parent) {
         if (parent->nodetype == LYS_CASE) {
-            child = (struct lysc_node*)lysc_node_children(parent->parent, ctx->options & LYSC_OPT_RPC_MASK);
+            child = (struct lysc_node *)lysc_node_children(parent->parent, ctx->options & LYSC_OPT_RPC_MASK);
         } else {
-            child = (struct lysc_node*)lysc_node_children(parent, ctx->options & LYSC_OPT_RPC_MASK);
+            child = (struct lysc_node *)lysc_node_children(parent, ctx->options & LYSC_OPT_RPC_MASK);
         }
     } else if (ctx->mod->compiled->data) {
         child = ctx->mod->compiled->data;
@@ -4723,7 +4723,7 @@
     if (child) {
         context_node_fake.child = child->next;
     } else if (parent) {
-        context_node_fake.child = (struct lysc_node*)lysc_node_children(parent, ctx->options & LYSC_OPT_RPC_MASK);
+        context_node_fake.child = (struct lysc_node *)lysc_node_children(parent, ctx->options & LYSC_OPT_RPC_MASK);
     } else if (ctx->mod->compiled->data) {
         context_node_fake.child = ctx->mod->compiled->data;
     }
@@ -4735,7 +4735,7 @@
 
     when_shared = NULL;
     LY_LIST_FOR(context_node_fake.child, iter) {
-        iter->parent = (struct lysc_node*)&context_node_fake;
+        iter->parent = (struct lysc_node *)&context_node_fake;
 
         /* pass uses's when to all the data children, actions and notifications are ignored */
         if (uses_p->when) {
@@ -4790,7 +4790,7 @@
     /* sort and apply augments */
     LY_CHECK_GOTO(lys_compile_augment_sort(ctx, uses_p->augments, NULL, &augments), cleanup);
     LY_ARRAY_FOR(augments, u) {
-        LY_CHECK_GOTO(lys_compile_augment(ctx, augments[u], (struct lysc_node*)&context_node_fake), cleanup);
+        LY_CHECK_GOTO(lys_compile_augment(ctx, augments[u], (struct lysc_node *)&context_node_fake), cleanup);
     }
 
     /* reload previous context's mod_def */
@@ -4801,8 +4801,8 @@
     LY_ARRAY_FOR(uses_p->refines, struct lysp_refine, rfn) {
         lysc_update_path(ctx, NULL, rfn->nodeid);
 
-        LY_CHECK_GOTO(lysc_resolve_schema_nodeid(ctx, rfn->nodeid, 0, (struct lysc_node*)&context_node_fake, ctx->mod,
-                                                0, 0, (const struct lysc_node**)&node, &flags),
+        LY_CHECK_GOTO(lysc_resolve_schema_nodeid(ctx, rfn->nodeid, 0, (struct lysc_node *)&context_node_fake, ctx->mod,
+                                                0, 0, (const struct lysc_node **)&node, &flags),
                       cleanup);
         ly_set_add(&refined, node, LY_SET_OPT_USEASLIST);
 
@@ -4837,11 +4837,11 @@
                                                               ctx->mod_def), cleanup);
                 node->flags |= LYS_SET_DFLT;
             } else if (node->nodetype == LYS_CHOICE) {
-                if (((struct lysc_node_choice*)node)->dflt) {
+                if (((struct lysc_node_choice *)node)->dflt) {
                     /* unset LYS_SET_DFLT from the current default case */
-                    ((struct lysc_node_choice*)node)->dflt->flags &= ~LYS_SET_DFLT;
+                    ((struct lysc_node_choice *)node)->dflt->flags &= ~LYS_SET_DFLT;
                 }
-                LY_CHECK_GOTO(lys_compile_node_choice_dflt(ctx, rfn->dflts[0], (struct lysc_node_choice*)node), cleanup);
+                LY_CHECK_GOTO(lys_compile_node_choice_dflt(ctx, rfn->dflts[0], (struct lysc_node_choice *)node), cleanup);
             }
         }
 
@@ -4887,20 +4887,20 @@
         if (rfn->musts) {
             switch (node->nodetype) {
             case LYS_LEAF:
-                COMPILE_ARRAY_GOTO(ctx, rfn->musts, ((struct lysc_node_leaf*)node)->musts, u, lys_compile_must, ret, cleanup);
+                COMPILE_ARRAY_GOTO(ctx, rfn->musts, ((struct lysc_node_leaf *)node)->musts, u, lys_compile_must, ret, cleanup);
                 break;
             case LYS_LEAFLIST:
-                COMPILE_ARRAY_GOTO(ctx, rfn->musts, ((struct lysc_node_leaflist*)node)->musts, u, lys_compile_must, ret, cleanup);
+                COMPILE_ARRAY_GOTO(ctx, rfn->musts, ((struct lysc_node_leaflist *)node)->musts, u, lys_compile_must, ret, cleanup);
                 break;
             case LYS_LIST:
-                COMPILE_ARRAY_GOTO(ctx, rfn->musts, ((struct lysc_node_list*)node)->musts, u, lys_compile_must, ret, cleanup);
+                COMPILE_ARRAY_GOTO(ctx, rfn->musts, ((struct lysc_node_list *)node)->musts, u, lys_compile_must, ret, cleanup);
                 break;
             case LYS_CONTAINER:
-                COMPILE_ARRAY_GOTO(ctx, rfn->musts, ((struct lysc_node_container*)node)->musts, u, lys_compile_must, ret, cleanup);
+                COMPILE_ARRAY_GOTO(ctx, rfn->musts, ((struct lysc_node_container *)node)->musts, u, lys_compile_must, ret, cleanup);
                 break;
             case LYS_ANYXML:
             case LYS_ANYDATA:
-                COMPILE_ARRAY_GOTO(ctx, rfn->musts, ((struct lysc_node_anydata*)node)->musts, u, lys_compile_must, ret, cleanup);
+                COMPILE_ARRAY_GOTO(ctx, rfn->musts, ((struct lysc_node_anydata *)node)->musts, u, lys_compile_must, ret, cleanup);
                 break;
             default:
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS,
@@ -4916,10 +4916,10 @@
             switch (node->nodetype) {
             case LYS_LEAFLIST:
                 if (rfn->flags & LYS_SET_MAX) {
-                    ((struct lysc_node_leaflist*)node)->max = rfn->max ? rfn->max : (uint32_t)-1;
+                    ((struct lysc_node_leaflist *)node)->max = rfn->max ? rfn->max : (uint32_t)-1;
                 }
                 if (rfn->flags & LYS_SET_MIN) {
-                    ((struct lysc_node_leaflist*)node)->min = rfn->min;
+                    ((struct lysc_node_leaflist *)node)->min = rfn->min;
                     if (rfn->min) {
                         node->flags |= LYS_MAND_TRUE;
                         lys_compile_mandatory_parents(node->parent, 1);
@@ -4931,10 +4931,10 @@
                 break;
             case LYS_LIST:
                 if (rfn->flags & LYS_SET_MAX) {
-                    ((struct lysc_node_list*)node)->max = rfn->max ? rfn->max : (uint32_t)-1;
+                    ((struct lysc_node_list *)node)->max = rfn->max ? rfn->max : (uint32_t)-1;
                 }
                 if (rfn->flags & LYS_SET_MIN) {
-                    ((struct lysc_node_list*)node)->min = rfn->min;
+                    ((struct lysc_node_list *)node)->min = rfn->min;
                     if (rfn->min) {
                         node->flags |= LYS_MAND_TRUE;
                         lys_compile_mandatory_parents(node->parent, 1);
@@ -4963,13 +4963,13 @@
 
     /* do some additional checks of the changed nodes when all the refines are applied */
     for (uint32_t i = 0; i < refined.count; ++i) {
-        node = (struct lysc_node*)refined.objs[i];
+        node = (struct lysc_node *)refined.objs[i];
         rfn = &uses_p->refines[i];
         lysc_update_path(ctx, NULL, rfn->nodeid);
 
         /* check possible conflict with default value (default added, mandatory left true) */
         if ((node->flags & LYS_MAND_TRUE) &&
-                (((node->nodetype & LYS_CHOICE) && ((struct lysc_node_choice*)node)->dflt) ||
+                (((node->nodetype & LYS_CHOICE) && ((struct lysc_node_choice *)node)->dflt) ||
                 ((node->nodetype & LYS_LEAF) && (node->flags & LYS_SET_DFLT)))) {
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS,
                    "Invalid refine of default - the node is mandatory.");
@@ -4978,11 +4978,11 @@
 
         if (rfn->flags & (LYS_SET_MAX | LYS_SET_MIN)) {
             if (node->nodetype == LYS_LIST) {
-                min = ((struct lysc_node_list*)node)->min;
-                max = ((struct lysc_node_list*)node)->max;
+                min = ((struct lysc_node_list *)node)->min;
+                max = ((struct lysc_node_list *)node)->max;
             } else {
-                min = ((struct lysc_node_leaflist*)node)->min;
-                max = ((struct lysc_node_leaflist*)node)->max;
+                min = ((struct lysc_node_leaflist *)node)->min;
+                max = ((struct lysc_node_leaflist *)node)->max;
             }
             if (min > max) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS,
@@ -5104,7 +5104,7 @@
         .flags = node_p ? (node_p->flags & LYS_FLAGS_COMPILED_MASK) : 0,
         .module = ctx->mod,
         .sp = NULL, .parent = NULL, .next = NULL,
-        .prev = (struct lysc_node*)&fake_container,
+        .prev = (struct lysc_node *)&fake_container,
         .name = "fake",
         .dsc = NULL, .ref = NULL, .exts = NULL, .iffeatures = NULL, .when = NULL,
         .child = NULL, .musts = NULL, .actions = NULL, .notifs = NULL
@@ -5125,7 +5125,7 @@
 
     lysc_update_path(ctx, NULL, "{grouping}");
     lysc_update_path(ctx, NULL, grp->name);
-    ret = lys_compile_uses(ctx, &fake_uses, (struct lysc_node*)&fake_container, NULL);
+    ret = lys_compile_uses(ctx, &fake_uses, (struct lysc_node *)&fake_container, NULL);
     lysc_update_path(ctx, NULL, NULL);
     lysc_update_path(ctx, NULL, NULL);
 
@@ -5157,7 +5157,7 @@
     struct lysc_node_case *cs = NULL;
     struct lysc_when **when;
     unsigned int u;
-    LY_ERR (*node_compile_spec)(struct lysc_ctx*, struct lysp_node*, struct lysc_node*);
+    LY_ERR (*node_compile_spec)(struct lysc_ctx *, struct lysp_node *, struct lysc_node *);
 
     if (node_p->nodetype != LYS_USES) {
         lysc_update_path(ctx, parent, node_p->name);
@@ -5168,39 +5168,39 @@
 
     switch (node_p->nodetype) {
     case LYS_CONTAINER:
-        node = (struct lysc_node*)calloc(1, sizeof(struct lysc_node_container));
+        node = (struct lysc_node *)calloc(1, sizeof(struct lysc_node_container));
         node_compile_spec = lys_compile_node_container;
         break;
     case LYS_LEAF:
-        node = (struct lysc_node*)calloc(1, sizeof(struct lysc_node_leaf));
+        node = (struct lysc_node *)calloc(1, sizeof(struct lysc_node_leaf));
         node_compile_spec = lys_compile_node_leaf;
         break;
     case LYS_LIST:
-        node = (struct lysc_node*)calloc(1, sizeof(struct lysc_node_list));
+        node = (struct lysc_node *)calloc(1, sizeof(struct lysc_node_list));
         node_compile_spec = lys_compile_node_list;
         break;
     case LYS_LEAFLIST:
-        node = (struct lysc_node*)calloc(1, sizeof(struct lysc_node_leaflist));
+        node = (struct lysc_node *)calloc(1, sizeof(struct lysc_node_leaflist));
         node_compile_spec = lys_compile_node_leaflist;
         break;
     case LYS_CHOICE:
-        node = (struct lysc_node*)calloc(1, sizeof(struct lysc_node_choice));
+        node = (struct lysc_node *)calloc(1, sizeof(struct lysc_node_choice));
         node_compile_spec = lys_compile_node_choice;
         break;
     case LYS_ANYXML:
     case LYS_ANYDATA:
-        node = (struct lysc_node*)calloc(1, sizeof(struct lysc_node_anydata));
+        node = (struct lysc_node *)calloc(1, sizeof(struct lysc_node_anydata));
         node_compile_spec = lys_compile_node_any;
         break;
     case LYS_USES:
         if (parent && parent->nodetype == LYS_CHOICE) {
             assert(node_p->parent->nodetype == LYS_CASE);
             lysc_update_path(ctx, parent, node_p->parent->name);
-            cs = lys_compile_node_case(ctx, node_p->parent, (struct lysc_node_choice*)parent, NULL);
+            cs = lys_compile_node_case(ctx, node_p->parent, (struct lysc_node_choice *)parent, NULL);
             LY_CHECK_ERR_GOTO(!cs, ret = LY_EVALID, error);
         }
 
-        ret = lys_compile_uses(ctx, (struct lysp_node_uses*)node_p, cs ? (struct lysc_node*)cs : parent, &node);
+        ret = lys_compile_uses(ctx, (struct lysp_node_uses *)node_p, cs ? (struct lysc_node *)cs : parent, &node);
         if (cs) {
             cs->child = node;
             lysc_update_path(ctx, NULL, NULL);
@@ -5305,14 +5305,14 @@
             } else {
                 lysc_update_path(ctx, parent, node->name);
             }
-            cs = lys_compile_node_case(ctx, node_p->parent, (struct lysc_node_choice*)parent, node);
+            cs = lys_compile_node_case(ctx, node_p->parent, (struct lysc_node_choice *)parent, node);
             LY_CHECK_ERR_GOTO(!cs, ret = LY_EVALID, error);
             if (uses_status) {}
             /* the postponed status check of the node and its real parent - in case of implicit case,
              * it directly gets the same status flags as the choice;
              * uses_status cannot be applied here since uses cannot be child statement of choice */
             LY_CHECK_GOTO(ret = lys_compile_status(ctx, &node->flags, cs->flags), error);
-            node->parent = (struct lysc_node*)cs;
+            node->parent = (struct lysc_node *)cs;
             lysc_update_path(ctx, parent, node->name);
         } else { /* other than choice */
             lysc_update_path(ctx, parent, node->name);
@@ -5360,15 +5360,15 @@
 
     /* parent's first child */
     if (parent && parent->nodetype == LYS_CHOICE) {
-        cs = (struct lysc_node_case*)node;
+        cs = (struct lysc_node_case *)node;
     } else if (parent && parent->nodetype == LYS_CASE) {
         /* disconnecting some node in a case */
-        cs = (struct lysc_node_case*)parent;
+        cs = (struct lysc_node_case *)parent;
         parent = cs->parent;
-        for (child = cs->child; child && child->parent == (struct lysc_node*)cs; child = child->next) {
+        for (child = cs->child; child && child->parent == (struct lysc_node *)cs; child = child->next) {
             if (child == node) {
                 if (cs->child == child) {
-                    if (!child->next || child->next->parent != (struct lysc_node*)cs) {
+                    if (!child->next || child->next->parent != (struct lysc_node *)cs) {
                         /* case with a single child -> remove also the case */
                         child->parent = NULL;
                         remove_cs = 1;
@@ -5390,24 +5390,24 @@
     if (cs) {
         if (remove_cs) {
             /* cs has only one child which is being also removed */
-            lysc_disconnect((struct lysc_node*)cs);
-            lysc_node_free(cs->module->ctx, (struct lysc_node*)cs);
+            lysc_disconnect((struct lysc_node *)cs);
+            lysc_node_free(cs->module->ctx, (struct lysc_node *)cs);
         } else {
-            if (((struct lysc_node_choice*)parent)->dflt == cs) {
+            if (((struct lysc_node_choice *)parent)->dflt == cs) {
                 /* default case removed */
-                ((struct lysc_node_choice*)parent)->dflt = NULL;
+                ((struct lysc_node_choice *)parent)->dflt = NULL;
             }
-            if (((struct lysc_node_choice*)parent)->cases == cs) {
+            if (((struct lysc_node_choice *)parent)->cases == cs) {
                 /* first case removed */
-                ((struct lysc_node_choice*)parent)->cases = (struct lysc_node_case*)cs->next;
+                ((struct lysc_node_choice *)parent)->cases = (struct lysc_node_case *)cs->next;
             }
             if (cs->child) {
                 /* cs will be removed and disconnected from its siblings, but we have to take care also about its children */
-                if (cs->child->prev->parent != (struct lysc_node*)cs) {
+                if (cs->child->prev->parent != (struct lysc_node *)cs) {
                     prev = cs->child->prev;
                 } /* else all the children are under a single case */
                 LY_LIST_FOR_SAFE(cs->child, next, child) {
-                    if (child->parent != (struct lysc_node*)cs) {
+                    if (child->parent != (struct lysc_node *)cs) {
                         break;
                     }
                     lysc_node_free(node->module->ctx, child);
@@ -5420,7 +5420,7 @@
                         child->prev = prev;
                     } else {
                         /* link from the first child under the cases */
-                        ((struct lysc_node_choice*)cs->parent)->cases->child->prev = prev;
+                        ((struct lysc_node_choice *)cs->parent)->cases->child->prev = prev;
                     }
                 }
             }
@@ -5435,22 +5435,22 @@
         node->next->prev = node->prev;
     } else if (node->nodetype != LYS_CASE) {
         if (parent) {
-            child = (struct lysc_node*)lysc_node_children(parent, node->flags);
+            child = (struct lysc_node *)lysc_node_children(parent, node->flags);
         } else {
             child = modc->data;
         }
         if (child) {
             child->prev = node->prev;
         }
-    } else if (((struct lysc_node_choice*)parent)->cases) {
-        ((struct lysc_node_choice*)parent)->cases->prev = node->prev;
+    } else if (((struct lysc_node_choice *)parent)->cases) {
+        ((struct lysc_node_choice *)parent)->cases->prev = node->prev;
     }
 }
 
 struct lysc_deviation {
     const char *nodeid;
     struct lysc_node *target;      /* target node of the deviation */
-    struct lysp_deviate** deviates;/* sized array of pointers to parsed deviate statements to apply on target */
+    struct lysp_deviate **deviates;/* sized array of pointers to parsed deviate statements to apply on target */
     uint16_t flags;                /* target's flags from lysc_resolve_schema_nodeid() */
     uint8_t not_supported;         /* flag if deviates contains not-supported deviate */
 };
@@ -5658,11 +5658,11 @@
         if (target->nodetype == LYS_LEAFLIST) {
             DEV_CHECK_NONPRESENCE_UINT(struct lysc_node_leaflist *, > 0, min, "min-elements");
             /* change value */
-            ((struct lysc_node_leaflist*)target)->min = d->min;
+            ((struct lysc_node_leaflist *)target)->min = d->min;
         } else if (target->nodetype == LYS_LIST) {
             DEV_CHECK_NONPRESENCE_UINT(struct lysc_node_list *, > 0, min, "min-elements");
             /* change value */
-            ((struct lysc_node_list*)target)->min = d->min;
+            ((struct lysc_node_list *)target)->min = d->min;
         } else {
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LY_VCODE_DEV_NODETYPE,
                     lys_nodetype2str(target->nodetype), "add", "min-elements");
@@ -5678,11 +5678,11 @@
         if (target->nodetype == LYS_LEAFLIST) {
             DEV_CHECK_NONPRESENCE_UINT(struct lysc_node_leaflist *, < (uint32_t)-1, max, "max-elements");
             /* change value */
-            ((struct lysc_node_leaflist*)target)->max = d->max ? d->max : (uint32_t)-1;
+            ((struct lysc_node_leaflist *)target)->max = d->max ? d->max : (uint32_t)-1;
         } else if (target->nodetype == LYS_LIST) {
             DEV_CHECK_NONPRESENCE_UINT(struct lysc_node_list *, < (uint32_t)-1, max, "max-elements");
             /* change value */
-            ((struct lysc_node_list*)target)->max = d->max ? d->max : (uint32_t)-1;
+            ((struct lysc_node_list *)target)->max = d->max ? d->max : (uint32_t)-1;
         } else {
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LY_VCODE_DEV_NODETYPE,
                     lys_nodetype2str(target->nodetype), "add", "max-elements");
@@ -5899,15 +5899,15 @@
     /* [units-stmt] */
     if (d->units) {
         DEV_CHECK_NODETYPE(LYS_LEAF | LYS_LEAFLIST, "delete", "units");
-        DEV_CHECK_PRESENCE(struct lysc_node_leaf*, 0, units, "deleting", "units", d->units);
-        if (strcmp(((struct lysc_node_leaf*)target)->units, d->units)) {
+        DEV_CHECK_PRESENCE(struct lysc_node_leaf *, 0, units, "deleting", "units", d->units);
+        if (strcmp(((struct lysc_node_leaf *)target)->units, d->units)) {
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
                     "Invalid deviation deleting \"units\" property \"%s\" which does not match the target's property value \"%s\".",
-                    d->units, ((struct lysc_node_leaf*)target)->units);
+                    d->units, ((struct lysc_node_leaf *)target)->units);
             goto cleanup;
         }
-        lydict_remove(ctx->ctx, ((struct lysc_node_leaf*)target)->units);
-        ((struct lysc_node_leaf*)target)->units = NULL;
+        lydict_remove(ctx->ctx, ((struct lysc_node_leaf *)target)->units);
+        ((struct lysc_node_leaf *)target)->units = NULL;
     }
 
     /* *must-stmt */
@@ -5915,23 +5915,23 @@
         switch (target->nodetype) {
         case LYS_CONTAINER:
         case LYS_LIST:
-            DEV_DEL_ARRAY(struct lysc_node_container*, musts, musts, .arg, .cond->expr, &, lysc_must_free, "must");
+            DEV_DEL_ARRAY(struct lysc_node_container *, musts, musts, .arg, .cond->expr, &, lysc_must_free, "must");
             break;
         case LYS_LEAF:
         case LYS_LEAFLIST:
         case LYS_ANYDATA:
-            DEV_DEL_ARRAY(struct lysc_node_leaf*, musts, musts, .arg, .cond->expr, &, lysc_must_free, "must");
+            DEV_DEL_ARRAY(struct lysc_node_leaf *, musts, musts, .arg, .cond->expr, &, lysc_must_free, "must");
             break;
         case LYS_NOTIF:
-            DEV_DEL_ARRAY(struct lysc_notif*, musts, musts, .arg, .cond->expr, &, lysc_must_free, "must");
+            DEV_DEL_ARRAY(struct lysc_notif *, musts, musts, .arg, .cond->expr, &, lysc_must_free, "must");
             break;
         case LYS_RPC:
         case LYS_ACTION:
             if (dev_flags & LYSC_OPT_RPC_INPUT) {
-                DEV_DEL_ARRAY(struct lysc_action*, input.musts, musts, .arg, .cond->expr, &, lysc_must_free, "must");
+                DEV_DEL_ARRAY(struct lysc_action *, input.musts, musts, .arg, .cond->expr, &, lysc_must_free, "must");
                 break;
             } else if (dev_flags & LYSC_OPT_RPC_OUTPUT) {
-                DEV_DEL_ARRAY(struct lysc_action*, output.musts, musts, .arg, .cond->expr, &, lysc_must_free, "must");
+                DEV_DEL_ARRAY(struct lysc_action *, output.musts, musts, .arg, .cond->expr, &, lysc_must_free, "must");
                 break;
             }
         /* fall through */
@@ -5996,7 +5996,7 @@
             break;
         case LYS_CHOICE:
             DEV_CHECK_CARDINALITY(d->dflts, 1, "default");
-            DEV_CHECK_PRESENCE(struct lysc_node_choice*, 0, dflt, "deleting", "default", d->dflts[0]);
+            DEV_CHECK_PRESENCE(struct lysc_node_choice *, 0, dflt, "deleting", "default", d->dflts[0]);
             nodeid = d->dflts[0];
             LY_CHECK_GOTO(ly_parse_nodeid(&nodeid, &prefix, &prefix_len, &name, &name_len), cleanup);
             if (prefix) {
@@ -6007,7 +6007,7 @@
                             "The prefix does not match any imported module of the deviation module.", d->dflts[0]);
                     goto cleanup;
                 }
-                if (mod != ((struct lysc_node_choice*)target)->dflt->module) {
+                if (mod != ((struct lysc_node_choice *)target)->dflt->module) {
                     LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
                             "Invalid deviation deleting \"default\" property \"%s\" of choice. "
                             "The prefix does not match the default case's module.", d->dflts[0]);
@@ -6018,14 +6018,14 @@
              * strictly, the default prefix would point to the deviation module, but the value should actually
              * match the default string in the original module (usually unprefixed), so in this case we do not check
              * the module of the default case, just matching its name */
-            if (strcmp(name, ((struct lysc_node_choice*)target)->dflt->name)) {
+            if (strcmp(name, ((struct lysc_node_choice *)target)->dflt->name)) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
                         "Invalid deviation deleting \"default\" property \"%s\" of choice does not match the default case name \"%s\".",
-                        d->dflts[0], ((struct lysc_node_choice*)target)->dflt->name);
+                        d->dflts[0], ((struct lysc_node_choice *)target)->dflt->name);
                 goto cleanup;
             }
-            ((struct lysc_node_choice*)target)->dflt->flags &= ~LYS_SET_DFLT;
-            ((struct lysc_node_choice*)target)->dflt = NULL;
+            ((struct lysc_node_choice *)target)->dflt->flags &= ~LYS_SET_DFLT;
+            ((struct lysc_node_choice *)target)->dflt = NULL;
             break;
         default:
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LY_VCODE_DEV_NODETYPE,
@@ -6399,7 +6399,7 @@
         LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS,
                 "Invalid deviation combining default value and mandatory %s.", lys_nodetype2str(target->nodetype));
         goto cleanup;
-    } else if ((target->nodetype & LYS_CHOICE) && ((struct lysc_node_choice*)target)->dflt
+    } else if ((target->nodetype & LYS_CHOICE) && ((struct lysc_node_choice *)target)->dflt
             && (target->flags & LYS_MAND_TRUE)) {
         LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS, "Invalid deviation combining default case and mandatory choice.");
         goto cleanup;
@@ -6459,17 +6459,17 @@
 
         /* resolve the target */
         LY_CHECK_GOTO(lysc_resolve_schema_nodeid(ctx, dev->nodeid, 0, NULL, ctx->mod, 0, 1,
-                (const struct lysc_node**)&target, &flags), cleanup);
+                (const struct lysc_node **)&target, &flags), cleanup);
         if (target->nodetype & (LYS_RPC | LYS_ACTION)) {
             /* move the target pointer to input/output to make them different from the action and
              * between them. Before the devs[] item is being processed, the target pointer must be fixed
              * back to the RPC/action node due to a better compatibility and decision code in this function.
              * The LYSC_OPT_INTERNAL is used as a flag to this change. */
             if (flags & LYSC_OPT_RPC_INPUT) {
-                target = (struct lysc_node*)&((struct lysc_action*)target)->input;
+                target = (struct lysc_node *)&((struct lysc_action *)target)->input;
                 flags |= LYSC_OPT_INTERNAL;
             } else if (flags & LYSC_OPT_RPC_OUTPUT) {
-                target = (struct lysc_node*)&((struct lysc_action*)target)->output;
+                target = (struct lysc_node *)&((struct lysc_action *)target)->output;
                 flags |= LYSC_OPT_INTERNAL;
             }
         }
@@ -6661,21 +6661,21 @@
 
                     if (substmts[u].cardinality < LY_STMT_CARD_SOME) {
                         /* single item */
-                        if (*(struct lysc_type**)substmts[u].storage) {
+                        if (*(struct lysc_type **)substmts[u].storage) {
                             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LY_VCODE_DUPSTMT, stmt->stmt);
                             goto cleanup;
                         }
                         compiled = substmts[u].storage;
                     } else {
                         /* sized array */
-                        struct lysc_type ***types = (struct lysc_type***)substmts[u].storage, **type = NULL;
+                        struct lysc_type ***types = (struct lysc_type ***)substmts[u].storage, **type = NULL;
                         LY_ARRAY_NEW_GOTO(ctx->ctx, *types, type, ret, cleanup);
-                        compiled = (void*)type;
+                        compiled = (void *)type;
                     }
 
                     LY_CHECK_ERR_GOTO(r = lysp_stmt_parse(ctx, stmt, stmt->kw, &parsed, NULL), ret = r, cleanup);
-                    LY_CHECK_ERR_GOTO(r = lys_compile_type(ctx, ext->parent_type == LYEXT_PAR_NODE ? ((struct lysc_node*)ext->parent)->sp : NULL,
-                                      flags ? *flags : 0, ctx->mod_def->parsed, ext->name, parsed, (struct lysc_type**)compiled,
+                    LY_CHECK_ERR_GOTO(r = lys_compile_type(ctx, ext->parent_type == LYEXT_PAR_NODE ? ((struct lysc_node *)ext->parent)->sp : NULL,
+                                      flags ? *flags : 0, ctx->mod_def->parsed, ext->name, parsed, (struct lysc_type **)compiled,
                                       units && !*units ? units : NULL, NULL, NULL), lysp_type_free(ctx->ctx, parsed); free(parsed); ret = r, cleanup);
                     lysp_type_free(ctx->ctx, parsed);
                     free(parsed);
@@ -6686,14 +6686,14 @@
 
                     if (substmts[u].cardinality < LY_STMT_CARD_SOME) {
                         /* single item */
-                        if (((struct lysc_iffeature*)substmts[u].storage)->features) {
+                        if (((struct lysc_iffeature *)substmts[u].storage)->features) {
                             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LY_VCODE_DUPSTMT, stmt->stmt);
                             goto cleanup;
                         }
-                        iff = (struct lysc_iffeature*)substmts[u].storage;
+                        iff = (struct lysc_iffeature *)substmts[u].storage;
                     } else {
                         /* sized array */
-                        struct lysc_iffeature **iffs = (struct lysc_iffeature**)substmts[u].storage;
+                        struct lysc_iffeature **iffs = (struct lysc_iffeature **)substmts[u].storage;
                         LY_ARRAY_NEW_GOTO(ctx->ctx, *iffs, iff, ret, cleanup);
                     }
                     LY_CHECK_ERR_GOTO(r = lys_compile_iffeature(ctx, &stmt->arg, iff), ret = r, cleanup);
@@ -7207,17 +7207,17 @@
         /* store pointer to the real type */
         type = ((struct lysc_node_leaf *)ctx->leafrefs.objs[i])->type;
         if (type->basetype == LY_TYPE_LEAFREF) {
-            for (typeiter = ((struct lysc_type_leafref*)type)->realtype;
+            for (typeiter = ((struct lysc_type_leafref *)type)->realtype;
                     typeiter->basetype == LY_TYPE_LEAFREF;
-                    typeiter = ((struct lysc_type_leafref*)typeiter)->realtype) {}
-            ((struct lysc_type_leafref*)type)->realtype = typeiter;
+                    typeiter = ((struct lysc_type_leafref *)typeiter)->realtype) {}
+            ((struct lysc_type_leafref *)type)->realtype = typeiter;
         } else if (type->basetype == LY_TYPE_UNION) {
-            LY_ARRAY_FOR(((struct lysc_type_union*)type)->types, v) {
-                if (((struct lysc_type_union*)type)->types[v]->basetype == LY_TYPE_LEAFREF) {
-                    for (typeiter = ((struct lysc_type_leafref*)((struct lysc_type_union*)type)->types[v])->realtype;
+            LY_ARRAY_FOR(((struct lysc_type_union *)type)->types, v) {
+                if (((struct lysc_type_union *)type)->types[v]->basetype == LY_TYPE_LEAFREF) {
+                    for (typeiter = ((struct lysc_type_leafref *)((struct lysc_type_union *)type)->types[v])->realtype;
                             typeiter->basetype == LY_TYPE_LEAFREF;
-                            typeiter = ((struct lysc_type_leafref*)typeiter)->realtype) {}
-                    ((struct lysc_type_leafref*)((struct lysc_type_union*)type)->types[v])->realtype = typeiter;
+                            typeiter = ((struct lysc_type_leafref *)typeiter)->realtype) {}
+                    ((struct lysc_type_leafref *)((struct lysc_type_union *)type)->types[v])->realtype = typeiter;
                 }
             }
         }
@@ -7368,7 +7368,7 @@
         }
     }
     LY_LIST_FOR(sp->data, node_p) {
-        grps = (struct lysp_grp*)lysp_node_groupings(node_p);
+        grps = (struct lysp_grp *)lysp_node_groupings(node_p);
         LY_ARRAY_FOR(grps, u) {
             if (!(grps[u].flags & LYS_USED_GRP)) {
                 LY_CHECK_GOTO(ret = lys_compile_grouping(&ctx, node_p, &grps[u]), error);
diff --git a/src/tree_schema_free.c b/src/tree_schema_free.c
index 940a9a5..3259bd6 100644
--- a/src/tree_schema_free.c
+++ b/src/tree_schema_free.c
@@ -272,8 +272,8 @@
 void
 lysp_deviate_free(struct ly_ctx *ctx, struct lysp_deviate *d)
 {
-    struct lysp_deviate_add *add = (struct lysp_deviate_add*)d;
-    struct lysp_deviate_rpl *rpl = (struct lysp_deviate_rpl*)d;
+    struct lysp_deviate_add *add = (struct lysp_deviate_add *)d;
+    struct lysp_deviate_rpl *rpl = (struct lysp_deviate_rpl *)d;
 
     FREE_ARRAY(ctx, d->exts, lysp_ext_instance_free);
     switch (d->mod) {
@@ -340,58 +340,58 @@
 
     switch (node->nodetype) {
     case LYS_CONTAINER:
-        FREE_ARRAY(ctx, ((struct lysp_node_container*)node)->musts, lysp_restr_free);
-        FREE_STRING(ctx, ((struct lysp_node_container*)node)->presence);
-        FREE_ARRAY(ctx, ((struct lysp_node_container*)node)->typedefs, lysp_tpdf_free);
-        FREE_ARRAY(ctx, ((struct lysp_node_container*)node)->groupings, lysp_grp_free);
-        LY_LIST_FOR_SAFE(((struct lysp_node_container*)node)->child, next, child) {
+        FREE_ARRAY(ctx, ((struct lysp_node_container *)node)->musts, lysp_restr_free);
+        FREE_STRING(ctx, ((struct lysp_node_container *)node)->presence);
+        FREE_ARRAY(ctx, ((struct lysp_node_container *)node)->typedefs, lysp_tpdf_free);
+        FREE_ARRAY(ctx, ((struct lysp_node_container *)node)->groupings, lysp_grp_free);
+        LY_LIST_FOR_SAFE(((struct lysp_node_container *)node)->child, next, child) {
             lysp_node_free(ctx, child);
         }
-        FREE_ARRAY(ctx, ((struct lysp_node_container*)node)->actions, lysp_action_free);
-        FREE_ARRAY(ctx, ((struct lysp_node_container*)node)->notifs, lysp_notif_free);
+        FREE_ARRAY(ctx, ((struct lysp_node_container *)node)->actions, lysp_action_free);
+        FREE_ARRAY(ctx, ((struct lysp_node_container *)node)->notifs, lysp_notif_free);
         break;
     case LYS_LEAF:
-        FREE_ARRAY(ctx, ((struct lysp_node_leaf*)node)->musts, lysp_restr_free);
-        lysp_type_free(ctx, &((struct lysp_node_leaf*)node)->type);
-        FREE_STRING(ctx, ((struct lysp_node_leaf*)node)->units);
-        FREE_STRING(ctx, ((struct lysp_node_leaf*)node)->dflt);
+        FREE_ARRAY(ctx, ((struct lysp_node_leaf *)node)->musts, lysp_restr_free);
+        lysp_type_free(ctx, &((struct lysp_node_leaf *)node)->type);
+        FREE_STRING(ctx, ((struct lysp_node_leaf *)node)->units);
+        FREE_STRING(ctx, ((struct lysp_node_leaf *)node)->dflt);
         break;
     case LYS_LEAFLIST:
-        FREE_ARRAY(ctx, ((struct lysp_node_leaflist*)node)->musts, lysp_restr_free);
-        lysp_type_free(ctx, &((struct lysp_node_leaflist*)node)->type);
-        FREE_STRING(ctx, ((struct lysp_node_leaflist*)node)->units);
-        FREE_STRINGS(ctx, ((struct lysp_node_leaflist*)node)->dflts);
+        FREE_ARRAY(ctx, ((struct lysp_node_leaflist *)node)->musts, lysp_restr_free);
+        lysp_type_free(ctx, &((struct lysp_node_leaflist *)node)->type);
+        FREE_STRING(ctx, ((struct lysp_node_leaflist *)node)->units);
+        FREE_STRINGS(ctx, ((struct lysp_node_leaflist *)node)->dflts);
         break;
     case LYS_LIST:
-        FREE_ARRAY(ctx, ((struct lysp_node_list*)node)->musts, lysp_restr_free);
-        FREE_STRING(ctx, ((struct lysp_node_list*)node)->key);
-        FREE_ARRAY(ctx, ((struct lysp_node_list*)node)->typedefs, lysp_tpdf_free);
-        FREE_ARRAY(ctx, ((struct lysp_node_list*)node)->groupings,  lysp_grp_free);
-        LY_LIST_FOR_SAFE(((struct lysp_node_list*)node)->child, next, child) {
+        FREE_ARRAY(ctx, ((struct lysp_node_list *)node)->musts, lysp_restr_free);
+        FREE_STRING(ctx, ((struct lysp_node_list *)node)->key);
+        FREE_ARRAY(ctx, ((struct lysp_node_list *)node)->typedefs, lysp_tpdf_free);
+        FREE_ARRAY(ctx, ((struct lysp_node_list *)node)->groupings,  lysp_grp_free);
+        LY_LIST_FOR_SAFE(((struct lysp_node_list *)node)->child, next, child) {
             lysp_node_free(ctx, child);
         }
-        FREE_ARRAY(ctx, ((struct lysp_node_list*)node)->actions, lysp_action_free);
-        FREE_ARRAY(ctx, ((struct lysp_node_list*)node)->notifs, lysp_notif_free);
-        FREE_STRINGS(ctx, ((struct lysp_node_list*)node)->uniques);
+        FREE_ARRAY(ctx, ((struct lysp_node_list *)node)->actions, lysp_action_free);
+        FREE_ARRAY(ctx, ((struct lysp_node_list *)node)->notifs, lysp_notif_free);
+        FREE_STRINGS(ctx, ((struct lysp_node_list *)node)->uniques);
         break;
     case LYS_CHOICE:
-        LY_LIST_FOR_SAFE(((struct lysp_node_choice*)node)->child, next, child) {
+        LY_LIST_FOR_SAFE(((struct lysp_node_choice *)node)->child, next, child) {
             lysp_node_free(ctx, child);
         }
-        FREE_STRING(ctx, ((struct lysp_node_choice*)node)->dflt);
+        FREE_STRING(ctx, ((struct lysp_node_choice *)node)->dflt);
         break;
     case LYS_CASE:
-        LY_LIST_FOR_SAFE(((struct lysp_node_case*)node)->child, next, child) {
+        LY_LIST_FOR_SAFE(((struct lysp_node_case *)node)->child, next, child) {
             lysp_node_free(ctx, child);
         }
         break;
     case LYS_ANYDATA:
     case LYS_ANYXML:
-        FREE_ARRAY(ctx, ((struct lysp_node_anydata*)node)->musts, lysp_restr_free);
+        FREE_ARRAY(ctx, ((struct lysp_node_anydata *)node)->musts, lysp_restr_free);
         break;
     case LYS_USES:
-        FREE_ARRAY(ctx, ((struct lysp_node_uses*)node)->refines, lysp_refine_free);
-        FREE_ARRAY(ctx, ((struct lysp_node_uses*)node)->augments, lysp_augment_free);
+        FREE_ARRAY(ctx, ((struct lysp_node_uses *)node)->refines, lysp_refine_free);
+        FREE_ARRAY(ctx, ((struct lysp_node_uses *)node)->augments, lysp_augment_free);
         break;
     default:
         LOGINT(ctx);
@@ -601,20 +601,20 @@
 
     switch (type->basetype) {
     case LY_TYPE_BINARY:
-        FREE_MEMBER(ctx, ((struct lysc_type_bin*)type)->length, lysc_range_free);
+        FREE_MEMBER(ctx, ((struct lysc_type_bin *)type)->length, lysc_range_free);
         break;
     case LY_TYPE_BITS:
-        FREE_ARRAY(ctx, (struct lysc_type_bitenum_item*)((struct lysc_type_bits*)type)->bits, lysc_enum_item_free);
+        FREE_ARRAY(ctx, (struct lysc_type_bitenum_item *)((struct lysc_type_bits *)type)->bits, lysc_enum_item_free);
         break;
     case LY_TYPE_DEC64:
-        FREE_MEMBER(ctx, ((struct lysc_type_dec*)type)->range, lysc_range_free);
+        FREE_MEMBER(ctx, ((struct lysc_type_dec *)type)->range, lysc_range_free);
         break;
     case LY_TYPE_STRING:
-        FREE_MEMBER(ctx, ((struct lysc_type_str*)type)->length, lysc_range_free);
-        FREE_ARRAY(ctx, ((struct lysc_type_str*)type)->patterns, lysc_pattern_free);
+        FREE_MEMBER(ctx, ((struct lysc_type_str *)type)->length, lysc_range_free);
+        FREE_ARRAY(ctx, ((struct lysc_type_str *)type)->patterns, lysc_pattern_free);
         break;
     case LY_TYPE_ENUM:
-        FREE_ARRAY(ctx, ((struct lysc_type_enum*)type)->enums, lysc_enum_item_free);
+        FREE_ARRAY(ctx, ((struct lysc_type_enum *)type)->enums, lysc_enum_item_free);
         break;
     case LY_TYPE_INT8:
     case LY_TYPE_UINT8:
@@ -624,16 +624,16 @@
     case LY_TYPE_UINT32:
     case LY_TYPE_INT64:
     case LY_TYPE_UINT64:
-        FREE_MEMBER(ctx, ((struct lysc_type_num*)type)->range, lysc_range_free);
+        FREE_MEMBER(ctx, ((struct lysc_type_num *)type)->range, lysc_range_free);
         break;
     case LY_TYPE_IDENT:
-        LY_ARRAY_FREE(((struct lysc_type_identityref*)type)->bases);
+        LY_ARRAY_FREE(((struct lysc_type_identityref *)type)->bases);
         break;
     case LY_TYPE_UNION:
-        FREE_ARRAY(ctx, ((struct lysc_type_union*)type)->types, lysc_type2_free);
+        FREE_ARRAY(ctx, ((struct lysc_type_union *)type)->types, lysc_type2_free);
         break;
     case LY_TYPE_LEAFREF:
-        lyxp_expr_free(ctx, ((struct lysc_type_leafref*)type)->path);
+        lyxp_expr_free(ctx, ((struct lysc_type_leafref *)type)->path);
         break;
     case LY_TYPE_INST:
     case LY_TYPE_BOOL:
@@ -763,7 +763,7 @@
         LY_LIST_FOR_SAFE(node->cases->child, child_next, child) {
             lysc_node_free(ctx, child);
         }
-        LY_LIST_FOR_SAFE((struct lysc_node*)node->cases, child_next, child) {
+        LY_LIST_FOR_SAFE((struct lysc_node *)node->cases, child_next, child) {
             lysc_node_free(ctx, child);
         }
     }
@@ -786,26 +786,26 @@
     /* nodetype-specific part */
     switch (node->nodetype) {
     case LYS_CONTAINER:
-        lysc_node_container_free(ctx, (struct lysc_node_container*)node);
+        lysc_node_container_free(ctx, (struct lysc_node_container *)node);
         break;
     case LYS_LEAF:
-        lysc_node_leaf_free(ctx, (struct lysc_node_leaf*)node);
+        lysc_node_leaf_free(ctx, (struct lysc_node_leaf *)node);
         break;
     case LYS_LEAFLIST:
-        lysc_node_leaflist_free(ctx, (struct lysc_node_leaflist*)node);
+        lysc_node_leaflist_free(ctx, (struct lysc_node_leaflist *)node);
         break;
     case LYS_LIST:
-        lysc_node_list_free(ctx, (struct lysc_node_list*)node);
+        lysc_node_list_free(ctx, (struct lysc_node_list *)node);
         break;
     case LYS_CHOICE:
-        lysc_node_choice_free(ctx, (struct lysc_node_choice*)node);
+        lysc_node_choice_free(ctx, (struct lysc_node_choice *)node);
         break;
     case LYS_CASE:
         /* nothing specific */
         break;
     case LYS_ANYDATA:
     case LYS_ANYXML:
-        lysc_node_anydata_free(ctx, (struct lysc_node_anydata*)node);
+        lysc_node_anydata_free(ctx, (struct lysc_node_anydata *)node);
         break;
     default:
         LOGINT(ctx);
@@ -889,14 +889,14 @@
         case LY_STMT_TYPE:
             if (substmts[u].cardinality < LY_STMT_CARD_SOME) {
                 /* single item */
-                struct lysc_type *type = *((struct lysc_type**)substmts[u].storage);
+                struct lysc_type *type = *((struct lysc_type **)substmts[u].storage);
                 if (!type) {
                     break;
                 }
                 lysc_type_free(ctx, type);
             } else {
                 /* multiple items */
-                struct lysc_type **types = *((struct lysc_type***)substmts[u].storage);
+                struct lysc_type **types = *((struct lysc_type ***)substmts[u].storage);
                 if (!types) {
                     break;
                 }
@@ -906,14 +906,14 @@
         case LY_STMT_UNITS:
             if (substmts[u].cardinality < LY_STMT_CARD_SOME) {
                 /* single item */
-                const char *str = *((const char**)substmts[u].storage);
+                const char *str = *((const char **)substmts[u].storage);
                 if (!str) {
                     break;
                 }
                 FREE_STRING(ctx, str);
             } else {
                 /* multiple items */
-                const char **strs = *((const char***)substmts[u].storage);
+                const char **strs = *((const char ***)substmts[u].storage);
                 if (!strs) {
                     break;
                 }
@@ -925,7 +925,7 @@
             /* nothing to do */
             break;
         case LY_STMT_IF_FEATURE: {
-            struct lysc_iffeature *iff = *((struct lysc_iffeature**)substmts[u].storage);
+            struct lysc_iffeature *iff = *((struct lysc_iffeature **)substmts[u].storage);
             if (!iff) {
                 break;
             }
diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c
index 3e43227..4fbf992 100644
--- a/src/tree_schema_helpers.c
+++ b/src/tree_schema_helpers.c
@@ -92,7 +92,7 @@
         }
         if (implement && !mod->implemented) {
             /* make the module implemented */
-            ret = lys_set_implemented_internal((struct lys_module*)mod, ctx->ctx->module_set_id);
+            ret = lys_set_implemented_internal((struct lys_module *)mod, ctx->ctx->module_set_id);
             LY_CHECK_RET(ret);
         }
         if (context_node && (context_node->nodetype & (LYS_RPC | LYS_ACTION))) {
@@ -542,16 +542,16 @@
     /* gropings */
     LY_ARRAY_FOR(groupings, u) {
         LY_LIST_FOR(groupings[u].data, child) {
-            child->parent = (struct lysp_node*)&groupings[u];
+            child->parent = (struct lysp_node *)&groupings[u];
         }
         LY_ARRAY_FOR(groupings[u].actions, v) {
-            groupings[u].actions[v].parent = (struct lysp_node*)&groupings[u];
+            groupings[u].actions[v].parent = (struct lysp_node *)&groupings[u];
         }
         LY_ARRAY_FOR(groupings[u].notifs, v) {
-            groupings[u].notifs[v].parent = (struct lysp_node*)&groupings[u];
+            groupings[u].notifs[v].parent = (struct lysp_node *)&groupings[u];
         }
         LY_ARRAY_FOR(groupings[u].groupings, v) {
-            groupings[u].groupings[v].parent = (struct lysp_node*)&groupings[u];
+            groupings[u].groupings[v].parent = (struct lysp_node *)&groupings[u];
         }
         if (groupings[u].typedefs) {
             ly_set_add(&ctx->tpdfs_nodes, &groupings[u], 0);
@@ -561,44 +561,44 @@
     /* augments */
     LY_ARRAY_FOR(augments, u) {
         LY_LIST_FOR(augments[u].child, child) {
-            child->parent = (struct lysp_node*)&augments[u];
+            child->parent = (struct lysp_node *)&augments[u];
         }
         LY_ARRAY_FOR(augments[u].actions, v) {
-            augments[u].actions[v].parent = (struct lysp_node*)&augments[u];
+            augments[u].actions[v].parent = (struct lysp_node *)&augments[u];
         }
         LY_ARRAY_FOR(augments[u].notifs, v) {
-            augments[u].notifs[v].parent = (struct lysp_node*)&augments[u];
+            augments[u].notifs[v].parent = (struct lysp_node *)&augments[u];
         }
     }
 
     /* actions */
     LY_ARRAY_FOR(actions, u) {
         if (actions[u].input.parent) {
-            actions[u].input.parent = (struct lysp_node*)&actions[u];
+            actions[u].input.parent = (struct lysp_node *)&actions[u];
             LY_LIST_FOR(actions[u].input.data, child) {
-                child->parent = (struct lysp_node*)&actions[u].input;
+                child->parent = (struct lysp_node *)&actions[u].input;
             }
             LY_ARRAY_FOR(actions[u].input.groupings, v) {
-                actions[u].input.groupings[v].parent = (struct lysp_node*)&actions[u].input;
+                actions[u].input.groupings[v].parent = (struct lysp_node *)&actions[u].input;
             }
             if (actions[u].input.typedefs) {
                 ly_set_add(&ctx->tpdfs_nodes, &actions[u].input, 0);
             }
         }
         if (actions[u].output.parent) {
-            actions[u].output.parent = (struct lysp_node*)&actions[u];
+            actions[u].output.parent = (struct lysp_node *)&actions[u];
             LY_LIST_FOR(actions[u].output.data, child) {
-                child->parent = (struct lysp_node*)&actions[u].output;
+                child->parent = (struct lysp_node *)&actions[u].output;
             }
             LY_ARRAY_FOR(actions[u].output.groupings, v) {
-                actions[u].output.groupings[v].parent = (struct lysp_node*)&actions[u].output;
+                actions[u].output.groupings[v].parent = (struct lysp_node *)&actions[u].output;
             }
             if (actions[u].output.typedefs) {
                 ly_set_add(&ctx->tpdfs_nodes, &actions[u].output, 0);
             }
         }
         LY_ARRAY_FOR(actions[u].groupings, v) {
-            actions[u].groupings[v].parent = (struct lysp_node*)&actions[u];
+            actions[u].groupings[v].parent = (struct lysp_node *)&actions[u];
         }
         if (actions[u].typedefs) {
             ly_set_add(&ctx->tpdfs_nodes, &actions[u], 0);
@@ -608,10 +608,10 @@
     /* notifications */
     LY_ARRAY_FOR(notifs, u) {
         LY_LIST_FOR(notifs[u].data, child) {
-            child->parent = (struct lysp_node*)&notifs[u];
+            child->parent = (struct lysp_node *)&notifs[u];
         }
         LY_ARRAY_FOR(notifs[u].groupings, v) {
-            notifs[u].groupings[v].parent = (struct lysp_node*)&notifs[u];
+            notifs[u].groupings[v].parent = (struct lysp_node *)&notifs[u];
         }
         if (notifs[u].typedefs) {
             ly_set_add(&ctx->tpdfs_nodes, &notifs[u], 0);
@@ -632,8 +632,8 @@
     LY_ERR ret = LY_EVALID;
 
     /* check name collisions - typedefs and groupings */
-    ids_global = lyht_new(8, sizeof(char*), lysp_id_cmp, NULL, 1);
-    ids_scoped = lyht_new(8, sizeof(char*), lysp_id_cmp, NULL, 1);
+    ids_global = lyht_new(8, sizeof(char *), lysp_id_cmp, NULL, 1);
+    ids_scoped = lyht_new(8, sizeof(char *), lysp_id_cmp, NULL, 1);
     LY_ARRAY_FOR(mod->typedefs, v) {
         if (lysp_check_typedef(ctx, NULL, &mod->typedefs[v], ids_global, ids_scoped)) {
             goto cleanup;
@@ -667,7 +667,7 @@
     const char *name;
     const char *revision;
     const char *path;
-    const char* submoduleof;
+    const char *submoduleof;
 };
 
 static LY_ERR
@@ -824,10 +824,10 @@
         /* try to get the module from the context */
         if (revision) {
             /* get the specific revision */
-            *mod = (struct lys_module*)ly_ctx_get_module(ctx, name, revision);
+            *mod = (struct lys_module *)ly_ctx_get_module(ctx, name, revision);
         } else if (implement) {
             /* prefer the implemented module instead of the latest one */
-            *mod = (struct lys_module*)ly_ctx_get_module_implemented(ctx, name);
+            *mod = (struct lys_module *)ly_ctx_get_module_implemented(ctx, name);
             if (!*mod) {
                 /* there is no implemented module in the context, try to get the latest revision module */
                 goto latest_in_the_context;
@@ -835,7 +835,7 @@
         } else {
             /* get the requested module of the latest revision in the context */
 latest_in_the_context:
-            *mod = (struct lys_module*)ly_ctx_get_module_latest(ctx, name);
+            *mod = (struct lys_module *)ly_ctx_get_module_latest(ctx, name);
             if (*mod && (*mod)->latest_revision == 1) {
                 /* let us now search with callback and searchpaths to check if there is newer revision outside the context */
                 m = *mod;
@@ -866,7 +866,7 @@
                     lys_parse_mem_module(ctx, in, format, implement, lysp_load_module_check, &check_data, mod);
                     ly_in_free(in, 0);
                     if (module_data_free) {
-                        module_data_free((void*)module_data, ctx->imp_clb_data);
+                        module_data_free((void *)module_data, ctx->imp_clb_data);
                     }
                     if (*mod && implement) {
                         lys_compile(mod, 0);
@@ -988,7 +988,7 @@
                 lys_parse_mem_submodule(ctx, in, format, pctx, lysp_load_module_check, &check_data, &submod);
                 ly_in_free(in, 0);
                 if (submodule_data_free) {
-                    submodule_data_free((void*)submodule_data, ctx->imp_clb_data);
+                    submodule_data_free((void *)submodule_data, ctx->imp_clb_data);
                 }
             }
         }
@@ -1000,7 +1000,7 @@
         if (!(ctx->flags & LY_CTX_DISABLE_SEARCHDIRS)) {
             /* submodule was not received from the callback or there is no callback set */
             lys_module_localfile(ctx, inc->name, inc->rev[0] ? inc->rev : NULL, 0, pctx, pctx->main_mod->name, 1,
-                    (void**)&submod);
+                    (void **)&submod);
         }
         if (!submod && (ctx->flags & LY_CTX_PREFER_SEARCHDIRS)) {
             goto search_clb;
@@ -1157,18 +1157,18 @@
 {
     switch (node->nodetype) {
     case LYS_CONTAINER:
-        return ((struct lysp_node_container*)node)->typedefs;
+        return ((struct lysp_node_container *)node)->typedefs;
     case LYS_LIST:
-        return ((struct lysp_node_list*)node)->typedefs;
+        return ((struct lysp_node_list *)node)->typedefs;
     case LYS_GROUPING:
-        return ((struct lysp_grp*)node)->typedefs;
+        return ((struct lysp_grp *)node)->typedefs;
     case LYS_RPC:
     case LYS_ACTION:
-        return ((struct lysp_action*)node)->typedefs;
+        return ((struct lysp_action *)node)->typedefs;
     case LYS_INOUT:
-        return ((struct lysp_action_inout*)node)->typedefs;
+        return ((struct lysp_action_inout *)node)->typedefs;
     case LYS_NOTIF:
-        return ((struct lysp_notif*)node)->typedefs;
+        return ((struct lysp_notif *)node)->typedefs;
     default:
         return NULL;
     }
@@ -1179,18 +1179,18 @@
 {
     switch (node->nodetype) {
     case LYS_CONTAINER:
-        return ((struct lysp_node_container*)node)->groupings;
+        return ((struct lysp_node_container *)node)->groupings;
     case LYS_LIST:
-        return ((struct lysp_node_list*)node)->groupings;
+        return ((struct lysp_node_list *)node)->groupings;
     case LYS_GROUPING:
-        return ((struct lysp_grp*)node)->groupings;
+        return ((struct lysp_grp *)node)->groupings;
     case LYS_RPC:
     case LYS_ACTION:
-        return ((struct lysp_action*)node)->groupings;
+        return ((struct lysp_action *)node)->groupings;
     case LYS_INOUT:
-        return ((struct lysp_action_inout*)node)->groupings;
+        return ((struct lysp_action_inout *)node)->groupings;
     case LYS_NOTIF:
-        return ((struct lysp_notif*)node)->groupings;
+        return ((struct lysp_notif *)node)->groupings;
     default:
         return NULL;
     }
@@ -1202,13 +1202,13 @@
     assert(node);
     switch (node->nodetype) {
     case LYS_CONTAINER:
-        return &((struct lysp_node_container*)node)->actions;
+        return &((struct lysp_node_container *)node)->actions;
     case LYS_LIST:
-        return &((struct lysp_node_list*)node)->actions;
+        return &((struct lysp_node_list *)node)->actions;
     case LYS_GROUPING:
-        return &((struct lysp_grp*)node)->actions;
+        return &((struct lysp_grp *)node)->actions;
     case LYS_AUGMENT:
-        return &((struct lysp_augment*)node)->actions;
+        return &((struct lysp_augment *)node)->actions;
     default:
         return NULL;
     }
@@ -1218,7 +1218,7 @@
 lysp_node_actions(const struct lysp_node *node)
 {
     struct lysp_action **actions;
-    actions = lysp_node_actions_p((struct lysp_node*)node);
+    actions = lysp_node_actions_p((struct lysp_node *)node);
     if (actions) {
         return *actions;
     } else {
@@ -1232,13 +1232,13 @@
     assert(node);
     switch (node->nodetype) {
     case LYS_CONTAINER:
-        return &((struct lysp_node_container*)node)->notifs;
+        return &((struct lysp_node_container *)node)->notifs;
     case LYS_LIST:
-        return &((struct lysp_node_list*)node)->notifs;
+        return &((struct lysp_node_list *)node)->notifs;
     case LYS_GROUPING:
-        return &((struct lysp_grp*)node)->notifs;
+        return &((struct lysp_grp *)node)->notifs;
     case LYS_AUGMENT:
-        return &((struct lysp_augment*)node)->notifs;
+        return &((struct lysp_augment *)node)->notifs;
     default:
         return NULL;
     }
@@ -1248,7 +1248,7 @@
 lysp_node_notifs(const struct lysp_node *node)
 {
     struct lysp_notif **notifs;
-    notifs = lysp_node_notifs_p((struct lysp_node*)node);
+    notifs = lysp_node_notifs_p((struct lysp_node *)node);
     if (notifs) {
         return *notifs;
     } else {
@@ -1262,21 +1262,21 @@
     assert(node);
     switch (node->nodetype) {
     case LYS_CONTAINER:
-        return &((struct lysp_node_container*)node)->child;
+        return &((struct lysp_node_container *)node)->child;
     case LYS_CHOICE:
-        return &((struct lysp_node_choice*)node)->child;
+        return &((struct lysp_node_choice *)node)->child;
     case LYS_LIST:
-        return &((struct lysp_node_list*)node)->child;
+        return &((struct lysp_node_list *)node)->child;
     case LYS_CASE:
-        return &((struct lysp_node_case*)node)->child;
+        return &((struct lysp_node_case *)node)->child;
     case LYS_GROUPING:
-        return &((struct lysp_grp*)node)->data;
+        return &((struct lysp_grp *)node)->data;
     case LYS_AUGMENT:
-        return &((struct lysp_augment*)node)->child;
+        return &((struct lysp_augment *)node)->child;
     case LYS_INOUT:
-        return &((struct lysp_action_inout*)node)->data;
+        return &((struct lysp_action_inout *)node)->data;
     case LYS_NOTIF:
-        return &((struct lysp_notif*)node)->data;
+        return &((struct lysp_notif *)node)->data;
     default:
         return NULL;
     }
@@ -1291,7 +1291,7 @@
         return NULL;
     }
 
-    children = lysp_node_children_p((struct lysp_node*)node);
+    children = lysp_node_children_p((struct lysp_node *)node);
     if (children) {
         return *children;
     } else {
@@ -1305,9 +1305,9 @@
     assert(node);
     switch (node->nodetype) {
     case LYS_CONTAINER:
-        return &((struct lysc_node_container*)node)->actions;
+        return &((struct lysc_node_container *)node)->actions;
     case LYS_LIST:
-        return &((struct lysc_node_list*)node)->actions;
+        return &((struct lysc_node_list *)node)->actions;
     default:
         return NULL;
     }
@@ -1317,7 +1317,7 @@
 lysc_node_actions(const struct lysc_node *node)
 {
     struct lysc_action **actions;
-    actions = lysc_node_actions_p((struct lysc_node*)node);
+    actions = lysc_node_actions_p((struct lysc_node *)node);
     if (actions) {
         return *actions;
     } else {
@@ -1331,9 +1331,9 @@
     assert(node);
     switch (node->nodetype) {
     case LYS_CONTAINER:
-        return &((struct lysc_node_container*)node)->notifs;
+        return &((struct lysc_node_container *)node)->notifs;
     case LYS_LIST:
-        return &((struct lysc_node_list*)node)->notifs;
+        return &((struct lysc_node_list *)node)->notifs;
     default:
         return NULL;
     }
@@ -1343,7 +1343,7 @@
 lysc_node_notifs(const struct lysc_node *node)
 {
     struct lysc_notif **notifs;
-    notifs = lysc_node_notifs_p((struct lysc_node*)node);
+    notifs = lysc_node_notifs_p((struct lysc_node *)node);
     if (notifs) {
         return *notifs;
     } else {
@@ -1357,27 +1357,27 @@
     assert(node);
     switch (node->nodetype) {
     case LYS_CONTAINER:
-        return &((struct lysc_node_container*)node)->child;
+        return &((struct lysc_node_container *)node)->child;
     case LYS_CHOICE:
-        if (((struct lysc_node_choice*)node)->cases) {
-            return &((struct lysc_node_choice*)node)->cases->child;
+        if (((struct lysc_node_choice *)node)->cases) {
+            return &((struct lysc_node_choice *)node)->cases->child;
         } else {
             return NULL;
         }
     case LYS_CASE:
-        return &((struct lysc_node_case*)node)->child;
+        return &((struct lysc_node_case *)node)->child;
     case LYS_LIST:
-        return &((struct lysc_node_list*)node)->child;
+        return &((struct lysc_node_list *)node)->child;
     case LYS_RPC:
     case LYS_ACTION:
         if (flags & LYS_CONFIG_R) {
-            return &((struct lysc_action*)node)->output.data;
+            return &((struct lysc_action *)node)->output.data;
         } else {
             /* LYS_CONFIG_W, but also the default case */
-            return &((struct lysc_action*)node)->input.data;
+            return &((struct lysc_action *)node)->input.data;
         }
     case LYS_NOTIF:
-        return &((struct lysc_notif*)node)->data;
+        return &((struct lysc_notif *)node)->data;
     default:
         return NULL;
     }
@@ -1392,7 +1392,7 @@
         return NULL;
     }
 
-    children = lysc_node_children_p((struct lysc_node*)node, flags);
+    children = lysc_node_children_p((struct lysc_node *)node, flags);
     if (children) {
         return *children;
     } else {
@@ -1406,8 +1406,8 @@
     unsigned int u;
 
     for (u = 0; u < ctx->list.count; ++u) {
-        if (((struct lys_module*)ctx->list.objs[u])->parsed == mod) {
-            return ((struct lys_module*)ctx->list.objs[u]);
+        if (((struct lys_module *)ctx->list.objs[u])->parsed == mod) {
+            return ((struct lys_module *)ctx->list.objs[u]);
         }
     }
     return NULL;
diff --git a/uncrustify.cfg b/uncrustify.cfg
index 8db3e27..d702d06 100644
--- a/uncrustify.cfg
+++ b/uncrustify.cfg
@@ -188,7 +188,7 @@
 sp_brace_brace                  = ignore    # ignore/add/remove/force
 
 # Add or remove space before pointer star '*'.
-sp_before_ptr_star              = ignore    # ignore/add/remove/force
+sp_before_ptr_star              = force    # ignore/add/remove/force
 
 # Add or remove space before pointer star '*' that isn't followed by a
 # variable name. If set to ignore, sp_before_ptr_star is used instead.
@@ -200,13 +200,13 @@
 # Add or remove space after pointer star '*', if followed by a word.
 #
 # Overrides sp_type_func.
-sp_after_ptr_star               = ignore   # ignore/add/remove/force
+sp_after_ptr_star               = remove   # ignore/add/remove/force
 
 # Add or remove space after pointer caret '^', if followed by a word.
 #sp_after_ptr_block_caret        = ignore   # ignore/add/remove/force
 
 # Add or remove space after pointer star '*', if followed by a qualifier.
-sp_after_ptr_star_qualifier     = ignore   # ignore/add/remove/force
+sp_after_ptr_star_qualifier     = force    # ignore/add/remove/force
 
 # Add or remove space after a pointer star '*', if followed by a function
 # prototype or function definition.
@@ -220,7 +220,7 @@
 
 # Add or remove space before a pointer star '*', if followed by a function
 # prototype or function definition.
-sp_before_ptr_star_func         = ignore   # ignore/add/remove/force
+sp_before_ptr_star_func         = force    # ignore/add/remove/force
 
 # Add or remove space before a reference sign '&'.
 sp_before_byref                 = ignore    # ignore/add/remove/force