summaryrefslogtreecommitdiff
path: root/src/cmd_helper.h
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/cmd_helper.h
parent395a5d9991b500c681ff384f8d3b4e153e687abb (diff)
downloadopenttd-860c270c73048b4930ac8cbebcd60be746eb9782.tar.xz
Codechange: Replace assert_compile macro with static_assert
Diffstat (limited to 'src/cmd_helper.h')
-rw-r--r--src/cmd_helper.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd_helper.h b/src/cmd_helper.h
index a505c1fd8..ceb4d4bd9 100644
--- a/src/cmd_helper.h
+++ b/src/cmd_helper.h
@@ -24,9 +24,9 @@
template<typename T, uint S, uint N, typename U> static inline T Extract(U v)
{
/* Check if there are enough bits in v */
- assert_compile(N == EnumPropsT<T>::num_bits);
- assert_compile(S + N <= sizeof(U) * 8);
- assert_compile(EnumPropsT<T>::end <= (1 << N));
+ static_assert(N == EnumPropsT<T>::num_bits);
+ static_assert(S + N <= sizeof(U) * 8);
+ static_assert(EnumPropsT<T>::end <= (1 << N));
U masked = GB(v, S, N);
return IsInsideMM(masked, EnumPropsT<T>::begin, EnumPropsT<T>::end) ? (T)masked : EnumPropsT<T>::invalid;
}