diff options
author | Chris Wilson <chris+github@qwirx.com> | 2017-10-12 21:27:54 +0100 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2017-10-16 22:02:32 +0100 |
commit | a631c82882b039f8467a2ef9abeb343f2ec5b3da (patch) | |
tree | b0ae4a2304e386aef4ef031b9d565116e0fa7f02 /lib/common | |
parent | fea4efbf5648dddb63f51b4b076baceb872be87b (diff) |
Fix -Wundefined-bool-conversion compile failure of master branch
Master build fails with: lib/common/Timer.cpp:171:10: error: reference cannot
be bound to dereferenced null pointer in well-defined C++ code; pointer may be
assumed to always convert to true [-Werror,-Wundefined-bool-conversion].
Cannot get regtests to pass on this feature branch without fixing this.
Also remove unused code from Timers.
Diffstat (limited to 'lib/common')
-rw-r--r-- | lib/common/Timer.cpp | 24 | ||||
-rw-r--r-- | lib/common/Timer.h | 1 |
2 files changed, 0 insertions, 25 deletions
diff --git a/lib/common/Timer.cpp b/lib/common/Timer.cpp index 6ce84b7d..4f8c989e 100644 --- a/lib/common/Timer.cpp +++ b/lib/common/Timer.cpp @@ -123,26 +123,6 @@ void Timers::Cleanup(bool throw_exception_if_not_initialised) // -------------------------------------------------------------------------- // // Function -// Name: static void Timers::AssertInitialised() -// Purpose: Throw an assertion error if timers are not ready -// NOW. It's a common mistake (for me) when writing -// tests to forget to initialise timers first. -// Created: 15/05/2014 -// -// -------------------------------------------------------------------------- - -void Timers::AssertInitialised() -{ - if (!spTimers) - { - THROW_EXCEPTION(CommonException, TimersNotInitialised); - } - ASSERT(spTimers); -} - -// -------------------------------------------------------------------------- -// -// Function // Name: static void Timers::Add(Timer&) // Purpose: Add a new timer to the set, and reschedule next wakeup // Created: 5/11/2006 @@ -151,7 +131,6 @@ void Timers::AssertInitialised() void Timers::Add(Timer& rTimer) { ASSERT(spTimers); - ASSERT(&rTimer); BOX_TRACE(TIMER_ID_OF(rTimer) " added to global queue, rescheduling"); spTimers->push_back(&rTimer); Reschedule(); @@ -168,8 +147,6 @@ void Timers::Add(Timer& rTimer) // -------------------------------------------------------------------------- void Timers::Remove(Timer& rTimer) { - ASSERT(&rTimer); - if(!spTimers) { BOX_WARNING(TIMER_ID_OF(rTimer) " was still active after " @@ -343,7 +320,6 @@ void Timers::Reschedule() // -------------------------------------------------------------------------- void Timers::SignalHandler(int unused) { - // ASSERT(spTimers); Timers::RequestReschedule(); } diff --git a/lib/common/Timer.h b/lib/common/Timer.h index 68592aaa..17233203 100644 --- a/lib/common/Timer.h +++ b/lib/common/Timer.h @@ -44,7 +44,6 @@ class Timers public: static void Init(); static void Cleanup(bool throw_exception_if_not_initialised = true); - static void AssertInitialised(); static void Add (Timer& rTimer); static void Remove(Timer& rTimer); static void RequestReschedule(); |