uncrustify FORMAT set various uncrustify options
PR #1228
diff --git a/src/tree_schema.c b/src/tree_schema.c
index d5d672c..1b9433c 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -58,7 +58,7 @@
/* get know where to start */
if (parent) {
/* schema subtree */
- if (parent->nodetype == LYS_CHOICE && (options & LYS_GETNEXT_WITHCASE)) {
+ 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];
}
@@ -119,7 +119,7 @@
repeat:
if (!next) {
/* possibly go back to parent */
- if (last && last->parent != parent) {
+ if (last && (last->parent != parent)) {
last = last->parent;
goto next;
} else if (!action_flag) {
@@ -245,7 +245,7 @@
}
if (!mod) {
LOGERR(ctx, LY_EINVAL, "Invalid qpath - unable to find module connected with the prefix of the node \"%.*s\".",
- id - qpath, qpath);
+ id - qpath, qpath);
return NULL;
}
@@ -413,7 +413,7 @@
} else {
slash = "/";
}
- if (!iter->parent || iter->parent->module != iter->module) {
+ if (!iter->parent || (iter->parent->module != iter->module)) {
/* print prefix */
if (buffer) {
len = snprintf(buffer, buflen, "%s%s:%s%s", slash, iter->module->name, id, s ? s : "");
@@ -431,7 +431,7 @@
free(s);
free(id);
- if (buffer && buflen <= (size_t)len) {
+ if (buffer && (buflen <= (size_t)len)) {
/* not enough space in buffer */
break;
}
@@ -566,7 +566,7 @@
if (!mod->compiled) {
LOGERR(ctx, LY_EINVAL, "Module \"%s\" is not implemented so all its features are permanently disabled without a chance to change it.",
- mod->name);
+ mod->name);
return LY_EINVAL;
}
if (!mod->features) {
@@ -605,8 +605,8 @@
goto next;
} else {
LOGERR(ctx, LY_EDENIED,
- "Feature \"%s\" cannot be enabled since it is disabled by its if-feature condition(s).",
- f->name);
+ "Feature \"%s\" cannot be enabled since it is disabled by its if-feature condition(s).",
+ f->name);
ret = LY_EDENIED;
goto cleanup;
}
@@ -646,8 +646,8 @@
for (u = 0; disabled_count && u < LY_ARRAY_COUNT(mod->features); ++u) {
if (!(mod->features[u].flags & LYS_FENABLED)) {
LOGERR(ctx, LY_EDENIED,
- "Feature \"%s\" cannot be enabled since it is disabled by its if-feature condition(s).",
- mod->features[u].name);
+ "Feature \"%s\" cannot be enabled since it is disabled by its if-feature condition(s).",
+ mod->features[u].name);
--disabled_count;
}
}
@@ -1119,10 +1119,10 @@
/* error */
if (mod->parsed->revs) {
LOGERR(ctx, LY_EEXIST, "Module \"%s\" of revision \"%s\" is already present in the context.",
- mod->name, mod->parsed->revs[0].date);
+ mod->name, mod->parsed->revs[0].date);
} else {
LOGERR(ctx, LY_EEXIST, "Module \"%s\" with no revision is already present in the context.",
- mod->name);
+ mod->name);
}
ret = LY_EEXIST;
goto error;
@@ -1152,14 +1152,14 @@
/* name */
len = strlen(mod->name);
if (strncmp(filename, mod->name, len) ||
- ((rev && rev != &filename[len]) || (!rev && dot != &filename[len]))) {
+ ((rev && (rev != &filename[len])) || (!rev && (dot != &filename[len])))) {
LOGWRN(ctx, "File name \"%s\" does not match module name \"%s\".", filename, mod->name);
}
if (rev) {
len = dot - ++rev;
- if (!mod->parsed->revs || len != 10 || strncmp(mod->parsed->revs[0].date, rev, len)) {
+ if (!mod->parsed->revs || (len != 10) || strncmp(mod->parsed->revs[0].date, rev, len)) {
LOGWRN(ctx, "File name \"%s\" does not match module revision \"%s\".", filename,
- mod->parsed->revs ? mod->parsed->revs[0].date : "none");
+ mod->parsed->revs ? mod->parsed->revs[0].date : "none");
}
}
@@ -1200,9 +1200,9 @@
/* pre-compile features and identities of any submodules */
LY_ARRAY_FOR(mod->parsed->includes, u) {
LY_CHECK_GOTO(ret = lys_feature_precompile(NULL, ctx, mod, mod->parsed->includes[u].submodule->features,
- &mod->features), error);
+ &mod->features), error);
LY_CHECK_GOTO(ret = lys_identity_precompile(NULL, ctx, mod, mod->parsed->includes[u].submodule->identities,
- &mod->identities), error);
+ &mod->identities), error);
}
}
@@ -1295,7 +1295,7 @@
LY_CHECK_ARG_RET(ctx, path, format != LYS_IN_UNKNOWN, LY_EINVAL);
LY_CHECK_ERR_RET(ret = ly_in_new_filepath(path, 0, &in),
- LOGERR(ctx, ret, "Unable to create input handler for filepath %s.", path), ret);
+ LOGERR(ctx, ret, "Unable to create input handler for filepath %s.", path), ret);
ret = lys_parse(ctx, in, format, module);
ly_in_free(in, 0);
@@ -1387,7 +1387,7 @@
}
if (stat(wn, &st) == -1) {
LOGWRN(NULL, "Unable to get information about \"%s\" file in \"%s\" when searching for (sub)modules (%s)",
- file->d_name, wd, strerror(errno));
+ file->d_name, wd, strerror(errno));
continue;
}
if (S_ISDIR(st.st_mode) && (dirs->count || !implicit_cwd)) {
@@ -1406,7 +1406,7 @@
/* here we know that the item is a file which can contain a module */
if (strncmp(name, file->d_name, len) ||
- (file->d_name[len] != '.' && file->d_name[len] != '@')) {
+ ((file->d_name[len] != '.') && (file->d_name[len] != '@'))) {
/* different filename than the module we search for */
continue;
}
@@ -1452,10 +1452,10 @@
} else {
/* remember the revision and try to find the newest one */
if (match_name) {
- if (file->d_name[len] != '@' ||
- lysp_check_date(NULL, &file->d_name[len + 1], flen - (format_aux == LYS_IN_YANG ? 5 : 4) - len - 1, NULL)) {
+ if ((file->d_name[len] != '@') ||
+ lysp_check_date(NULL, &file->d_name[len + 1], flen - ((format_aux == LYS_IN_YANG) ? 5 : 4) - len - 1, NULL)) {
continue;
- } else if (match_name[match_len] == '@' &&
+ } else if ((match_name[match_len] == '@') &&
(strncmp(&match_name[match_len + 1], &file->d_name[len + 1], LY_REV_SIZE - 1) >= 0)) {
continue;
}