mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03: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:
@@ -39,19 +39,23 @@ IP_Address::operator Variant() const {
|
||||
#include <string.h>
|
||||
|
||||
IP_Address::operator String() const {
|
||||
if (wildcard)
|
||||
if (wildcard) {
|
||||
return "*";
|
||||
}
|
||||
|
||||
if (!valid)
|
||||
if (!valid) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (is_ipv4())
|
||||
if (is_ipv4()) {
|
||||
// IPv4 address mapped to IPv6
|
||||
return itos(field8[12]) + "." + itos(field8[13]) + "." + itos(field8[14]) + "." + itos(field8[15]);
|
||||
}
|
||||
String ret;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (i > 0)
|
||||
if (i > 0) {
|
||||
ret = ret + ":";
|
||||
}
|
||||
uint16_t num = (field8[i * 2] << 8) + field8[i * 2 + 1];
|
||||
ret = ret + String::num_int64(num, 16);
|
||||
};
|
||||
@@ -187,8 +191,9 @@ const uint8_t *IP_Address::get_ipv6() const {
|
||||
void IP_Address::set_ipv6(const uint8_t *p_buf) {
|
||||
clear();
|
||||
valid = true;
|
||||
for (int i = 0; i < 16; i++)
|
||||
for (int i = 0; i < 16; i++) {
|
||||
field8[i] = p_buf[i];
|
||||
}
|
||||
}
|
||||
|
||||
IP_Address::IP_Address(const String &p_string) {
|
||||
|
||||
Reference in New Issue
Block a user