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

@ -94,8 +94,9 @@ Error HTTPRequest::request(const String &p_url, const Vector<String> &p_custom_h
method = p_method;
Error err = _parse_url(p_url);
if (err)
if (err) {
return err;
}
validate_ssl = p_ssl_validate_domain;
@ -134,8 +135,9 @@ void HTTPRequest::_thread_func(void *p_userdata) {
} else {
while (!hr->thread_request_quit) {
bool exit = hr->_update_connection();
if (exit)
if (exit) {
break;
}
OS::get_singleton()->delay_usec(1);
}
}
@ -146,8 +148,9 @@ void HTTPRequest::_thread_func(void *p_userdata) {
void HTTPRequest::cancel_request() {
timer->stop();
if (!requesting)
if (!requesting) {
return;
}
if (!use_threads) {
set_process_internal(false);
@ -266,8 +269,9 @@ bool HTTPRequest::_update_connection() {
bool ret_value;
if (_handle_response(&ret_value))
if (_handle_response(&ret_value)) {
return ret_value;
}
call_deferred("_request_done", RESULT_SUCCESS, response_code, response_headers, PackedByteArray());
return true;
@ -304,8 +308,9 @@ bool HTTPRequest::_update_connection() {
if (!got_response) {
bool ret_value;
if (_handle_response(&ret_value))
if (_handle_response(&ret_value)) {
return ret_value;
}
if (!client->is_response_chunked() && client->get_response_body_length() == 0) {
call_deferred("_request_done", RESULT_SUCCESS, response_code, response_headers, PackedByteArray());
@ -384,8 +389,9 @@ void HTTPRequest::_request_done(int p_status, int p_code, const PackedStringArra
void HTTPRequest::_notification(int p_what) {
if (p_what == NOTIFICATION_INTERNAL_PROCESS) {
if (use_threads)
if (use_threads) {
return;
}
bool done = _update_connection();
if (done) {
set_process_internal(false);
@ -556,6 +562,7 @@ HTTPRequest::HTTPRequest() {
}
HTTPRequest::~HTTPRequest() {
if (file)
if (file) {
memdelete(file);
}
}