* Add link target to the Makefile.
authorMatthijs Kooijman <m.kooijman@student.utwente.nl>
Sun, 10 Jun 2007 19:30:30 +0000 (21:30 +0200)
committerMatthijs Kooijman <m.kooijman@student.utwente.nl>
Sun, 10 Jun 2007 19:30:30 +0000 (21:30 +0200)
 * Move porting.h inclusion to engine.h, so most files will automatically include it.
 * Make arguments passed as reference-to-CMMPointer and reference-to-string non-references, so temporary constructors can be used.

ABM2/Engine/Kernel.cpp
ABM2/Engine/Kernel.h
ABM2/Engine/Log.cpp
ABM2/Engine/Settings.cpp
ABM2/Engine/Settings.h
ABM2/Engine/engine.h
ABM2/Makefile
ABM2/porting.h

index 173c0d3170de02279f3cc53f1f0193d038ba5103..5a004dd0be39a38ca566ecc5bfbef9b13a7b2d3d 100755 (executable)
@@ -73,7 +73,7 @@ int CKernel::Execute()
        return 0;\r
 }\r
 \r
-bool CKernel::AddTask(CMMPointer<ITask> &t)\r
+bool CKernel::AddTask(CMMPointer<ITask> t)\r
 {\r
        if(!t->Start())return false;\r
 \r
@@ -88,7 +88,7 @@ bool CKernel::AddTask(CMMPointer<ITask> &t)
        return true;\r
 }\r
 \r
-void CKernel::SuspendTask(CMMPointer<ITask> &t)\r
+void CKernel::SuspendTask(CMMPointer<ITask> t)\r
 {\r
        //check that this task is in our list - we don't want to suspend a task that isn't running\r
        if(std::find(taskList.begin(),taskList.end(),t)!=taskList.end())\r
@@ -99,7 +99,7 @@ void CKernel::SuspendTask(CMMPointer<ITask> &t)
        }\r
 }\r
 \r
-void CKernel::ResumeTask(CMMPointer<ITask> &t)\r
+void CKernel::ResumeTask(CMMPointer<ITask> t)\r
 {\r
        if(std::find(pausedTaskList.begin(),pausedTaskList.end(),t)!=pausedTaskList.end())\r
        {\r
@@ -116,7 +116,7 @@ void CKernel::ResumeTask(CMMPointer<ITask> &t)
        }\r
 }\r
 \r
-void CKernel::RemoveTask(CMMPointer<ITask> &t)\r
+void CKernel::RemoveTask(CMMPointer<ITask> t)\r
 {\r
        if(std::find(taskList.begin(),taskList.end(),t)!=taskList.end())\r
        {\r
index 3cd5bf389aa256d5fcc41dec8245c2ceac5ff35f..60f6006c59fb1bc5dc2e603e6d7f6a9075845294 100755 (executable)
@@ -25,14 +25,10 @@ public:
 \r
        int Execute();\r
 \r
-#ifdef WIN32\r
-       bool AddTask(CMMPointer<ITask> &t);\r
-#else\r
        bool AddTask(CMMPointer<ITask> t);\r
-#endif\r
-       void SuspendTask(CMMPointer<ITask> &t);\r
-       void ResumeTask(CMMPointer<ITask> &t);\r
-       void RemoveTask(CMMPointer<ITask> &t);\r
+       void SuspendTask(CMMPointer<ITask> t);\r
+       void ResumeTask(CMMPointer<ITask> t);\r
+       void RemoveTask(CMMPointer<ITask> t);\r
        void KillAllTasks();\r
 \r
 protected:\r
index 6012f9aa35e5d46b1b78f172f3df3b52b802bdc7..9a657b6771b996abb2a999cf95bdc0c1a59160fa 100755 (executable)
@@ -3,7 +3,6 @@
 //////////////////////////////////////////////////////////////////////\r
 \r
 #include <stdarg.h>\r
-#include "porting.h"\r
 #include "engine.h"\r
 #include "Log.h"\r
 \r
index 8d181c5ec6c618150cc8ee5a1aa7a29a622f87e0..0d74f3c5f8b46a1b8592b0c7ce1087f50e6fc712 100755 (executable)
@@ -20,7 +20,7 @@ CSettingsManager::~CSettingsManager()
        DestroyStandardSettings();\r
 }\r
 \r
-void CSettingsManager::RegisterVariable(std::string &name, CMMPointer<BaseDator> &var)\r
+void CSettingsManager::RegisterVariable(std::string name, CMMPointer<BaseDator> var)\r
 {\r
        settingMap[name]=var;\r
 }\r
index b007daa71427eebc6499e836afccf1c3bcca5d24..8b6daf8941f98aabd0b662fb5e9a8314d7a68755 100755 (executable)
@@ -18,7 +18,7 @@ public:
        CSettingsManager();\r
        virtual ~CSettingsManager();\r
 \r
-       void RegisterVariable(std::string &name, CMMPointer<BaseDator> &var);\r
+       void RegisterVariable(std::string name, CMMPointer<BaseDator> var);\r
        void SetVariable(std::string &name, std::string &value, int bias=0);\r
 \r
        void CreateStandardSettings();\r
index 6a3ac35ac883b2d0d5c35a2c055207a86f1dff47..629e8a34f4224c5f4a81d5a164a0478efce3c521 100755 (executable)
@@ -23,6 +23,7 @@
 #ifdef WIN32\r
 #include <windows.h>\r
 #endif\r
+#include "porting.h"\r
 \r
 //even though resource.h is technically a Win32-resource file, it's just a bunch of defines, so it's ok (and necessary)\r
 #include "resource.h"\r
index 573b6ba58648fd74d68fa8810d6bbe6bbe7afae9..f6dc710b63638d7126c46e38d5edfcf31a8b4f79 100644 (file)
@@ -1,8 +1,11 @@
-CFLAGS:=-I.
-OBJS:=main.o Engine/Log.o SchemeReader.o
+CFLAGS:=-I. -fno-elide-constructors -fms-extensions -fpermissive
+OBJS:=main.o Engine/Log.o SchemeReader.o Engine/Settings.o
 
 all: $(OBJS)
 
+link: all
+       g++ $(OBJS)
+
 %.o: %.cpp
        g++ $(CFLAGS) -c $< -o $@
 
index a4f6c1fdf5766a70f72586bf417e0677a24ed0b1..942acab36114e302b3c44aca8c89b25965f8a5f8 100644 (file)
@@ -1,3 +1,4 @@
 #ifndef WIN32
        #define vsprintf_s vsnprintf
+       #define sprintf_s snprintf
 #endif // !WIN32