From: Matthijs Kooijman Date: Sun, 10 Jun 2007 19:30:30 +0000 (+0200) Subject: * Add link target to the Makefile. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=7e140e4a6676bed7583831251469fcee457f7654;p=matthijs%2FABM2.git * Add link target to the Makefile. * 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. --- diff --git a/ABM2/Engine/Kernel.cpp b/ABM2/Engine/Kernel.cpp index 173c0d3..5a004dd 100755 --- a/ABM2/Engine/Kernel.cpp +++ b/ABM2/Engine/Kernel.cpp @@ -73,7 +73,7 @@ int CKernel::Execute() return 0; } -bool CKernel::AddTask(CMMPointer &t) +bool CKernel::AddTask(CMMPointer t) { if(!t->Start())return false; @@ -88,7 +88,7 @@ bool CKernel::AddTask(CMMPointer &t) return true; } -void CKernel::SuspendTask(CMMPointer &t) +void CKernel::SuspendTask(CMMPointer t) { //check that this task is in our list - we don't want to suspend a task that isn't running if(std::find(taskList.begin(),taskList.end(),t)!=taskList.end()) @@ -99,7 +99,7 @@ void CKernel::SuspendTask(CMMPointer &t) } } -void CKernel::ResumeTask(CMMPointer &t) +void CKernel::ResumeTask(CMMPointer t) { if(std::find(pausedTaskList.begin(),pausedTaskList.end(),t)!=pausedTaskList.end()) { @@ -116,7 +116,7 @@ void CKernel::ResumeTask(CMMPointer &t) } } -void CKernel::RemoveTask(CMMPointer &t) +void CKernel::RemoveTask(CMMPointer t) { if(std::find(taskList.begin(),taskList.end(),t)!=taskList.end()) { diff --git a/ABM2/Engine/Kernel.h b/ABM2/Engine/Kernel.h index 3cd5bf3..60f6006 100755 --- a/ABM2/Engine/Kernel.h +++ b/ABM2/Engine/Kernel.h @@ -25,14 +25,10 @@ public: int Execute(); -#ifdef WIN32 - bool AddTask(CMMPointer &t); -#else bool AddTask(CMMPointer t); -#endif - void SuspendTask(CMMPointer &t); - void ResumeTask(CMMPointer &t); - void RemoveTask(CMMPointer &t); + void SuspendTask(CMMPointer t); + void ResumeTask(CMMPointer t); + void RemoveTask(CMMPointer t); void KillAllTasks(); protected: diff --git a/ABM2/Engine/Log.cpp b/ABM2/Engine/Log.cpp index 6012f9a..9a657b6 100755 --- a/ABM2/Engine/Log.cpp +++ b/ABM2/Engine/Log.cpp @@ -3,7 +3,6 @@ ////////////////////////////////////////////////////////////////////// #include -#include "porting.h" #include "engine.h" #include "Log.h" diff --git a/ABM2/Engine/Settings.cpp b/ABM2/Engine/Settings.cpp index 8d181c5..0d74f3c 100755 --- a/ABM2/Engine/Settings.cpp +++ b/ABM2/Engine/Settings.cpp @@ -20,7 +20,7 @@ CSettingsManager::~CSettingsManager() DestroyStandardSettings(); } -void CSettingsManager::RegisterVariable(std::string &name, CMMPointer &var) +void CSettingsManager::RegisterVariable(std::string name, CMMPointer var) { settingMap[name]=var; } diff --git a/ABM2/Engine/Settings.h b/ABM2/Engine/Settings.h index b007daa..8b6daf8 100755 --- a/ABM2/Engine/Settings.h +++ b/ABM2/Engine/Settings.h @@ -18,7 +18,7 @@ public: CSettingsManager(); virtual ~CSettingsManager(); - void RegisterVariable(std::string &name, CMMPointer &var); + void RegisterVariable(std::string name, CMMPointer var); void SetVariable(std::string &name, std::string &value, int bias=0); void CreateStandardSettings(); diff --git a/ABM2/Engine/engine.h b/ABM2/Engine/engine.h index 6a3ac35..629e8a3 100755 --- a/ABM2/Engine/engine.h +++ b/ABM2/Engine/engine.h @@ -23,6 +23,7 @@ #ifdef WIN32 #include #endif +#include "porting.h" //even though resource.h is technically a Win32-resource file, it's just a bunch of defines, so it's ok (and necessary) #include "resource.h" diff --git a/ABM2/Makefile b/ABM2/Makefile index 573b6ba..f6dc710 100644 --- a/ABM2/Makefile +++ b/ABM2/Makefile @@ -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 $@ diff --git a/ABM2/porting.h b/ABM2/porting.h index a4f6c1f..942acab 100644 --- a/ABM2/porting.h +++ b/ABM2/porting.h @@ -1,3 +1,4 @@ #ifndef WIN32 #define vsprintf_s vsnprintf + #define sprintf_s snprintf #endif // !WIN32