summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2020-12-27 10:44:22 +0000
committerCharles Pigott <charlespigott@googlemail.com>2020-12-27 10:55:42 +0000
commit860c270c73048b4930ac8cbebcd60be746eb9782 (patch)
treea88a8acb208cf426ae8fac05dda202c57b59426a /src/core
parent395a5d9991b500c681ff384f8d3b4e153e687abb (diff)
downloadopenttd-860c270c73048b4930ac8cbebcd60be746eb9782.tar.xz
Codechange: Replace assert_compile macro with static_assert
Diffstat (limited to 'src/core')
-rw-r--r--src/core/math_func.hpp2
-rw-r--r--src/core/pool_type.hpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/core/math_func.hpp b/src/core/math_func.hpp
index d36dc55f9..55061066a 100644
--- a/src/core/math_func.hpp
+++ b/src/core/math_func.hpp
@@ -112,7 +112,7 @@ static inline T Align(const T x, uint n)
template <typename T>
static inline T *AlignPtr(T *x, uint n)
{
- assert_compile(sizeof(size_t) == sizeof(void *));
+ static_assert(sizeof(size_t) == sizeof(void *));
return reinterpret_cast<T *>(Align((size_t)x, n));
}
diff --git a/src/core/pool_type.hpp b/src/core/pool_type.hpp
index 9e6fc8fec..e847dfbb7 100644
--- a/src/core/pool_type.hpp
+++ b/src/core/pool_type.hpp
@@ -80,7 +80,7 @@ private:
template <class Titem, typename Tindex, size_t Tgrowth_step, size_t Tmax_size, PoolType Tpool_type = PT_NORMAL, bool Tcache = false, bool Tzero = true>
struct Pool : PoolBase {
/* Ensure Tmax_size is within the bounds of Tindex. */
- assert_compile((uint64)(Tmax_size - 1) >> 8 * sizeof(Tindex) == 0);
+ static_assert((uint64)(Tmax_size - 1) >> 8 * sizeof(Tindex) == 0);
static const size_t MAX_SIZE = Tmax_size; ///< Make template parameter accessible from outside