1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +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

@@ -117,8 +117,9 @@ Error StreamPeerTCP::write(const uint8_t *p_data, int p_bytes, int &r_sent, bool
}
}
if (!_sock->is_open())
if (!_sock->is_open()) {
return FAILED;
}
Error err;
int data_to_send = p_bytes;
@@ -257,8 +258,9 @@ StreamPeerTCP::Status StreamPeerTCP::get_status() {
}
void StreamPeerTCP::disconnect_from_host() {
if (_sock.is_valid() && _sock->is_open())
if (_sock.is_valid() && _sock->is_open()) {
_sock->close();
}
timeout = 0;
status = STATUS_NONE;
@@ -308,8 +310,9 @@ Error StreamPeerTCP::_connect(const String &p_address, int p_port) {
ip = p_address;
} else {
ip = IP::get_singleton()->resolve_hostname(p_address);
if (!ip.is_valid())
if (!ip.is_valid()) {
return ERR_CANT_RESOLVE;
}
}
return connect_to_host(ip, p_port);