libyang MAINTENANCE change format of the empty loops
To improve readability and because of processing by the formatting
tools, add explicit empty block to the empty loops (for, while).
diff --git a/src/tree_data.c b/src/tree_data.c
index a6963ba..6baa2d5 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -283,7 +283,7 @@
size_t len = strlen(path);
/* ignore trailing whitespaces */
- for (; len > 0 && isspace(path[len - 1]); len--);
+ for (; len > 0 && isspace(path[len - 1]); len--) {}
if (len >= 5 && !strncmp(&path[len - 4], ".xml", 4)) {
format = LYD_XML;
@@ -1700,7 +1700,7 @@
if (sibling->parent) {
sibling = sibling->parent->child;
} else {
- for (; sibling->prev->next != node; sibling = sibling->prev);
+ for (; sibling->prev->next != node; sibling = sibling->prev) {}
}
sibling->prev = node;
}
@@ -2103,7 +2103,7 @@
/* insert as the last attribute */
if (parent->meta) {
- for (last = parent->meta; last->next; last = last->next);
+ for (last = parent->meta; last->next; last = last->next) {}
last->next = meta;
} else {
parent->meta = meta;
@@ -2158,7 +2158,7 @@
if (parent) {
lyd_insert_meta(parent, mt);
} else if (*meta) {
- for (last = *meta; last->next; last = last->next);
+ for (last = *meta; last->next; last = last->next) {}
last->next = mt;
}
@@ -2187,7 +2187,7 @@
/* insert as the last attribute */
if (opaq->attr) {
- for (last = opaq->attr; last->next; last = last->next);
+ for (last = opaq->attr; last->next; last = last->next) {}
last->next = attr;
} else {
opaq->attr = attr;
@@ -2233,7 +2233,7 @@
if (parent) {
lyd_insert_attr(parent, at);
} else if (*attr) {
- for (last = *attr; last->next; last = last->next);
+ for (last = *attr; last->next; last = last->next) {}
last->next = at;
}
@@ -2736,7 +2736,7 @@
/* insert as the last attribute */
if (node->meta) {
- for (last = node->meta; last->next; last = last->next);
+ for (last = node->meta; last->next; last = last->next) {}
last->next = mt;
} else {
node->meta = mt;
@@ -2975,7 +2975,7 @@
if (node->parent) {
first = node->parent->child;
} else {
- for (first = node; node->prev->next; node = node->prev);
+ for (first = node; node->prev->next; node = node->prev) {}
}
pos = 1;
for (iter = first; iter != node; iter = iter->next) {
@@ -3028,7 +3028,7 @@
goto iter_print;
while (depth) {
/* find the right node */
- for (iter = node, i = 1; i < depth; iter = (const struct lyd_node *)iter->parent, ++i);
+ for (iter = node, i = 1; i < depth; iter = (const struct lyd_node *)iter->parent, ++i) {}
iter_print:
/* print prefix and name */
mod = NULL;