# HG changeset patch # User truelight # Date 2007-07-14 20:21:02 # Node ID 0859ae18a30cb554e563daa2c6edf2445efff4c2 # Parent dfc7cf035dbe1e0a23dd50e642a8c16e7aa48bcd (svn r10561) -Fix: don't give 'unused variable' warnings when disabling asserts diff --git a/src/blitter/factory.hpp b/src/blitter/factory.hpp --- 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 P = GetBlitters().insert(Blitters::value_type(name, this)); +#if !defined(NDEBUG) + /* NDEBUG disables asserts and gives a warning: unused variable 'P' */ + std::pair P = +#endif /* !NDEBUG */ + GetBlitters().insert(Blitters::value_type(name, this)); assert(P.second); } diff --git a/src/driver.h b/src/driver.h --- 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 P = GetDrivers().insert(Drivers::value_type(buf, this)); +#if !defined(NDEBUG) + /* NDEBUG disables asserts and gives a warning: unused variable 'P' */ + std::pair P = +#endif /* !NDEBUG */ + GetDrivers().insert(Drivers::value_type(buf, this)); assert(P.second); }