diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-10 15:38:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-10 15:38:53 +0200 |
commit | 6ab92464bc6356f3342c3efd1fc1bb1a5e4467d5 (patch) | |
tree | 405a85e89e036e2240c74ee850121d912e21704b /core/os | |
parent | 54b20a25b90c8c8d8dfd7f68d66d0ec57c71435f (diff) | |
parent | 69de7ce38c40c57a1fabe12c9e5a3eab903a4035 (diff) |
Merge pull request #38621 from akien-mga/stylé-comme-jamais
Style: clang-format: Disable if statements and case labels on single line
Diffstat (limited to 'core/os')
-rw-r--r-- | core/os/dir_access.cpp | 21 | ||||
-rw-r--r-- | core/os/dir_access.h | 3 | ||||
-rw-r--r-- | core/os/file_access.cpp | 3 | ||||
-rw-r--r-- | core/os/file_access.h | 3 | ||||
-rw-r--r-- | core/os/memory.h | 7 | ||||
-rw-r--r-- | core/os/rw_lock.h | 12 |
6 files changed, 32 insertions, 17 deletions
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index 94c8cd5d73..b26cd46fd8 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -39,18 +39,24 @@ String DirAccess::_get_root_path() const { switch (_access_type) { - case ACCESS_RESOURCES: return ProjectSettings::get_singleton()->get_resource_path(); - case ACCESS_USERDATA: return OS::get_singleton()->get_user_data_dir(); - default: return ""; + case ACCESS_RESOURCES: + return ProjectSettings::get_singleton()->get_resource_path(); + case ACCESS_USERDATA: + return OS::get_singleton()->get_user_data_dir(); + default: + return ""; } } String DirAccess::_get_root_string() const { switch (_access_type) { - case ACCESS_RESOURCES: return "res://"; - case ACCESS_USERDATA: return "user://"; - default: return ""; + case ACCESS_RESOURCES: + return "res://"; + case ACCESS_USERDATA: + return "user://"; + default: + return ""; } } @@ -220,7 +226,8 @@ String DirAccess::fix_path(String p_path) const { return p_path; } break; - case ACCESS_MAX: break; // Can't happen, but silences warning + case ACCESS_MAX: + break; // Can't happen, but silences warning } return p_path; diff --git a/core/os/dir_access.h b/core/os/dir_access.h index 60eb553968..6c876cde5a 100644 --- a/core/os/dir_access.h +++ b/core/os/dir_access.h @@ -145,7 +145,8 @@ struct DirAccessRef { DirAccess *f; DirAccessRef(DirAccess *fa) { f = fa; } ~DirAccessRef() { - if (f) memdelete(f); + if (f) + memdelete(f); } }; diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index 3922f031b7..7055780f34 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -163,7 +163,8 @@ String FileAccess::fix_path(const String &p_path) const { return r_path; } break; - case ACCESS_MAX: break; // Can't happen, but silences warning + case ACCESS_MAX: + break; // Can't happen, but silences warning } return r_path; diff --git a/core/os/file_access.h b/core/os/file_access.h index 010cc74a87..0f85c447b6 100644 --- a/core/os/file_access.h +++ b/core/os/file_access.h @@ -192,7 +192,8 @@ struct FileAccessRef { operator FileAccess *() { return f; } FileAccessRef(FileAccess *fa) { f = fa; } ~FileAccessRef() { - if (f) memdelete(f); + if (f) + memdelete(f); } }; diff --git a/core/os/memory.h b/core/os/memory.h index dcaedd92ba..d377d54fad 100644 --- a/core/os/memory.h +++ b/core/os/memory.h @@ -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) diff --git a/core/os/rw_lock.h b/core/os/rw_lock.h index 64dfbef20c..2ef4df9b70 100644 --- a/core/os/rw_lock.h +++ b/core/os/rw_lock.h @@ -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(); } }; |