Style: Enforce braces around if blocks and loops

Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
This commit is contained in:
Rémi Verschelde 2020-05-14 16:41:43 +02:00
parent 07bc4e2f96
commit 0ee0fa42e6
683 changed files with 22803 additions and 12225 deletions

View file

@ -255,11 +255,14 @@ public:
//cap to 4 and make weights add up 1
weights.resize(4);
float total = 0;
for (int i = 0; i < 4; i++)
for (int i = 0; i < 4; i++) {
total += weights[i].weight;
if (total)
for (int i = 0; i < 4; i++)
}
if (total) {
for (int i = 0; i < 4; i++) {
weights.write[i].weight /= total;
}
}
}
}
@ -274,11 +277,13 @@ public:
if (!weights.empty() || !p_vert.weights.empty()) {
if (weights.size() == p_vert.weights.size()) {
for (int i = 0; i < weights.size(); i++) {
if (weights[i].bone_idx != p_vert.weights[i].bone_idx)
if (weights[i].bone_idx != p_vert.weights[i].bone_idx) {
return weights[i].bone_idx < p_vert.weights[i].bone_idx;
}
if (weights[i].weight != p_vert.weights[i].weight)
if (weights[i].weight != p_vert.weights[i].weight) {
return weights[i].weight < p_vert.weights[i].weight;
}
}
} else {
return weights.size() < p_vert.weights.size();
@ -286,16 +291,21 @@ public:
}
return (color < p_vert.color);
} else
} else {
return (uv2 < p_vert.uv2);
} else
}
} else {
return (uv < p_vert.uv);
} else
}
} else {
return (normal < p_vert.normal);
} else
}
} else {
return vertex < p_vert.vertex;
} else
}
} else {
return uid < p_vert.uid;
}
}
Vertex() {}
@ -347,8 +357,9 @@ public:
Node() {}
virtual ~Node() {
for (int i = 0; i < children.size(); i++)
for (int i = 0; i < children.size(); i++) {
memdelete(children[i]);
}
};
};
@ -395,8 +406,9 @@ public:
Vector<Node *> root_nodes;
~VisualScene() {
for (int i = 0; i < root_nodes.size(); i++)
for (int i = 0; i < root_nodes.size(); i++) {
memdelete(root_nodes[i]);
}
}
};