1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +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:
Rémi Verschelde
2020-05-10 12:56:01 +02:00
parent 03b13e0c69
commit e956e80c1f
130 changed files with 967 additions and 511 deletions

View File

@@ -145,7 +145,8 @@ struct DirAccessRef {
DirAccess *f;
DirAccessRef(DirAccess *fa) { f = fa; }
~DirAccessRef() {
if (f) memdelete(f);
if (f)
memdelete(f);
}
};

View File

@@ -192,7 +192,8 @@ struct FileAccessRef {
operator FileAccess *() { return f; }
FileAccessRef(FileAccess *fa) { f = fa; }
~FileAccessRef() {
if (f) memdelete(f);
if (f)
memdelete(f);
}
};

View File

@@ -130,9 +130,10 @@ void memdelete_allocator(T *p_class) {
A::free(p_class);
}
#define memdelete_notnull(m_v) \
{ \
if (m_v) memdelete(m_v); \
#define memdelete_notnull(m_v) \
{ \
if (m_v) \
memdelete(m_v); \
}
#define memnew_arr(m_class, m_count) memnew_arr_template<m_class>(m_count)

View File

@@ -58,10 +58,12 @@ class RWLockRead {
public:
RWLockRead(const RWLock *p_lock) {
lock = const_cast<RWLock *>(p_lock);
if (lock) lock->read_lock();
if (lock)
lock->read_lock();
}
~RWLockRead() {
if (lock) lock->read_unlock();
if (lock)
lock->read_unlock();
}
};
@@ -72,10 +74,12 @@ class RWLockWrite {
public:
RWLockWrite(RWLock *p_lock) {
lock = p_lock;
if (lock) lock->write_lock();
if (lock)
lock->write_lock();
}
~RWLockWrite() {
if (lock) lock->write_unlock();
if (lock)
lock->write_unlock();
}
};