diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:41:43 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 21:57:34 +0200 |
commit | 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (patch) | |
tree | 198d4ff7665d89307f6ca2469fa38620a9eb1672 /platform/iphone/export | |
parent | 07bc4e2f96f8f47991339654ff4ab16acc19d44f (diff) |
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
Diffstat (limited to 'platform/iphone/export')
-rw-r--r-- | platform/iphone/export/export.cpp | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index e5e9f7764b..63c3cb8c23 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -415,8 +415,9 @@ String EditorExportPlatformIOS::_get_linker_flags() { String result; for (int i = 0; i < export_plugins.size(); ++i) { String flags = export_plugins[i]->get_ios_linker_flags(); - if (flags.length() == 0) + if (flags.length() == 0) { continue; + } if (result.length() > 0) { result += ' '; } @@ -448,10 +449,12 @@ void EditorExportPlatformIOS::_blend_and_rotate(Ref<Image> &p_dst, Ref<Image> &p int xs = (x_pos >= 0) ? 0 : -x_pos; int ys = (y_pos >= 0) ? 0 : -y_pos; - if (sw + x_pos > p_dst->get_width()) + if (sw + x_pos > p_dst->get_width()) { sw = p_dst->get_width() - x_pos; - if (sh + y_pos > p_dst->get_height()) + } + if (sh + y_pos > p_dst->get_height()) { sh = p_dst->get_height() - y_pos; + } for (int y = ys; y < sh; y++) { for (int x = xs; x < sw; x++) { @@ -921,8 +924,9 @@ Error EditorExportPlatformIOS::_export_additional_assets(const String &p_out_dir ERR_FAIL_COND_V(err, err); Vector<String> project_static_libs = export_plugins[i]->get_ios_project_static_libs(); - for (int j = 0; j < project_static_libs.size(); j++) + for (int j = 0; j < project_static_libs.size(); j++) { project_static_libs.write[j] = project_static_libs[j].get_file(); // Only the file name as it's copied to the project + } err = _export_additional_assets(p_out_dir, project_static_libs, true, r_exported_assets); ERR_FAIL_COND_V(err, err); @@ -981,10 +985,11 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p String team_id = p_preset->get("application/app_store_team_id"); ERR_FAIL_COND_V_MSG(team_id.length() == 0, ERR_CANT_OPEN, "App Store Team ID not specified - cannot configure the project."); - 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; @@ -1030,8 +1035,9 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p String pack_path = dest_dir + binary_name + ".pck"; Vector<SharedObject> libraries; Error err = save_pack(p_preset, pack_path, &libraries); - if (err) + if (err) { return err; + } if (ep.step("Extracting and configuring Xcode project", 1)) { return ERR_SKIP; @@ -1041,12 +1047,13 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p print_line("Static library: " + library_to_use); 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"; + } bool found_library = false; int total_size = 0; @@ -1225,16 +1232,19 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p err = tmp_app_path->make_dir_recursive(iconset_dir); } memdelete(tmp_app_path); - if (err) + if (err) { return err; + } err = _export_icons(p_preset, iconset_dir); - if (err) + if (err) { return err; + } err = _export_loading_screens(p_preset, dest_dir + binary_name + "/Images.xcassets/LaunchImage.launchimage/"); - if (err) + if (err) { return err; + } print_line("Exporting additional assets"); Vector<IOSExportAsset> assets; @@ -1361,8 +1371,9 @@ bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset err += etc_error; } - if (!err.empty()) + if (!err.empty()) { r_error = err; + } return valid; } |