From 860c270c73048b4930ac8cbebcd60be746eb9782 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Sun, 27 Dec 2020 10:44:22 +0000 Subject: Codechange: Replace assert_compile macro with static_assert --- src/vehicle.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/vehicle.cpp') diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 3ed7cb1b0..e014944a9 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -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: -- cgit v1.2.3-54-g00ecf