mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 22:28:56 +00:00
(svn r10561) -Fix: don't give 'unused variable' warnings when disabling asserts
This commit is contained in:
parent
452d20487e
commit
a2a3b7da24
@ -39,7 +39,11 @@ protected:
|
||||
if (name == NULL) return;
|
||||
|
||||
this->name = strdup(name);
|
||||
std::pair<Blitters::iterator, bool> P = GetBlitters().insert(Blitters::value_type(name, this));
|
||||
#if !defined(NDEBUG)
|
||||
/* NDEBUG disables asserts and gives a warning: unused variable 'P' */
|
||||
std::pair<Blitters::iterator, bool> P =
|
||||
#endif /* !NDEBUG */
|
||||
GetBlitters().insert(Blitters::value_type(name, this));
|
||||
assert(P.second);
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,11 @@ protected:
|
||||
strecpy(buf, GetDriverTypeName(type), lastof(buf));
|
||||
strecpy(buf + 5, name, lastof(buf));
|
||||
|
||||
std::pair<Drivers::iterator, bool> P = GetDrivers().insert(Drivers::value_type(buf, this));
|
||||
#if !defined(NDEBUG)
|
||||
/* NDEBUG disables asserts and gives a warning: unused variable 'P' */
|
||||
std::pair<Drivers::iterator, bool> P =
|
||||
#endif /* !NDEBUG */
|
||||
GetDrivers().insert(Drivers::value_type(buf, this));
|
||||
assert(P.second);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user