1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

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

@@ -148,11 +148,13 @@ public:
}
void poll() {
if (!server->is_listening())
if (!server->is_listening()) {
return;
}
if (connection.is_null()) {
if (!server->is_connection_available())
if (!server->is_connection_available()) {
return;
}
connection = server->take_connection();
time = OS::get_singleton()->get_ticks_usec();
}
@@ -160,8 +162,9 @@ public:
_clear_client();
return;
}
if (connection->get_status() != StreamPeerTCP::STATUS_CONNECTED)
if (connection->get_status() != StreamPeerTCP::STATUS_CONNECTED) {
return;
}
while (true) {
char *r = (char *)req_buf;
@@ -339,8 +342,9 @@ bool EditorExportPlatformJavaScript::can_export(const Ref<EditorExportPreset> &p
}
}
if (!err.empty())
if (!err.empty()) {
r_error = err;
}
return valid;
}
@@ -363,10 +367,11 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
template_path = template_path.strip_edges();
if (template_path == String()) {
if (p_debug)
if (p_debug) {
template_path = find_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_DEBUG);
else
} else {
template_path = find_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE);
}
}
if (!DirAccess::exists(p_path.get_base_dir())) {
@@ -618,10 +623,11 @@ EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() {
run_icon->create_from_image(img);
Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme();
if (theme.is_valid())
if (theme.is_valid()) {
stop_icon = theme->get_icon("Stop", "EditorIcons");
else
} else {
stop_icon.instance();
}
menu_options = 0;
}