You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +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:
@@ -113,8 +113,9 @@ IP_Address IP_Unix::_resolve_hostname(const String &p_hostname, Type p_type) {
|
||||
|
||||
if (result == nullptr || result->ai_addr == nullptr) {
|
||||
ERR_PRINT("Invalid response from getaddrinfo");
|
||||
if (result)
|
||||
if (result) {
|
||||
freeaddrinfo(result);
|
||||
}
|
||||
return IP_Address();
|
||||
};
|
||||
|
||||
@@ -218,13 +219,15 @@ void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) co
|
||||
getifaddrs(&ifAddrStruct);
|
||||
|
||||
for (ifa = ifAddrStruct; ifa != nullptr; ifa = ifa->ifa_next) {
|
||||
if (!ifa->ifa_addr)
|
||||
if (!ifa->ifa_addr) {
|
||||
continue;
|
||||
}
|
||||
|
||||
family = ifa->ifa_addr->sa_family;
|
||||
|
||||
if (family != AF_INET && family != AF_INET6)
|
||||
if (family != AF_INET && family != AF_INET6) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Map<String, Interface_Info>::Element *E = r_interfaces->find(ifa->ifa_name);
|
||||
if (!E) {
|
||||
@@ -240,8 +243,9 @@ void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) co
|
||||
info.ip_addresses.push_front(_sockaddr2ip(ifa->ifa_addr));
|
||||
}
|
||||
|
||||
if (ifAddrStruct != nullptr)
|
||||
if (ifAddrStruct != nullptr) {
|
||||
freeifaddrs(ifAddrStruct);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user