]> Dogcows Code - chaz/yoink/commitdiff
sleep forever bug fixed
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Mon, 30 Nov 2009 01:33:03 +0000 (18:33 -0700)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Mon, 30 Nov 2009 01:33:03 +0000 (18:33 -0700)
src/MainLayer.cc
src/Moof/Log.hh
src/Moof/Timer.cc

index 3429f52c5663f932b677407ab6c904a33d875c62..6a426fb8f41c89cfba117571a945a554854fffb9 100644 (file)
@@ -129,13 +129,8 @@ bool MainLayer::handleEvent(const Mf::Event& event)
 
 void MainLayer::quit()
 {
-#if NDEBUG
-       // we don't really need to unwind the stack and shut everything down because
-       // the operating system will take care of cleaning up
-       exit(0);
-#else
+       // remove all the layers
        mEngine->clear();
-#endif
 }
 
 
index 1f9d0c6b084d9a6f404f3ec756d7c6eb9418c9c2..221827f4eb86fcbcb03e4b6b628124b48e6dc8d4 100644 (file)
  * @param X test to perform
  */
 
-#if ! NDEBUG
+#undef ASSERT
+
+#if NDEBUG
+#define ASSERT(X)
+#else
 #define ASSERT(X) if (!(X)) Mf::logError("false assertion at %s:%d, " #X, \
                __FILE__, __LINE__), exit(1)
-#else
-#define ASSERT(X)
 #endif
 
 
index 733f54ca7f6326a826b0a5013cd1904a94cab4ac..a4dcf4047dfcc591f327accff93fa46039f7febc 100644 (file)
@@ -30,6 +30,8 @@
 #include <ctime>
 #include <limits>
 
+#include <SDL/SDL.h>
+
 #include "Log.hh"
 #include "Timer.hh"
 
@@ -37,8 +39,6 @@
 #include "config.h"
 #endif
 
-#include <SDL/SDL.h>
-
 
 namespace Mf {
 
@@ -194,7 +194,8 @@ Scalar Timer::getTicks()
 {
        struct timespec ts;
 
-       ASSERT(clock_gettime(CLOCK_MONOTONIC, &ts) == 0 && "cannot access clock");
+       int result = clock_gettime(CLOCK_MONOTONIC, &ts);
+       ASSERT(result == 0 && "cannot access clock");
 
        return Scalar(ts.tv_sec - reference) + Scalar(ts.tv_nsec) / 1000000000.0;
 }
This page took 0.021226 seconds and 4 git commands to generate.