Codechange: Replace assert_compile macro with static_assert
This commit is contained in:
@@ -1935,7 +1935,7 @@ static PaletteID GetEngineColourMap(EngineID engine_type, CompanyID company, Eng
|
||||
uint16 callback = GetVehicleCallback(CBID_VEHICLE_COLOUR_MAPPING, 0, 0, engine_type, v);
|
||||
/* Failure means "use the default two-colour" */
|
||||
if (callback != CALLBACK_FAILED) {
|
||||
assert_compile(PAL_NONE == 0); // Returning 0x4000 (resp. 0xC000) coincidences with default value (PAL_NONE)
|
||||
static_assert(PAL_NONE == 0); // Returning 0x4000 (resp. 0xC000) coincidences with default value (PAL_NONE)
|
||||
map = GB(callback, 0, 14);
|
||||
/* If bit 14 is set, then the company colours are applied to the
|
||||
* map else it's returned as-is. */
|
||||
@@ -2552,9 +2552,9 @@ void Vehicle::ShowVisualEffect() const
|
||||
} else {
|
||||
effect_model = (VisualEffectSpawnModel)GB(v->vcache.cached_vis_effect, VE_TYPE_START, VE_TYPE_COUNT);
|
||||
assert(effect_model != (VisualEffectSpawnModel)VE_TYPE_DEFAULT); // should have been resolved by UpdateVisualEffect
|
||||
assert_compile((uint)VESM_STEAM == (uint)VE_TYPE_STEAM);
|
||||
assert_compile((uint)VESM_DIESEL == (uint)VE_TYPE_DIESEL);
|
||||
assert_compile((uint)VESM_ELECTRIC == (uint)VE_TYPE_ELECTRIC);
|
||||
static_assert((uint)VESM_STEAM == (uint)VE_TYPE_STEAM);
|
||||
static_assert((uint)VESM_DIESEL == (uint)VE_TYPE_DIESEL);
|
||||
static_assert((uint)VESM_ELECTRIC == (uint)VE_TYPE_ELECTRIC);
|
||||
}
|
||||
|
||||
/* Show no smoke when:
|
||||
|
Reference in New Issue
Block a user