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
+4 -2
View File
@@ -70,8 +70,9 @@ MainLoop *test() {
uint32_t num_elems = 0;
for (int i = 0; i < 500; i++) {
int tmp;
if (map.lookup(i, tmp) && tmp == i * 2)
if (map.lookup(i, tmp) && tmp == i * 2) {
num_elems++;
}
}
OS::get_singleton()->print("elements %d == %d.\n", map.get_num_elements(), num_elems);
@@ -104,8 +105,9 @@ MainLoop *test() {
keys[i] = Math::rand();
map.set(keys[i], dummy);
if (!map.lookup(keys[i], dummy))
if (!map.lookup(keys[i], dummy)) {
OS::get_singleton()->print("could not find 0x%X despite it was just inserted!\n", unsigned(keys[i]));
}
}
// check whether the keys are still present