mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r26778) -Codechange: remove pointless rsl macro
This commit is contained in:
parent
ac7ef48b0d
commit
506de3c53d
2
src/3rdparty/squirrel/squirrel/sqbaselib.cpp
vendored
2
src/3rdparty/squirrel/squirrel/sqbaselib.cpp
vendored
@ -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;i<len;i++) sNew[i]=func(sThis[i]); \
|
||||
v->Push(SQString::Create(_ss(v),sNew,len)); \
|
||||
return 1; \
|
||||
|
4
src/3rdparty/squirrel/squirrel/sqobject.cpp
vendored
4
src/3rdparty/squirrel/squirrel/sqobject.cpp
vendored
@ -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;
|
||||
|
8
src/3rdparty/squirrel/squirrel/sqstate.cpp
vendored
8
src/3rdparty/squirrel/squirrel/sqstate.cpp
vendored
@ -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;
|
||||
|
2
src/3rdparty/squirrel/squirrel/sqstate.h
vendored
2
src/3rdparty/squirrel/squirrel/sqstate.h
vendored
@ -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_;
|
||||
|
6
src/3rdparty/squirrel/squirrel/sqvm.cpp
vendored
6
src/3rdparty/squirrel/squirrel/sqvm.cpp
vendored
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user