diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/error/error_macros.h | 10 | ||||
-rw-r--r-- | core/io/file_access.cpp | 2 | ||||
-rw-r--r-- | core/templates/paged_array.h | 6 |
3 files changed, 17 insertions, 1 deletions
diff --git a/core/error/error_macros.h b/core/error/error_macros.h index c8182975d5..016c963e04 100644 --- a/core/error/error_macros.h +++ b/core/error/error_macros.h @@ -812,4 +812,14 @@ void _err_flush_stdout(); #define DEV_ASSERT(m_cond) #endif +#ifdef DEV_ENABLED +#define DEV_CHECK_ONCE(m_cond) \ + if (unlikely(!(m_cond))) { \ + ERR_PRINT_ONCE("DEV_CHECK_ONCE failed \"" _STR(m_cond) "\" is false."); \ + } else \ + ((void)0) +#else +#define DEV_CHECK_ONCE(m_cond) +#endif + #endif // ERROR_MACROS_H diff --git a/core/io/file_access.cpp b/core/io/file_access.cpp index 6026dbf896..55286277fa 100644 --- a/core/io/file_access.cpp +++ b/core/io/file_access.cpp @@ -38,7 +38,7 @@ #include "core/io/marshalls.h" #include "core/os/os.h" -FileAccess::CreateFunc FileAccess::create_func[ACCESS_MAX] = { nullptr, nullptr }; +FileAccess::CreateFunc FileAccess::create_func[ACCESS_MAX] = {}; FileAccess::FileCloseFailNotify FileAccess::close_fail_notify = nullptr; diff --git a/core/templates/paged_array.h b/core/templates/paged_array.h index 69a792958a..6b7e0cee16 100644 --- a/core/templates/paged_array.h +++ b/core/templates/paged_array.h @@ -229,6 +229,12 @@ public: count--; } + void remove_at_unordered(uint64_t p_index) { + ERR_FAIL_UNSIGNED_INDEX(p_index, count); + (*this)[p_index] = (*this)[count - 1]; + pop_back(); + } + void clear() { //destruct if needed if (!std::is_trivially_destructible<T>::value) { |