Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Win32/64 binary packages automatically #20

Merged
merged 9 commits into from
Nov 30, 2017
Prev Previous commit
Next Next commit
Remove invalid use of null references (undefined behaviour)
Enable the relevant compiler warning as an error, if supported
(-Werror=undefined-bool-conversion).

http://www.gotw.ca/conv/002.htm
http://stackoverflow.com/questions/2165078/a-reference-can-not-be-null-or-it-can-be-null

(cherry picked from commit f2911ac)
(cherry picked from commit 5a50b98)
  • Loading branch information
qris committed Nov 26, 2017
commit 447c2cd3d6884b8383884dbbfe65db845ea5c04d
3 changes: 0 additions & 3 deletions lib/common/Timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,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();
Expand All @@ -168,8 +167,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 "
Expand Down
9 changes: 5 additions & 4 deletions test/common/testcommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,11 @@ int test(int argc, const char *argv[])
// Check that using timer methods without initialisation
// throws an assertion failure. Can only do this in debug mode
#ifndef BOX_RELEASE_BUILD
TEST_CHECK_THROWS(Timers::Add(*(Timer*)NULL),
CommonException, AssertFailed);
TEST_CHECK_THROWS(Timers::Remove(*(Timer*)NULL),
CommonException, AssertFailed);
{
Timer tim(0, "tim");
TEST_CHECK_THROWS(Timers::Add(tim), CommonException, AssertFailed);
Timers::Remove(tim);
}
#endif

// TEST_CHECK_THROWS(Timers::Signal(), CommonException, AssertFailed);
Expand Down