summaryrefslogtreecommitdiff
path: root/src/autoreplace_cmd.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-06-03 16:55:08 +0200
committerPatric Stout <github@truebrain.nl>2021-06-03 17:30:00 +0200
commit28e90769f74e55ea7c8f75146d5b33e0aa777da8 (patch)
treeeeff0974346ef9da7cbc2b33b040d016c341ff0b /src/autoreplace_cmd.cpp
parentf8dd5dd00a7aa3cc5769b4bce0a1b7a63073c8ce (diff)
downloadopenttd-28e90769f74e55ea7c8f75146d5b33e0aa777da8.tar.xz
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.
Diffstat (limited to 'src/autoreplace_cmd.cpp')
-rw-r--r--src/autoreplace_cmd.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index de5617a4d..9e82944b6 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -596,8 +596,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon
assert(RailVehInfo(wagon->engine_type)->railveh_type == RAILVEH_WAGON);
/* Sell wagon */
- CommandCost ret = DoCommand(0, wagon->index, 0, DC_EXEC, GetCmdSellVeh(wagon));
- (void)ret; // assert only
+ [[maybe_unused]] CommandCost ret = DoCommand(0, wagon->index, 0, DC_EXEC, GetCmdSellVeh(wagon));
assert(ret.Succeeded());
new_vehs[i] = nullptr;
@@ -650,8 +649,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon
assert(Train::From(old_head)->GetNextUnit() == nullptr);
for (int i = num_units - 1; i > 0; i--) {
- CommandCost ret = CmdMoveVehicle(old_vehs[i], old_head, DC_EXEC | DC_AUTOREPLACE, false);
- (void)ret; // assert only
+ [[maybe_unused]] CommandCost ret = CmdMoveVehicle(old_vehs[i], old_head, DC_EXEC | DC_AUTOREPLACE, false);
assert(ret.Succeeded());
}
}