Codechange: Suppress warnings when asserts are disabled (#8916)

This commit is contained in:
Charles Pigott
2021-04-01 09:03:12 +01:00
committed by GitHub
parent 088964a091
commit 591ea9862d
5 changed files with 14 additions and 9 deletions

View File

@@ -61,13 +61,14 @@ protected:
name(name), description(description)
{
if (usable) {
Blitters &blitters = GetBlitters();
assert(blitters.find(this->name) == blitters.end());
/*
* Only add when the blitter is usable. Do not bail out or
* do more special things since the blitters are always
* instantiated upon start anyhow and freed upon shutdown.
*/
std::pair<Blitters::iterator, bool> P = GetBlitters().insert(Blitters::value_type(this->name, this));
assert(P.second);
blitters.insert(Blitters::value_type(this->name, this));
} else {
DEBUG(driver, 1, "Not registering blitter %s as it is not usable", name);
}