summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-10 12:56:01 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-10 13:12:16 +0200
commite956e80c1fa1cc8aefcb1533e5acf5cf3c8ffdd9 (patch)
tree8f162f9162ca0dfa35841a9c734a0529764cb458 /core/io
parent03b13e0c695bb63043c3ca8665083bae1960aca4 (diff)
Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
Diffstat (limited to 'core/io')
-rw-r--r--core/io/file_access_pack.cpp3
-rw-r--r--core/io/ip_address.h12
-rw-r--r--core/io/marshalls.h3
-rw-r--r--core/io/multiplayer_api.cpp8
-rw-r--r--core/io/resource_loader.h6
5 files changed, 21 insertions, 11 deletions
diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp
index 0a7dee9444..fd9b83eaf9 100644
--- a/core/io/file_access_pack.cpp
+++ b/core/io/file_access_pack.cpp
@@ -414,7 +414,8 @@ Error DirAccessPack::change_dir(String p_dir) {
nd = nd.simplify_path();
- if (nd == "") nd = ".";
+ if (nd == "")
+ nd = ".";
if (nd.begins_with("/")) {
nd = nd.replace_first("/", "");
diff --git a/core/io/ip_address.h b/core/io/ip_address.h
index 89cf37ff8f..a59178063d 100644
--- a/core/io/ip_address.h
+++ b/core/io/ip_address.h
@@ -52,16 +52,20 @@ protected:
public:
//operator Variant() const;
bool operator==(const IP_Address &p_ip) const {
- if (p_ip.valid != valid) return false;
- if (!valid) return false;
+ if (p_ip.valid != valid)
+ return false;
+ if (!valid)
+ return false;
for (int i = 0; i < 4; i++)
if (field32[i] != p_ip.field32[i])
return false;
return true;
}
bool operator!=(const IP_Address &p_ip) const {
- if (p_ip.valid != valid) return true;
- if (!valid) return true;
+ if (p_ip.valid != valid)
+ return true;
+ if (!valid)
+ return true;
for (int i = 0; i < 4; i++)
if (field32[i] != p_ip.field32[i])
return true;
diff --git a/core/io/marshalls.h b/core/io/marshalls.h
index d029ed238c..650c95364a 100644
--- a/core/io/marshalls.h
+++ b/core/io/marshalls.h
@@ -121,7 +121,8 @@ static inline int encode_cstring(const char *p_string, uint8_t *p_data) {
len++;
};
- if (p_data) *p_data = 0;
+ if (p_data)
+ *p_data = 0;
return len + 1;
}
diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp
index 3bec52416e..94e2fdb72c 100644
--- a/core/io/multiplayer_api.cpp
+++ b/core/io/multiplayer_api.cpp
@@ -144,7 +144,8 @@ void MultiplayerAPI::set_root_node(Node *p_node) {
void MultiplayerAPI::set_network_peer(const Ref<NetworkedMultiplayerPeer> &p_peer) {
- if (p_peer == network_peer) return; // Nothing to do
+ if (p_peer == network_peer)
+ return; // Nothing to do
ERR_FAIL_COND_MSG(p_peer.is_valid() && p_peer->get_connection_status() == NetworkedMultiplayerPeer::CONNECTION_DISCONNECTED,
"Supplied NetworkedMultiplayerPeer must be connecting or connected.");
@@ -787,8 +788,9 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p
int ofs = 0;
-#define MAKE_ROOM(m_amount) \
- if (packet_cache.size() < m_amount) packet_cache.resize(m_amount);
+#define MAKE_ROOM(m_amount) \
+ if (packet_cache.size() < m_amount) \
+ packet_cache.resize(m_amount);
// Encode meta.
// The meta is composed by a single byte that contains (starting from the least segnificant bit):
diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h
index 2d95d5545f..b10c08d693 100644
--- a/core/io/resource_loader.h
+++ b/core/io/resource_loader.h
@@ -160,7 +160,8 @@ public:
static bool get_timestamp_on_load() { return timestamp_on_load; }
static void notify_load_error(const String &p_err) {
- if (err_notify) err_notify(err_notify_ud, p_err);
+ if (err_notify)
+ err_notify(err_notify_ud, p_err);
}
static void set_error_notify_func(void *p_ud, ResourceLoadErrorNotify p_err_notify) {
err_notify = p_err_notify;
@@ -168,7 +169,8 @@ public:
}
static void notify_dependency_error(const String &p_path, const String &p_dependency, const String &p_type) {
- if (dep_err_notify) dep_err_notify(dep_err_notify_ud, p_path, p_dependency, p_type);
+ if (dep_err_notify)
+ dep_err_notify(dep_err_notify_ud, p_path, p_dependency, p_type);
}
static void set_dependency_error_notify_func(void *p_ud, DependencyErrorNotify p_err_notify) {
dep_err_notify = p_err_notify;