summaryrefslogtreecommitdiff
path: root/src/3rdparty
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-12 08:26:30 +0000
committerrubidium <rubidium@openttd.org>2011-11-12 08:26:30 +0000
commit4f87d2e88c4b42f4ae4a5c7956f2287740ef174b (patch)
treed390107524182c8276e616c20612708f9c893f7d /src/3rdparty
parentbd64bf6372399bad1a92565ae7d3c243658d241f (diff)
downloadopenttd-4f87d2e88c4b42f4ae4a5c7956f2287740ef174b.tar.xz
(svn r23194) -Codechange: don't cast away const needlessly
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/squirrel/squirrel/sqdebug.cpp2
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.cpp6
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/3rdparty/squirrel/squirrel/sqdebug.cpp b/src/3rdparty/squirrel/squirrel/sqdebug.cpp
index 055762651..c683697d7 100644
--- a/src/3rdparty/squirrel/squirrel/sqdebug.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqdebug.cpp
@@ -91,7 +91,7 @@ SQString *SQVM::PrintObjVal(const SQObject &o)
}
}
-void SQVM::Raise_IdxError(SQObject &o)
+void SQVM::Raise_IdxError(const SQObject &o)
{
SQObjectPtr oval = PrintObjVal(o);
Raise_Error(_SC("the index '%.50s' does not exist"), _stringval(oval));
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.cpp b/src/3rdparty/squirrel/squirrel/sqvm.cpp
index 1dbd83f30..1a991e022 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp
@@ -459,7 +459,7 @@ bool SQVM::DerefInc(SQInteger op,SQObjectPtr &target, SQObjectPtr &self, SQObjec
#define sarg1 (*(const_cast<SQInt32 *>(&_i_._arg1)))
#define arg2 (_i_._arg2)
#define arg3 (_i_._arg3)
-#define sarg3 ((SQInteger)*((signed char *)&_i_._arg3))
+#define sarg3 ((SQInteger)*((const signed char *)&_i_._arg3))
SQRESULT SQVM::Suspend()
{
@@ -742,7 +742,7 @@ exception_restore:
continue;
case _OP_LOAD: TARGET = ci->_literals[arg1]; continue;
case _OP_LOADINT: TARGET = (SQInteger)arg1; continue;
- case _OP_LOADFLOAT: TARGET = *((SQFloat *)&arg1); continue;
+ case _OP_LOADFLOAT: TARGET = *((const SQFloat *)&arg1); continue;
case _OP_DLOAD: TARGET = ci->_literals[arg1]; STK(arg2) = ci->_literals[arg3];continue;
case _OP_TAILCALL:
temp_reg = STK(arg1);
@@ -1434,7 +1434,7 @@ bool SQVM::DeleteSlot(const SQObjectPtr &self,const SQObjectPtr &key,SQObjectPtr
_table(self)->Remove(key);
}
else {
- Raise_IdxError((SQObject &)key);
+ Raise_IdxError((const SQObject &)key);
return false;
}
}
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.h b/src/3rdparty/squirrel/squirrel/sqvm.h
index 7ba404564..73b5a0451 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.h
+++ b/src/3rdparty/squirrel/squirrel/sqvm.h
@@ -84,7 +84,7 @@ public:
void Raise_Error(const SQChar *s, ...);
void Raise_Error(SQObjectPtr &desc);
- void Raise_IdxError(SQObject &o);
+ void Raise_IdxError(const SQObject &o);
void Raise_CompareError(const SQObject &o1, const SQObject &o2);
void Raise_ParamTypeError(SQInteger nparam,SQInteger typemask,SQInteger type);