From 6b3ff8a5164423e5b1620107d5999c2f01b0fdf1 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 7 Jul 2010 20:14:50 +0200 Subject: [PATCH] constness fixes --- apps/mwinterpreter/context.cpp | 4 ++-- apps/mwinterpreter/context.hpp | 4 ++-- apps/openmw/mwscript/interpretercontext.cpp | 4 ++-- apps/openmw/mwscript/interpretercontext.hpp | 4 ++-- components/interpreter/context.hpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/mwinterpreter/context.cpp b/apps/mwinterpreter/context.cpp index 5d27a8fe3..ecf4bd829 100644 --- a/apps/mwinterpreter/context.cpp +++ b/apps/mwinterpreter/context.cpp @@ -101,7 +101,7 @@ namespace SAInterpreter void Context::setGlobalFloat (const std::string& name, float value) {} - bool Context::isScriptRunning (const std::string& name) + bool Context::isScriptRunning (const std::string& name) const { return false; } @@ -110,7 +110,7 @@ namespace SAInterpreter void Context::stopScript (const std::string& name) {} - float Context::getDistance (const std::string& name) + float Context::getDistance (const std::string& name) const { return 0; } diff --git a/apps/mwinterpreter/context.hpp b/apps/mwinterpreter/context.hpp index e9535e918..48ba40ca3 100644 --- a/apps/mwinterpreter/context.hpp +++ b/apps/mwinterpreter/context.hpp @@ -52,13 +52,13 @@ namespace SAInterpreter virtual void setGlobalFloat (const std::string& name, float value); - virtual bool isScriptRunning (const std::string& name); + virtual bool isScriptRunning (const std::string& name) const; virtual void startScript (const std::string& name); virtual void stopScript (const std::string& name); - virtual float getDistance (const std::string& name); + virtual float getDistance (const std::string& name) const; virtual float getSecondsPassed() const; diff --git a/apps/openmw/mwscript/interpretercontext.cpp b/apps/openmw/mwscript/interpretercontext.cpp index 92840fdd5..0b1610f4f 100644 --- a/apps/openmw/mwscript/interpretercontext.cpp +++ b/apps/openmw/mwscript/interpretercontext.cpp @@ -125,7 +125,7 @@ namespace MWScript *reinterpret_cast (&value); } - bool InterpreterContext::isScriptRunning (const std::string& name) + bool InterpreterContext::isScriptRunning (const std::string& name) const { return mEnvironment.mGlobalScripts->isRunning (name); } @@ -140,7 +140,7 @@ namespace MWScript mEnvironment.mGlobalScripts->removeScript (name); } - float InterpreterContext::getDistance (const std::string& name) + float InterpreterContext::getDistance (const std::string& name) const { if (mReference.isEmpty()) throw std::runtime_error ("no implicit reference"); diff --git a/apps/openmw/mwscript/interpretercontext.hpp b/apps/openmw/mwscript/interpretercontext.hpp index 4b3dfa124..947756262 100644 --- a/apps/openmw/mwscript/interpretercontext.hpp +++ b/apps/openmw/mwscript/interpretercontext.hpp @@ -61,13 +61,13 @@ namespace MWScript virtual void setGlobalFloat (const std::string& name, float value); - virtual bool isScriptRunning (const std::string& name); + virtual bool isScriptRunning (const std::string& name) const; virtual void startScript (const std::string& name); virtual void stopScript (const std::string& name); - virtual float getDistance (const std::string& name); + virtual float getDistance (const std::string& name) const; virtual bool hasBeenActivated() const; diff --git a/components/interpreter/context.hpp b/components/interpreter/context.hpp index a8f0eaf8b..34b78d580 100644 --- a/components/interpreter/context.hpp +++ b/components/interpreter/context.hpp @@ -47,13 +47,13 @@ namespace Interpreter virtual void setGlobalFloat (const std::string& name, float value) = 0; - virtual bool isScriptRunning (const std::string& name) = 0; + virtual bool isScriptRunning (const std::string& name) const = 0; virtual void startScript (const std::string& name) = 0; virtual void stopScript (const std::string& name) = 0; - virtual float getDistance (const std::string& name) = 0; + virtual float getDistance (const std::string& name) const = 0; virtual float getSecondsPassed() const = 0; };