diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2020-12-27 09:56:43 +0000 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2020-12-27 10:30:55 +0000 |
commit | 52f3abba6ef2e5a69b58cf71fdcdaa75d603b062 (patch) | |
tree | 6820fbe56413636b766fc4d50d88995d0dd34338 | |
parent | d8605ad18da2a00fceb72b38325374b341ac6f16 (diff) | |
download | openttd-52f3abba6ef2e5a69b58cf71fdcdaa75d603b062.tar.xz |
Cleanup: Remove unnecessary assert_tcompile macro
-rw-r--r-- | src/cargopacket.cpp | 4 | ||||
-rw-r--r-- | src/cmd_helper.h | 6 | ||||
-rw-r--r-- | src/stdafx.h | 7 |
3 files changed, 6 insertions, 11 deletions
diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp index f5f7c0c03..08b72ec46 100644 --- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -556,8 +556,8 @@ void VehicleCargoList::InvalidateCache() template<VehicleCargoList::MoveToAction Tfrom, VehicleCargoList::MoveToAction Tto> uint VehicleCargoList::Reassign(uint max_move, TileOrStationID) { - assert_tcompile(Tfrom != MTA_TRANSFER && Tto != MTA_TRANSFER); - assert_tcompile(Tfrom - Tto == 1 || Tto - Tfrom == 1); + assert_compile(Tfrom != MTA_TRANSFER && Tto != MTA_TRANSFER); + assert_compile(Tfrom - Tto == 1 || Tto - Tfrom == 1); max_move = min(this->action_counts[Tfrom], max_move); this->action_counts[Tfrom] -= max_move; this->action_counts[Tto] += max_move; diff --git a/src/cmd_helper.h b/src/cmd_helper.h index ee5d445c2..a505c1fd8 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_tcompile(N == EnumPropsT<T>::num_bits); - assert_tcompile(S + N <= sizeof(U) * 8); - assert_tcompile(EnumPropsT<T>::end <= (1 << N)); + assert_compile(N == EnumPropsT<T>::num_bits); + assert_compile(S + N <= sizeof(U) * 8); + assert_compile(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; } diff --git a/src/stdafx.h b/src/stdafx.h index c421c55aa..5b9281a28 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -348,19 +348,14 @@ typedef unsigned char byte; # define PERSONAL_DIR "" #endif -/* Compile time assertions. Prefer c++0x static_assert(). - * Older compilers cannot evaluate some expressions at compile time, - * typically when templates are involved, try assert_tcompile() in those cases. */ +/* Compile time assertions. Prefer c++0x static_assert(). */ #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600) # define assert_compile(expr) static_assert(expr, #expr ) -# define assert_tcompile(expr) assert_compile(expr) #elif defined(__OS2__) /* Disabled for OS/2 */ # define assert_compile(expr) -# define assert_tcompile(expr) assert_compile(expr) #else # define assert_compile(expr) typedef int __ct_assert__[1 - 2 * !(expr)] -# define assert_tcompile(expr) assert(expr) #endif /* Check if the types have the bitsizes like we are using them */ |