You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
This commit is contained in:
@@ -76,7 +76,6 @@
|
||||
#endif
|
||||
|
||||
static IP_Address _sockaddr2ip(struct sockaddr *p_addr) {
|
||||
|
||||
IP_Address ip;
|
||||
|
||||
if (p_addr->sa_family == AF_INET) {
|
||||
@@ -91,7 +90,6 @@ static IP_Address _sockaddr2ip(struct sockaddr *p_addr) {
|
||||
};
|
||||
|
||||
IP_Address IP_Unix::_resolve_hostname(const String &p_hostname, Type p_type) {
|
||||
|
||||
struct addrinfo hints;
|
||||
struct addrinfo *result;
|
||||
|
||||
@@ -132,7 +130,6 @@ IP_Address IP_Unix::_resolve_hostname(const String &p_hostname, Type p_type) {
|
||||
#if defined(UWP_ENABLED)
|
||||
|
||||
void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) const {
|
||||
|
||||
using namespace Windows::Networking;
|
||||
using namespace Windows::Networking::Connectivity;
|
||||
|
||||
@@ -140,7 +137,6 @@ void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) co
|
||||
auto hostnames = NetworkInformation::GetHostNames();
|
||||
|
||||
for (int i = 0; i < hostnames->Size; i++) {
|
||||
|
||||
auto hostname = hostnames->GetAt(i);
|
||||
|
||||
if (hostname->Type != HostNameType::Ipv4 && hostname->Type != HostNameType::Ipv6)
|
||||
@@ -167,12 +163,10 @@ void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) co
|
||||
#else
|
||||
|
||||
void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) const {
|
||||
|
||||
ULONG buf_size = 1024;
|
||||
IP_ADAPTER_ADDRESSES *addrs;
|
||||
|
||||
while (true) {
|
||||
|
||||
addrs = (IP_ADAPTER_ADDRESSES *)memalloc(buf_size);
|
||||
int err = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_SKIP_FRIENDLY_NAME,
|
||||
nullptr, addrs, &buf_size);
|
||||
@@ -190,7 +184,6 @@ void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) co
|
||||
IP_ADAPTER_ADDRESSES *adapter = addrs;
|
||||
|
||||
while (adapter != nullptr) {
|
||||
|
||||
Interface_Info info;
|
||||
info.name = adapter->AdapterName;
|
||||
info.name_friendly = adapter->FriendlyName;
|
||||
@@ -218,7 +211,6 @@ void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) co
|
||||
#else // UNIX
|
||||
|
||||
void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) const {
|
||||
|
||||
struct ifaddrs *ifAddrStruct = nullptr;
|
||||
struct ifaddrs *ifa = nullptr;
|
||||
int family;
|
||||
@@ -254,12 +246,10 @@ void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) co
|
||||
#endif
|
||||
|
||||
void IP_Unix::make_default() {
|
||||
|
||||
_create = _create_unix;
|
||||
}
|
||||
|
||||
IP *IP_Unix::_create_unix() {
|
||||
|
||||
return memnew(IP_Unix);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user