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
@@ -537,8 +537,7 @@ void SetupEngines()
|
||||
/* Assert is safe; there won't be more than 256 original vehicles
|
||||
* in any case, and we just cleaned the pool. */
|
||||
assert(Engine::CanAllocateItem());
|
||||
const Engine *e = new Engine(eid.type, eid.internal_id);
|
||||
(void)e; // assert only
|
||||
[[maybe_unused]] const Engine *e = new Engine(eid.type, eid.internal_id);
|
||||
assert(e->index == index);
|
||||
index++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user