diff --git a/src/3rdparty/squirrel/squirrel/sqbaselib.cpp b/src/3rdparty/squirrel/squirrel/sqbaselib.cpp index 28de341948..cd17536aea 100644 --- a/src/3rdparty/squirrel/squirrel/sqbaselib.cpp +++ b/src/3rdparty/squirrel/squirrel/sqbaselib.cpp @@ -672,7 +672,7 @@ static SQInteger string_find(HSQUIRRELVM v) SQObject str=stack_get(v,1); \ SQInteger len=_string(str)->_len; \ const SQChar *sThis=_stringval(str); \ - SQChar *sNew=(_ss(v)->GetScratchPad(rsl(len))); \ + SQChar *sNew=(_ss(v)->GetScratchPad(len)); \ for(SQInteger i=0;iPush(SQString::Create(_ss(v),sNew,len)); \ return 1; \ diff --git a/src/3rdparty/squirrel/squirrel/sqobject.cpp b/src/3rdparty/squirrel/squirrel/sqobject.cpp index da7f600033..36e72b48de 100644 --- a/src/3rdparty/squirrel/squirrel/sqobject.cpp +++ b/src/3rdparty/squirrel/squirrel/sqobject.cpp @@ -274,7 +274,7 @@ bool WriteObject(HSQUIRRELVM v,SQUserPointer up,SQWRITEFUNC write,SQObjectPtr &o switch(type(o)){ case OT_STRING: _CHECK_IO(SafeWrite(v,write,up,&_string(o)->_len,sizeof(SQInteger))); - _CHECK_IO(SafeWrite(v,write,up,_stringval(o),rsl(_string(o)->_len))); + _CHECK_IO(SafeWrite(v,write,up,_stringval(o),_string(o)->_len)); break; case OT_INTEGER: _CHECK_IO(SafeWrite(v,write,up,&_integer(o),sizeof(SQInteger)));break; @@ -297,7 +297,7 @@ bool ReadObject(HSQUIRRELVM v,SQUserPointer up,SQREADFUNC read,SQObjectPtr &o) case OT_STRING:{ SQInteger len; _CHECK_IO(SafeRead(v,read,up,&len,sizeof(SQInteger))); - _CHECK_IO(SafeRead(v,read,up,_ss(v)->GetScratchPad(rsl(len)),rsl(len))); + _CHECK_IO(SafeRead(v,read,up,_ss(v)->GetScratchPad(len),len)); o=SQString::Create(_ss(v),_ss(v)->GetScratchPad(-1),len); } break; diff --git a/src/3rdparty/squirrel/squirrel/sqstate.cpp b/src/3rdparty/squirrel/squirrel/sqstate.cpp index c518f73b95..a0bc518c37 100644 --- a/src/3rdparty/squirrel/squirrel/sqstate.cpp +++ b/src/3rdparty/squirrel/squirrel/sqstate.cpp @@ -522,13 +522,13 @@ SQString *SQStringTable::Add(const SQChar *news,SQInteger len) SQHash h = ::_hashstr(news,(size_t)len)&(_numofslots-1); SQString *s; for (s = _strings[h]; s; s = s->_next){ - if(s->_len == len && (!memcmp(news,s->_val,(size_t)rsl(len)))) + if(s->_len == len && (!memcmp(news,s->_val,(size_t)len))) return s; //found } - SQString *t=(SQString *)SQ_MALLOC(rsl(len)+sizeof(SQString)); + SQString *t=(SQString *)SQ_MALLOC(len+sizeof(SQString)); new (t) SQString; - memcpy(t->_val,news,(size_t)rsl(len)); + memcpy(t->_val,news,(size_t)len); t->_val[len] = '\0'; t->_len = len; t->_hash = ::_hashstr(news,(size_t)len); @@ -573,7 +573,7 @@ void SQStringTable::Remove(SQString *bs) _slotused--; SQInteger slen = s->_len; s->~SQString(); - SQ_FREE(s,sizeof(SQString) + rsl(slen)); + SQ_FREE(s,sizeof(SQString) + slen); return; } prev = s; diff --git a/src/3rdparty/squirrel/squirrel/sqstate.h b/src/3rdparty/squirrel/squirrel/sqstate.h index ea48aca913..8b9c9fbe68 100644 --- a/src/3rdparty/squirrel/squirrel/sqstate.h +++ b/src/3rdparty/squirrel/squirrel/sqstate.h @@ -123,8 +123,6 @@ private: #define _instance_ddel _table(_sharedstate->_instance_default_delegate) #define _weakref_ddel _table(_sharedstate->_weakref_default_delegate) -#define rsl(l) (l) - extern SQObjectPtr _null_; extern SQObjectPtr _true_; extern SQObjectPtr _false_; diff --git a/src/3rdparty/squirrel/squirrel/sqvm.cpp b/src/3rdparty/squirrel/squirrel/sqvm.cpp index beba018bfc..745ad30d73 100644 --- a/src/3rdparty/squirrel/squirrel/sqvm.cpp +++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp @@ -296,9 +296,9 @@ bool SQVM::StringCat(const SQObjectPtr &str,const SQObjectPtr &obj,SQObjectPtr & ToString(str, a); ToString(obj, b); SQInteger l = _string(a)->_len , ol = _string(b)->_len; - SQChar *s = _sp(rsl(l + ol + 1)); - memcpy(s, _stringval(a), (size_t)rsl(l)); - memcpy(s + l, _stringval(b), (size_t)rsl(ol)); + SQChar *s = _sp(l + ol + 1); + memcpy(s, _stringval(a), (size_t)l); + memcpy(s + l, _stringval(b), (size_t)ol); dest = SQString::Create(_ss(this), _spval, l + ol); return true; }