summaryrefslogtreecommitdiff
path: root/src/3rdparty
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-09-06 18:10:36 +0000
committerrubidium <rubidium@openttd.org>2014-09-06 18:10:36 +0000
commite63ca12ab815e0cd4d5cc7fd129cde04f7c4404a (patch)
treee4fdbec2bc1b60a37442d882cfe3df8f8d85a6e8 /src/3rdparty
parent33ab50556760a84d6754235e553c68ada2f35a63 (diff)
downloadopenttd-e63ca12ab815e0cd4d5cc7fd129cde04f7c4404a.tar.xz
(svn r26775) -Cleanup [Squirrel]: "resolve" several of the unicode wrapper defines
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/squirrel/etc/minimal.c2
-rw-r--r--src/3rdparty/squirrel/include/squirrel.h24
-rw-r--r--src/3rdparty/squirrel/sq/sq.c26
-rw-r--r--src/3rdparty/squirrel/sqstdlib/sqstdaux.cpp4
-rw-r--r--src/3rdparty/squirrel/sqstdlib/sqstdrex.cpp16
-rw-r--r--src/3rdparty/squirrel/sqstdlib/sqstdstring.cpp14
-rw-r--r--src/3rdparty/squirrel/squirrel/sqapi.cpp2
-rw-r--r--src/3rdparty/squirrel/squirrel/sqbaselib.cpp8
-rw-r--r--src/3rdparty/squirrel/squirrel/sqcompiler.cpp2
-rw-r--r--src/3rdparty/squirrel/squirrel/sqdebug.cpp6
-rw-r--r--src/3rdparty/squirrel/squirrel/sqfuncstate.cpp66
-rw-r--r--src/3rdparty/squirrel/squirrel/sqlexer.cpp22
-rw-r--r--src/3rdparty/squirrel/squirrel/sqstate.cpp2
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.cpp58
14 files changed, 114 insertions, 138 deletions
diff --git a/src/3rdparty/squirrel/etc/minimal.c b/src/3rdparty/squirrel/etc/minimal.c
index dfbff0cc1..660647be4 100644
--- a/src/3rdparty/squirrel/etc/minimal.c
+++ b/src/3rdparty/squirrel/etc/minimal.c
@@ -16,7 +16,7 @@ void printfunc(HSQUIRRELVM v, const SQChar *s, ...)
{
va_list arglist;
va_start(arglist, s);
-scvprintf(s, arglist);
+vprintf(s, arglist);
va_end(arglist);
}
diff --git a/src/3rdparty/squirrel/include/squirrel.h b/src/3rdparty/squirrel/include/squirrel.h
index 9ed0e550c..9a58adca6 100644
--- a/src/3rdparty/squirrel/include/squirrel.h
+++ b/src/3rdparty/squirrel/include/squirrel.h
@@ -90,30 +90,6 @@ struct SQInstance;
struct SQDelegable;
typedef char SQChar;
-#define scstrcmp strcmp
-#define scsprintf sprintf
-#define scsnprintf snprintf
-#define scstrlen strlen
-#define scstrtod strtod
-#define scstrtol strtol
-#define scatoi atoi
-#define scstrtoul strtoul
-#define scvsprintf vsprintf
-#define scstrstr strstr
-#define scisspace isspace
-#define scisdigit isdigit
-#define scisxdigit isxdigit
-#define sciscntrl iscntrl
-#define scisalpha isalpha
-#define scisalnum isalnum
-#define scprintf printf
-#define scfprintf fprintf
-#define scvprintf vprintf
-#define scvfprintf vfprintf
-#define scvsnprintf vsnprintf
-#define scstrdup strdup
-#define scstrrchr strrchr
-#define scstrcat strcat
#define MAX_CHAR 0xFFFF
#if defined(_MSC_VER) || defined(__MINGW32__)
diff --git a/src/3rdparty/squirrel/sq/sq.c b/src/3rdparty/squirrel/sq/sq.c
index 5044025cf..0b6c014a9 100644
--- a/src/3rdparty/squirrel/sq/sq.c
+++ b/src/3rdparty/squirrel/sq/sq.c
@@ -46,21 +46,21 @@ void printfunc(HSQUIRRELVM v,const SQChar *s,...)
{
va_list vl;
va_start(vl, s);
- scvprintf( s, vl);
+ vprintf( s, vl);
va_end(vl);
}
void PrintVersionInfos()
{
- scfprintf(stdout,"%s %s (%d bits)\n",SQUIRREL_VERSION,SQUIRREL_COPYRIGHT,sizeof(SQInteger)*8);
+ fprintf(stdout,"%s %s (%d bits)\n",SQUIRREL_VERSION,SQUIRREL_COPYRIGHT,sizeof(SQInteger)*8);
if(sizeof(SQFloat) != sizeof(float)) {
- scfprintf(stdout,"[%d bits floats]\n",sizeof(SQFloat)*8);
+ fprintf(stdout,"[%d bits floats]\n",sizeof(SQFloat)*8);
}
}
void PrintUsage()
{
- scfprintf(stderr,"usage: sq <options> <scriptpath [args]>.\n"
+ fprintf(stderr,"usage: sq <options> <scriptpath [args]>.\n"
"Available options are:\n"
" -c compiles the file to bytecode(default output 'out.cnut')\n"
" -o specifies output file for the -c option\n"
@@ -113,7 +113,7 @@ int getargs(HSQUIRRELVM v,int argc, char* argv[])
return _DONE;
default:
PrintVersionInfos();
- scprintf("unknown prameter '-%c'\n",argv[arg][1]);
+ printf("unknown prameter '-%c'\n",argv[arg][1]);
PrintUsage();
return _DONE;
}
@@ -161,7 +161,7 @@ int getargs(HSQUIRRELVM v,int argc, char* argv[])
const SQChar *err;
sq_getlasterror(v);
if(SQ_SUCCEEDED(sq_getstring(v,-1,&err))) {
- scprintf("Error [%s]\n",err);
+ printf("Error [%s]\n",err);
return _DONE;
}
}
@@ -194,7 +194,7 @@ void Interactive(HSQUIRRELVM v)
while (!done)
{
SQInteger i = 0;
- scprintf("\nsq>");
+ printf("\nsq>");
for(;;) {
int c;
if(done)return;
@@ -217,7 +217,7 @@ void Interactive(HSQUIRRELVM v)
buffer[i++] = (SQChar)c;
}
else if (i >= MAXINPUT-1) {
- scfprintf(stderr, "sq : input line too long\n");
+ fprintf(stderr, "sq : input line too long\n");
break;
}
else{
@@ -227,17 +227,17 @@ void Interactive(HSQUIRRELVM v)
buffer[i] = '\0';
if(buffer[0]=='='){
- scsprintf(sq_getscratchpad(v,MAXINPUT),"return (%s)",&buffer[1]);
- memcpy(buffer,sq_getscratchpad(v,-1),(scstrlen(sq_getscratchpad(v,-1))+1)*sizeof(SQChar));
+ sprintf(sq_getscratchpad(v,MAXINPUT),"return (%s)",&buffer[1]);
+ memcpy(buffer,sq_getscratchpad(v,-1),(strlen(sq_getscratchpad(v,-1))+1)*sizeof(SQChar));
retval=1;
}
- i=scstrlen(buffer);
+ i=strlen(buffer);
if(i>0){
SQInteger oldtop=sq_gettop(v);
if(SQ_SUCCEEDED(sq_compilebuffer(v,buffer,i,"interactive console",SQTrue))){
sq_pushroottable(v);
if(SQ_SUCCEEDED(sq_call(v,1,retval,SQTrue)) && retval){
- scprintf("\n");
+ printf("\n");
sq_pushroottable(v);
sq_pushstring(v,"print",-1);
sq_get(v,-2);
@@ -245,7 +245,7 @@ void Interactive(HSQUIRRELVM v)
sq_push(v,-4);
sq_call(v,2,SQFalse,SQTrue);
retval=0;
- scprintf("\n");
+ printf("\n");
}
}
diff --git a/src/3rdparty/squirrel/sqstdlib/sqstdaux.cpp b/src/3rdparty/squirrel/sqstdlib/sqstdaux.cpp
index e4c266362..c4002bf2c 100644
--- a/src/3rdparty/squirrel/sqstdlib/sqstdaux.cpp
+++ b/src/3rdparty/squirrel/sqstdlib/sqstdaux.cpp
@@ -27,8 +27,8 @@ void sqstd_printcallstack(HSQUIRRELVM v)
* Since the path only reaches NoAI code in a formatted string we have
* to strip it here. Let's hope nobody installs openttd in a subdirectory
* of a directory named /ai/. */
- src = scstrstr(si.source, "\\ai\\");
- if (!src) src = scstrstr(si.source, "/ai/");
+ src = strstr(si.source, "\\ai\\");
+ if (!src) src = strstr(si.source, "/ai/");
if (src) {
src += 4;
} else {
diff --git a/src/3rdparty/squirrel/sqstdlib/sqstdrex.cpp b/src/3rdparty/squirrel/sqstdlib/sqstdrex.cpp
index a7aa5303d..4029bff62 100644
--- a/src/3rdparty/squirrel/sqstdlib/sqstdrex.cpp
+++ b/src/3rdparty/squirrel/sqstdlib/sqstdrex.cpp
@@ -526,7 +526,7 @@ SQRex *sqstd_rex_compile(const SQChar *pattern,const SQChar **error)
SQRex *exp = (SQRex *)sq_malloc(sizeof(SQRex));
exp->_eol = exp->_bol = NULL;
exp->_p = pattern;
- exp->_nallocated = (SQInteger)scstrlen(pattern) * sizeof(SQChar);
+ exp->_nallocated = (SQInteger)strlen(pattern) * sizeof(SQChar);
exp->_nodes = (SQRexNode *)sq_malloc(exp->_nallocated * sizeof(SQRexNode));
exp->_nsize = 0;
exp->_matches = 0;
@@ -544,16 +544,16 @@ SQRex *sqstd_rex_compile(const SQChar *pattern,const SQChar **error)
SQRexNode *t;
nsize = exp->_nsize;
t = &exp->_nodes[0];
- scprintf("\n");
+ printf("\n");
/* XXX -- The (int) casts are needed to silent warnings on 64bit systems (SQInteger is 64bit, %d assumes 32bit, (int) is 32bit) */
for(i = 0;i < nsize; i++) {
if(exp->_nodes[i].type>MAX_CHAR)
- scprintf("[%02d] %10s ",(int)i,g_nnames[exp->_nodes[i].type-MAX_CHAR]);
+ printf("[%02d] %10s ",(int)i,g_nnames[exp->_nodes[i].type-MAX_CHAR]);
else
- scprintf("[%02d] %10c ",(int)i,exp->_nodes[i].type);
- scprintf("left %02d right %02d next %02d\n",(int)exp->_nodes[i].left,(int)exp->_nodes[i].right,(int)exp->_nodes[i].next);
+ printf("[%02d] %10c ",(int)i,exp->_nodes[i].type);
+ printf("left %02d right %02d next %02d\n",(int)exp->_nodes[i].left,(int)exp->_nodes[i].right,(int)exp->_nodes[i].next);
}
- scprintf("\n");
+ printf("\n");
}
#endif
exp->_matches = (SQRexMatch *) sq_malloc(exp->_nsubexpr * sizeof(SQRexMatch));
@@ -579,7 +579,7 @@ SQBool sqstd_rex_match(SQRex* exp,const SQChar* text)
{
const SQChar* res = NULL;
exp->_bol = text;
- exp->_eol = text + scstrlen(text);
+ exp->_eol = text + strlen(text);
exp->_currsubexp = 0;
res = sqstd_rex_matchnode(exp,exp->_nodes,text,NULL);
if(res == NULL || res != exp->_eol)
@@ -618,7 +618,7 @@ SQBool sqstd_rex_searchrange(SQRex* exp,const SQChar* text_begin,const SQChar* t
SQBool sqstd_rex_search(SQRex* exp,const SQChar* text, const SQChar** out_begin, const SQChar** out_end)
{
- return sqstd_rex_searchrange(exp,text,text + scstrlen(text),out_begin,out_end);
+ return sqstd_rex_searchrange(exp,text,text + strlen(text),out_begin,out_end);
}
SQInteger sqstd_rex_getsubexpcount(SQRex* exp)
diff --git a/src/3rdparty/squirrel/sqstdlib/sqstdstring.cpp b/src/3rdparty/squirrel/sqstdlib/sqstdstring.cpp
index 1671f0b1a..777302efc 100644
--- a/src/3rdparty/squirrel/sqstdlib/sqstdstring.cpp
+++ b/src/3rdparty/squirrel/sqstdlib/sqstdstring.cpp
@@ -22,7 +22,7 @@ static SQInteger validate_format(HSQUIRRELVM v, SQChar *fmt, const SQChar *src,
SQInteger start = n;
fmt[0] = '%';
while (scstrchr("-+ #0", src[n])) n++;
- while (scisdigit(src[n])) {
+ while (isdigit(src[n])) {
swidth[wc] = src[n];
n++;
wc++;
@@ -31,7 +31,7 @@ static SQInteger validate_format(HSQUIRRELVM v, SQChar *fmt, const SQChar *src,
}
swidth[wc] = '\0';
if(wc > 0) {
- width = scatoi(swidth);
+ width = atoi(swidth);
}
else
width = 0;
@@ -39,7 +39,7 @@ static SQInteger validate_format(HSQUIRRELVM v, SQChar *fmt, const SQChar *src,
n++;
wc = 0;
- while (scisdigit(src[n])) {
+ while (isdigit(src[n])) {
swidth[wc] = src[n];
n++;
wc++;
@@ -48,7 +48,7 @@ static SQInteger validate_format(HSQUIRRELVM v, SQChar *fmt, const SQChar *src,
}
swidth[wc] = '\0';
if(wc > 0) {
- width += scatoi(swidth);
+ width += atoi(swidth);
}
}
if (n-start > MAX_FORMAT_LEN )
@@ -69,7 +69,7 @@ static void _append_string(SQInteger &i, SQChar *dest, SQInteger allocated, cons
{
va_list va;
va_start(va, fmt);
- i += scvsnprintf(&dest[i],allocated-i,fmt,va);
+ i += vsnprintf(&dest[i],allocated-i,fmt,va);
va_end(va);
}
@@ -156,7 +156,7 @@ static SQInteger _string_format(HSQUIRRELVM v)
static void __strip_l(const SQChar *str,const SQChar **start)
{
const SQChar *t = str;
- while(((*t) != '\0') && scisspace(*t)){ t++; }
+ while(((*t) != '\0') && isspace(*t)){ t++; }
*start = t;
}
@@ -167,7 +167,7 @@ static void __strip_r(const SQChar *str,SQInteger len,const SQChar **end)
return;
}
const SQChar *t = &str[len-1];
- while(t != str && scisspace(*t)) { t--; }
+ while(t != str && isspace(*t)) { t--; }
*end = t+1;
}
diff --git a/src/3rdparty/squirrel/squirrel/sqapi.cpp b/src/3rdparty/squirrel/squirrel/sqapi.cpp
index 6dc3def6e..1f523e71c 100644
--- a/src/3rdparty/squirrel/squirrel/sqapi.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqapi.cpp
@@ -40,7 +40,7 @@ SQInteger sq_aux_throwobject(HSQUIRRELVM v,SQObjectPtr &e)
SQInteger sq_aux_invalidtype(HSQUIRRELVM v,SQObjectType type)
{
- scsprintf(_ss(v)->GetScratchPad(100), "unexpected type %s", IdType2Name(type));
+ sprintf(_ss(v)->GetScratchPad(100), "unexpected type %s", IdType2Name(type));
return sq_throwerror(v, _ss(v)->GetScratchPad(-1));
}
diff --git a/src/3rdparty/squirrel/squirrel/sqbaselib.cpp b/src/3rdparty/squirrel/squirrel/sqbaselib.cpp
index e952a6081..f29ed60be 100644
--- a/src/3rdparty/squirrel/squirrel/sqbaselib.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqbaselib.cpp
@@ -19,14 +19,14 @@
bool str2num(const SQChar *s,SQObjectPtr &res)
{
SQChar *end;
- if(scstrstr(s,".")){
- SQFloat r = SQFloat(scstrtod(s,&end));
+ if(strstr(s,".")){
+ SQFloat r = SQFloat(strtod(s,&end));
if(s == end) return false;
res = r;
return true;
}
else{
- SQInteger r = SQInteger(scstrtol(s,&end,10));
+ SQInteger r = SQInteger(strtol(s,&end,10));
if(s == end) return false;
res = r;
return true;
@@ -651,7 +651,7 @@ static SQInteger string_find(HSQUIRRELVM v)
if(((top=sq_gettop(v))>1) && SQ_SUCCEEDED(sq_getstring(v,1,&str)) && SQ_SUCCEEDED(sq_getstring(v,2,&substr))){
if(top>2)sq_getinteger(v,3,&start_idx);
if((sq_getsize(v,1)>start_idx) && (start_idx>=0)){
- ret=scstrstr(&str[start_idx],substr);
+ ret=strstr(&str[start_idx],substr);
if(ret){
sq_pushinteger(v,(SQInteger)(ret-str));
return 1;
diff --git a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp
index f0b8536ce..fc6ede6ac 100644
--- a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp
@@ -66,7 +66,7 @@ public:
static SQChar temp[256];
va_list vl;
va_start(vl, s);
- scvsnprintf(temp, sizeof(temp), s, vl);
+ vsnprintf(temp, sizeof(temp), s, vl);
va_end(vl);
throw temp;
}
diff --git a/src/3rdparty/squirrel/squirrel/sqdebug.cpp b/src/3rdparty/squirrel/squirrel/sqdebug.cpp
index 43bf7df04..54f883f4e 100644
--- a/src/3rdparty/squirrel/squirrel/sqdebug.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqdebug.cpp
@@ -60,7 +60,7 @@ void SQVM::Raise_Error(const SQChar *s, ...)
{
va_list vl;
va_start(vl, s);
- scvsprintf(_sp(rsl((SQInteger)scstrlen(s)+(NUMBER_MAX_CHAR*2))), s, vl);
+ vsprintf(_sp(rsl((SQInteger)strlen(s)+(NUMBER_MAX_CHAR*2))), s, vl);
va_end(vl);
_lasterror = SQString::Create(_ss(this),_spval,-1);
}
@@ -75,11 +75,11 @@ SQString *SQVM::PrintObjVal(const SQObject &o)
switch(type(o)) {
case OT_STRING: return _string(o);
case OT_INTEGER:
- scsprintf(_sp(rsl(NUMBER_MAX_CHAR+1)), SQ_PRINTF64, _integer(o));
+ sprintf(_sp(rsl(NUMBER_MAX_CHAR+1)), SQ_PRINTF64, _integer(o));
return SQString::Create(_ss(this), _spval);
break;
case OT_FLOAT:
- scsprintf(_sp(rsl(NUMBER_MAX_CHAR+1)), "%.14g", _float(o));
+ sprintf(_sp(rsl(NUMBER_MAX_CHAR+1)), "%.14g", _float(o));
return SQString::Create(_ss(this), _spval);
break;
default:
diff --git a/src/3rdparty/squirrel/squirrel/sqfuncstate.cpp b/src/3rdparty/squirrel/squirrel/sqfuncstate.cpp
index 760624fba..91219adf8 100644
--- a/src/3rdparty/squirrel/squirrel/sqfuncstate.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqfuncstate.cpp
@@ -78,11 +78,11 @@ SQInstructionDesc g_InstrDesc[]={
void DumpLiteral(SQObjectPtr &o)
{
switch(type(o)){
- case OT_STRING: scprintf("\"%s\"",_stringval(o));break;
- case OT_FLOAT: scprintf("{%f}",_float(o));break;
- case OT_INTEGER: scprintf("{" SQ_PRINTF64 "}",_integer(o));break;
- case OT_BOOL: scprintf("%s",_integer(o)?"true":"false");break;
- default: scprintf("(%s %p)",GetTypeName(o),(void*)_rawval(o));break; break; //shut up compiler
+ case OT_STRING: printf("\"%s\"",_stringval(o));break;
+ case OT_FLOAT: printf("{%f}",_float(o));break;
+ case OT_INTEGER: printf("{" SQ_PRINTF64 "}",_integer(o));break;
+ case OT_BOOL: printf("%s",_integer(o)?"true":"false");break;
+ default: printf("(%s %p)",GetTypeName(o),(void*)_rawval(o));break; break; //shut up compiler
}
}
@@ -115,11 +115,11 @@ void SQFuncState::Dump(SQFunctionProto *func)
{
SQUnsignedInteger n=0,i;
SQInteger si;
- scprintf("SQInstruction sizeof %d\n",sizeof(SQInstruction));
- scprintf("SQObject sizeof %d\n",sizeof(SQObject));
- scprintf("--------------------------------------------------------------------\n");
- scprintf("*****FUNCTION [%s]\n",type(func->_name)==OT_STRING?_stringval(func->_name):"unknown");
- scprintf("-----LITERALS\n");
+ printf("SQInstruction sizeof %d\n",sizeof(SQInstruction));
+ printf("SQObject sizeof %d\n",sizeof(SQObject));
+ printf("--------------------------------------------------------------------\n");
+ printf("*****FUNCTION [%s]\n",type(func->_name)==OT_STRING?_stringval(func->_name):"unknown");
+ printf("-----LITERALS\n");
SQObjectPtr refidx,key,val;
SQInteger idx;
SQObjectPtrVec templiterals;
@@ -129,43 +129,43 @@ void SQFuncState::Dump(SQFunctionProto *func)
templiterals[_integer(val)]=key;
}
for(i=0;i<templiterals.size();i++){
- scprintf("[%d] ",n);
+ printf("[%d] ",n);
DumpLiteral(templiterals[i]);
- scprintf("\n");
+ printf("\n");
n++;
}
- scprintf("-----PARAMS\n");
+ printf("-----PARAMS\n");
if(_varparams)
- scprintf("<<VARPARAMS>>\n");
+ printf("<<VARPARAMS>>\n");
n=0;
for(i=0;i<_parameters.size();i++){
- scprintf("[%d] ",n);
+ printf("[%d] ",n);
DumpLiteral(_parameters[i]);
- scprintf("\n");
+ printf("\n");
n++;
}
- scprintf("-----LOCALS\n");
+ printf("-----LOCALS\n");
for(si=0;si<func->_nlocalvarinfos;si++){
SQLocalVarInfo lvi=func->_localvarinfos[si];
- scprintf("[%d] %s \t%d %d\n",lvi._pos,_stringval(lvi._name),lvi._start_op,lvi._end_op);
+ printf("[%d] %s \t%d %d\n",lvi._pos,_stringval(lvi._name),lvi._start_op,lvi._end_op);
n++;
}
- scprintf("-----LINE INFO\n");
+ printf("-----LINE INFO\n");
for(i=0;i<_lineinfos.size();i++){
SQLineInfo li=_lineinfos[i];
- scprintf("op [%d] line [%d] \n",li._op,li._line);
+ printf("op [%d] line [%d] \n",li._op,li._line);
n++;
}
- scprintf("-----dump\n");
+ printf("-----dump\n");
n=0;
for(i=0;i<_instructions.size();i++){
SQInstruction &inst=_instructions[i];
if(inst.op==_OP_LOAD || inst.op==_OP_DLOAD || inst.op==_OP_PREPCALLK || inst.op==_OP_GETK ){
SQInteger lidx = inst._arg1;
- scprintf("[%03d] %15s %d ",n,g_InstrDesc[inst.op].name,inst._arg0);
+ printf("[%03d] %15s %d ",n,g_InstrDesc[inst.op].name,inst._arg0);
if(lidx >= 0xFFFFFFFF)
- scprintf("null");
+ printf("null");
else {
SQInteger refidx;
SQObjectPtr val,key,refo;
@@ -175,13 +175,13 @@ void SQFuncState::Dump(SQFunctionProto *func)
DumpLiteral(key);
}
if(inst.op != _OP_DLOAD) {
- scprintf(" %d %d \n",inst._arg2,inst._arg3);
+ printf(" %d %d \n",inst._arg2,inst._arg3);
}
else {
- scprintf(" %d ",inst._arg2);
+ printf(" %d ",inst._arg2);
lidx = inst._arg3;
if(lidx >= 0xFFFFFFFF)
- scprintf("null");
+ printf("null");
else {
SQInteger refidx;
SQObjectPtr val,key,refo;
@@ -189,23 +189,23 @@ void SQFuncState::Dump(SQFunctionProto *func)
refo = refidx;
}
DumpLiteral(key);
- scprintf("\n");
+ printf("\n");
}
}
}
else if(inst.op==_OP_LOADFLOAT) {
- scprintf("[%03d] %15s %d %f %d %d\n",n,g_InstrDesc[inst.op].name,inst._arg0,*((SQFloat*)&inst._arg1),inst._arg2,inst._arg3);
+ printf("[%03d] %15s %d %f %d %d\n",n,g_InstrDesc[inst.op].name,inst._arg0,*((SQFloat*)&inst._arg1),inst._arg2,inst._arg3);
}
else if(inst.op==_OP_ARITH){
- scprintf("[%03d] %15s %d %d %d %c\n",n,g_InstrDesc[inst.op].name,inst._arg0,inst._arg1,inst._arg2,inst._arg3);
+ printf("[%03d] %15s %d %d %d %c\n",n,g_InstrDesc[inst.op].name,inst._arg0,inst._arg1,inst._arg2,inst._arg3);
}
else
- scprintf("[%03d] %15s %d %d %d %d\n",n,g_InstrDesc[inst.op].name,inst._arg0,inst._arg1,inst._arg2,inst._arg3);
+ printf("[%03d] %15s %d %d %d %d\n",n,g_InstrDesc[inst.op].name,inst._arg0,inst._arg1,inst._arg2,inst._arg3);
n++;
}
- scprintf("-----\n");
- scprintf("stack size[%d]\n",func->_stacksize);
- scprintf("--------------------------------------------------------------------\n\n");
+ printf("-----\n");
+ printf("stack size[%d]\n",func->_stacksize);
+ printf("--------------------------------------------------------------------\n\n");
}
#endif
diff --git a/src/3rdparty/squirrel/squirrel/sqlexer.cpp b/src/3rdparty/squirrel/squirrel/sqlexer.cpp
index 5d91fa888..4653ab0a8 100644
--- a/src/3rdparty/squirrel/squirrel/sqlexer.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqlexer.cpp
@@ -251,17 +251,17 @@ SQInteger SQLexer::Lex()
case SQUIRREL_EOB:
return 0;
default:{
- if (scisdigit(CUR_CHAR)) {
+ if (isdigit(CUR_CHAR)) {
SQInteger ret = ReadNumber();
RETURN_TOKEN(ret);
}
- else if (scisalpha(CUR_CHAR) || CUR_CHAR == '_') {
+ else if (isalpha(CUR_CHAR) || CUR_CHAR == '_') {
SQInteger t = ReadID();
RETURN_TOKEN(t);
}
else {
SQInteger c = CUR_CHAR;
- if (sciscntrl((int)c)) Error("unexpected character(control)");
+ if (iscntrl((int)c)) Error("unexpected character(control)");
NEXT();
RETURN_TOKEN(c);
}
@@ -317,7 +317,7 @@ SQInteger SQLexer::ReadString(LexChar ndelim,bool verbatim)
}
temp[n] = 0;
SQChar *sTemp;
- APPEND_CHAR((SQChar)scstrtoul(temp,&sTemp,16));
+ APPEND_CHAR((SQChar)strtoul(temp,&sTemp,16));
}
break;
case 't': APPEND_CHAR('\t'); NEXT(); break;
@@ -368,8 +368,8 @@ void LexHexadecimal(const SQChar *s,SQUnsignedInteger *res)
*res = 0;
while(*s != 0)
{
- if(scisdigit(*s)) *res = (*res)*16+((*s++)-'0');
- else if(scisxdigit(*s)) *res = (*res)*16+(toupper(*s++)-'A'+10);
+ if(isdigit(*s)) *res = (*res)*16+((*s++)-'0');
+ else if(isxdigit(*s)) *res = (*res)*16+(toupper(*s++)-'A'+10);
else { assert(0); }
}
}
@@ -417,7 +417,7 @@ SQInteger SQLexer::ReadNumber()
APPEND_CHAR(CUR_CHAR);
NEXT();
}
- if(scisdigit(CUR_CHAR)) Error("invalid octal number");
+ if(isdigit(CUR_CHAR)) Error("invalid octal number");
}
else {
NEXT();
@@ -431,7 +431,7 @@ SQInteger SQLexer::ReadNumber()
}
else {
APPEND_CHAR((int)firstchar);
- while (CUR_CHAR == '.' || scisdigit(CUR_CHAR) || isexponent(CUR_CHAR)) {
+ while (CUR_CHAR == '.' || isdigit(CUR_CHAR) || isexponent(CUR_CHAR)) {
if(CUR_CHAR == '.' || isexponent(CUR_CHAR)) type = TFLOAT;
if(isexponent(CUR_CHAR)) {
if(type != TFLOAT) Error("invalid numeric format");
@@ -442,7 +442,7 @@ SQInteger SQLexer::ReadNumber()
APPEND_CHAR(CUR_CHAR);
NEXT();
}
- if(!scisdigit(CUR_CHAR)) Error("exponent expected");
+ if(!isdigit(CUR_CHAR)) Error("exponent expected");
}
APPEND_CHAR(CUR_CHAR);
@@ -453,7 +453,7 @@ SQInteger SQLexer::ReadNumber()
switch(type) {
case TSCIENTIFIC:
case TFLOAT:
- _fvalue = (SQFloat)scstrtod(&_longstr[0],&sTemp);
+ _fvalue = (SQFloat)strtod(&_longstr[0],&sTemp);
return TK_FLOAT;
case TINT:
LexInteger(&_longstr[0],(SQUnsignedInteger *)&_nvalue);
@@ -475,7 +475,7 @@ SQInteger SQLexer::ReadID()
do {
APPEND_CHAR(CUR_CHAR);
NEXT();
- } while(scisalnum(CUR_CHAR) || CUR_CHAR == '_');
+ } while(isalnum(CUR_CHAR) || CUR_CHAR == '_');
TERMINATE_BUFFER();
res = GetIDType(&_longstr[0]);
if(res == TK_IDENTIFIER || res == TK_CONSTRUCTOR) {
diff --git a/src/3rdparty/squirrel/squirrel/sqstate.cpp b/src/3rdparty/squirrel/squirrel/sqstate.cpp
index 1bc5efd6b..bd270d470 100644
--- a/src/3rdparty/squirrel/squirrel/sqstate.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqstate.cpp
@@ -513,7 +513,7 @@ void SQStringTable::AllocNodes(SQInteger size)
SQString *SQStringTable::Add(const SQChar *news,SQInteger len)
{
if(len<0)
- len = (SQInteger)scstrlen(news);
+ len = (SQInteger)strlen(news);
SQHash h = ::_hashstr(news,(size_t)len)&(_numofslots-1);
SQString *s;
for (s = _strings[h]; s; s = s->_next){
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.cpp b/src/3rdparty/squirrel/squirrel/sqvm.cpp
index b1ff8e5f5..e94f05118 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp
@@ -185,7 +185,7 @@ bool SQVM::ObjCmp(const SQObjectPtr &o1,const SQObjectPtr &o2,SQInteger &result)
SQObjectPtr res;
switch(type(o1)){
case OT_STRING:
- _RET_SUCCEED(scstrcmp(_stringval(o1),_stringval(o2)));
+ _RET_SUCCEED(strcmp(_stringval(o1),_stringval(o2)));
case OT_INTEGER:
/* FS#3954: wrong integer comparison */
_RET_SUCCEED((_integer(o1)<_integer(o2))?-1:(_integer(o1)==_integer(o2))?0:1);
@@ -256,13 +256,13 @@ void SQVM::ToString(const SQObjectPtr &o,SQObjectPtr &res)
res = o;
return;
case OT_FLOAT:
- scsprintf(_sp(rsl(NUMBER_MAX_CHAR+1)),"%g",_float(o));
+ sprintf(_sp(rsl(NUMBER_MAX_CHAR+1)),"%g",_float(o));
break;
case OT_INTEGER:
- scsprintf(_sp(rsl(NUMBER_MAX_CHAR+1)),SQ_PRINTF64,_integer(o));
+ sprintf(_sp(rsl(NUMBER_MAX_CHAR+1)),SQ_PRINTF64,_integer(o));
break;
case OT_BOOL:
- scsprintf(_sp(rsl(6)),_integer(o)?"true":"false");
+ sprintf(_sp(rsl(6)),_integer(o)?"true":"false");
break;
case OT_TABLE:
case OT_USERDATA:
@@ -276,7 +276,7 @@ void SQVM::ToString(const SQObjectPtr &o,SQObjectPtr &res)
}
}
default:
- scsprintf(_sp(rsl(sizeof(void*)+20)),"(%s : 0x%p)",GetTypeName(o),(void*)_rawval(o));
+ sprintf(_sp(rsl(sizeof(void*)+20)),"(%s : 0x%p)",GetTypeName(o),(void*)_rawval(o));
}
res = SQString::Create(_ss(this),_spval);
}
@@ -735,7 +735,7 @@ exception_restore:
const SQInstruction &_i_ = *ci->_ip++;
//dumpstack(_stackbase);
- //scprintf("%s %d %d %d %d\n",g_InstrDesc[_i_.op].name,arg0,arg1,arg2,arg3);
+ //printf("%s %d %d %d %d\n",g_InstrDesc[_i_.op].name,arg0,arg1,arg2,arg3);
switch(_i_.op)
{
case _OP_LINE:
@@ -1554,37 +1554,37 @@ void SQVM::dumpstack(SQInteger stackbase,bool dumpall)
{
SQInteger size=dumpall?_stack.size():_top;
SQInteger n=0;
- scprintf("\n>>>>stack dump<<<<\n");
+ printf("\n>>>>stack dump<<<<\n");
CallInfo &ci=_callsstack[_callsstacksize-1];
- scprintf("IP: %p\n",ci._ip);
- scprintf("prev stack base: %d\n",ci._prevstkbase);
- scprintf("prev top: %d\n",ci._prevtop);
+ printf("IP: %p\n",ci._ip);
+ printf("prev stack base: %d\n",ci._prevstkbase);
+ printf("prev top: %d\n",ci._prevtop);
for(SQInteger i=0;i<size;i++){
SQObjectPtr &obj=_stack[i];
- if(stackbase==i)scprintf(">");else scprintf(" ");
- scprintf("[%d]:",n);
+ if(stackbase==i)printf(">");else printf(" ");
+ printf("[%d]:",n);
switch(type(obj)){
- case OT_FLOAT: scprintf("FLOAT %.3f",_float(obj));break;
- case OT_INTEGER: scprintf("INTEGER %d",_integer(obj));break;
- case OT_BOOL: scprintf("BOOL %s",_integer(obj)?"true":"false");break;
- case OT_STRING: scprintf("STRING %s",_stringval(obj));break;
- case OT_NULL: scprintf("NULL"); break;
- case OT_TABLE: scprintf("TABLE %p[%p]",_table(obj),_table(obj)->_delegate);break;
- case OT_ARRAY: scprintf("ARRAY %p",_array(obj));break;
- case OT_CLOSURE: scprintf("CLOSURE [%p]",_closure(obj));break;
- case OT_NATIVECLOSURE: scprintf("NATIVECLOSURE");break;
- case OT_USERDATA: scprintf("USERDATA %p[%p]",_userdataval(obj),_userdata(obj)->_delegate);break;
- case OT_GENERATOR: scprintf("GENERATOR %p",_generator(obj));break;
- case OT_THREAD: scprintf("THREAD [%p]",_thread(obj));break;
- case OT_USERPOINTER: scprintf("USERPOINTER %p",_userpointer(obj));break;
- case OT_CLASS: scprintf("CLASS %p",_class(obj));break;
- case OT_INSTANCE: scprintf("INSTANCE %p",_instance(obj));break;
- case OT_WEAKREF: scprintf("WEAKERF %p",_weakref(obj));break;
+ case OT_FLOAT: printf("FLOAT %.3f",_float(obj));break;
+ case OT_INTEGER: printf("INTEGER %d",_integer(obj));break;
+ case OT_BOOL: printf("BOOL %s",_integer(obj)?"true":"false");break;
+ case OT_STRING: printf("STRING %s",_stringval(obj));break;
+ case OT_NULL: printf("NULL"); break;
+ case OT_TABLE: printf("TABLE %p[%p]",_table(obj),_table(obj)->_delegate);break;
+ case OT_ARRAY: printf("ARRAY %p",_array(obj));break;
+ case OT_CLOSURE: printf("CLOSURE [%p]",_closure(obj));break;
+ case OT_NATIVECLOSURE: printf("NATIVECLOSURE");break;
+ case OT_USERDATA: printf("USERDATA %p[%p]",_userdataval(obj),_userdata(obj)->_delegate);break;
+ case OT_GENERATOR: printf("GENERATOR %p",_generator(obj));break;
+ case OT_THREAD: printf("THREAD [%p]",_thread(obj));break;
+ case OT_USERPOINTER: printf("USERPOINTER %p",_userpointer(obj));break;
+ case OT_CLASS: printf("CLASS %p",_class(obj));break;
+ case OT_INSTANCE: printf("INSTANCE %p",_instance(obj));break;
+ case OT_WEAKREF: printf("WEAKERF %p",_weakref(obj));break;
default:
assert(0);
break;
};
- scprintf("\n");
+ printf("\n");
++n;
}
}