You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
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.
This commit is contained in:
@@ -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("/", "");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user