diff options
author | truelight <truelight@openttd.org> | 2007-07-14 20:21:02 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-07-14 20:21:02 +0000 |
commit | 68c5bcf9601efd3f311a27d833d3242d10068ee8 (patch) | |
tree | 4c8b57b8e23fe39ea37d32a534df3efce2864753 | |
parent | 08780621cca62b9555c4d07b5d68cef668442c44 (diff) | |
download | openttd-68c5bcf9601efd3f311a27d833d3242d10068ee8.tar.xz |
(svn r10561) -Fix: don't give 'unused variable' warnings when disabling asserts
-rw-r--r-- | src/blitter/factory.hpp | 6 | ||||
-rw-r--r-- | src/driver.h | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/blitter/factory.hpp b/src/blitter/factory.hpp index 8f289c2ce..beb35cba5 100644 --- a/src/blitter/factory.hpp +++ b/src/blitter/factory.hpp @@ -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); } diff --git a/src/driver.h b/src/driver.h index a57e62459..fa16cd24c 100644 --- a/src/driver.h +++ b/src/driver.h @@ -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); } |