(svn r23194) -Codechange: don't cast away const needlessly

This commit is contained in:
rubidium
2011-11-12 08:26:30 +00:00
parent bd64bf6372
commit 4f87d2e88c
11 changed files with 25 additions and 25 deletions

View File

@@ -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));

View File

@@ -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;
}
}

View File

@@ -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);