summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-09-06 19:57:01 +0000
committerrubidium <rubidium@openttd.org>2014-09-06 19:57:01 +0000
commit9543f4ed1e234bcd76562100db74c8411c54b3b6 (patch)
tree12d930bed7298da519d91c105075853b9daabf90 /src
parenteb52e65beccd66e8ebdb1d8897b609c331b21bcc (diff)
downloadopenttd-9543f4ed1e234bcd76562100db74c8411c54b3b6.tar.xz
(svn r26778) -Codechange: remove pointless rsl macro
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/squirrel/squirrel/sqbaselib.cpp2
-rw-r--r--src/3rdparty/squirrel/squirrel/sqobject.cpp4
-rw-r--r--src/3rdparty/squirrel/squirrel/sqstate.cpp8
-rw-r--r--src/3rdparty/squirrel/squirrel/sqstate.h2
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.cpp6
5 files changed, 10 insertions, 12 deletions
diff --git a/src/3rdparty/squirrel/squirrel/sqbaselib.cpp b/src/3rdparty/squirrel/squirrel/sqbaselib.cpp
index 28de34194..cd17536ae 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;i<len;i++) sNew[i]=func(sThis[i]); \
v->Push(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 da7f60003..36e72b48d 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 c518f73b9..a0bc518c3 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 ea48aca91..8b9c9fbe6 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 beba018bf..745ad30d7 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;
}