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

@@ -451,10 +451,11 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
EditorProgress ep("export", "Exporting for OSX", 3, true);
if (p_debug)
if (p_debug) {
src_pkg_name = p_preset->get("custom_template/debug");
else
} else {
src_pkg_name = p_preset->get("custom_template/release");
}
if (src_pkg_name == "") {
String err;
@@ -487,12 +488,13 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
String binary_to_use = "godot_osx_" + String(p_debug ? "debug" : "release") + ".64";
String pkg_name;
if (p_preset->get("application/name") != "")
if (p_preset->get("application/name") != "") {
pkg_name = p_preset->get("application/name"); // app_name
else if (String(ProjectSettings::get_singleton()->get("application/config/name")) != "")
} else if (String(ProjectSettings::get_singleton()->get("application/config/name")) != "") {
pkg_name = String(ProjectSettings::get_singleton()->get("application/config/name"));
else
} else {
pkg_name = "Unnamed";
}
String pkg_name_safe = OS::get_singleton()->get_safe_dir_name(pkg_name);
@@ -580,10 +582,11 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
if (file == "Contents/Resources/icon.icns") {
//see if there is an icon
String iconpath;
if (p_preset->get("application/icon") != "")
if (p_preset->get("application/icon") != "") {
iconpath = p_preset->get("application/icon");
else
} else {
iconpath = ProjectSettings::get_singleton()->get("application/config/icon");
}
if (iconpath != "") {
if (iconpath.get_extension() == "icns") {
@@ -761,8 +764,9 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
while (true) {
int r = pf->get_buffer(buf, BSIZE);
if (r <= 0)
if (r <= 0) {
break;
}
zipWriteInFileInZip(dst_pkg_zip, buf, r);
}
@@ -832,8 +836,9 @@ bool EditorExportPlatformOSX::can_export(const Ref<EditorExportPreset> &p_preset
valid = dvalid || rvalid;
r_missing_templates = !valid;
if (!err.empty())
if (!err.empty()) {
r_error = err;
}
return valid;
}