Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this is always set if assert() is valid. No matter if NDEBUG is set or not.
This commit is contained in:

committed by
Patric Stout

parent
f8dd5dd00a
commit
28e90769f7
@@ -1846,8 +1846,7 @@ static void ChangeTileOwner_TunnelBridge(TileIndex tile, Owner old_owner, Owner
|
||||
if (tt == TRANSPORT_RAIL) {
|
||||
/* Since all of our vehicles have been removed, it is safe to remove the rail
|
||||
* bridge / tunnel. */
|
||||
CommandCost ret = DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR);
|
||||
(void)ret; // assert only
|
||||
[[maybe_unused]] CommandCost ret = DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR);
|
||||
assert(ret.Succeeded());
|
||||
} else {
|
||||
/* In any other case, we can safely reassign the ownership to OWNER_NONE. */
|
||||
|
Reference in New Issue
Block a user