Use Time::sleep instead of sleep in Application::main
authorMikko Rasa <tdb@tdb.fi>
Mon, 27 Nov 2006 14:12:23 +0000 (14:12 +0000)
committerMikko Rasa <tdb@tdb.fi>
Mon, 27 Nov 2006 14:12:23 +0000 (14:12 +0000)
Prefix usage reason with "UsageError: "

source/core/application.cpp

index 7e92dbdf3d552574fbb279b17abc7bf56edfbec2..1012ea20f8b3ae400ead7b23fec92af737e8c2c2 100644 (file)
@@ -6,6 +6,7 @@ Distributed under the LGPL
 #include <signal.h>
 #include <iostream>
 #include "../time/units.h"
+#include "../time/utils.h"
 #include "application.h"
 #include "error.h"
 
@@ -62,7 +63,7 @@ will blame the programmer for being lazy.
 void Application::usage(const char *reason, const char *, bool)
 {
        if(reason)
-               cerr<<reason<<'\n';
+               cerr<<"UsageError: "<<reason<<'\n';
        cerr<<"The programmer was lazy and didn't write a usage() function for this application.\n";
 }
 
@@ -92,7 +93,7 @@ int Application::main()
                else if(loop_mode_==TICK_SLEEP)
                {
                        tick();
-                       sleep(Time::msec);
+                       Time::sleep(Time::msec);
                }
                else if(loop_mode_==TICK_YIELD)
                {