From 3835c65eab07591e029f78fc3b4f302005e010d2 Mon Sep 17 00:00:00 2001 From: albertodemichelis Date: Fri, 17 Nov 2017 04:13:59 +0800 Subject: [PATCH] some sq_type were missing --- squirrel/sqapi.cpp | 2 +- squirrel/sqbaselib.cpp | 2 +- squirrel/sqfuncstate.cpp | 2 +- squirrel/sqvm.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/squirrel/sqapi.cpp b/squirrel/sqapi.cpp index 6c35893..e4e8276 100644 --- a/squirrel/sqapi.cpp +++ b/squirrel/sqapi.cpp @@ -1197,7 +1197,7 @@ SQRESULT sq_call(HSQUIRRELVM v,SQInteger params,SQBool retval,SQBool raiseerror) SQRESULT sq_tailcall(HSQUIRRELVM v, SQInteger nparams) { SQObjectPtr &res = v->GetUp(-(nparams + 1)); - if (type(res) != OT_CLOSURE) { + if (sq_type(res) != OT_CLOSURE) { return sq_throwerror(v, _SC("only closure can be tail called")); } SQClosure *clo = _closure(res); diff --git a/squirrel/sqbaselib.cpp b/squirrel/sqbaselib.cpp index 6b0e6ed..fdca644 100644 --- a/squirrel/sqbaselib.cpp +++ b/squirrel/sqbaselib.cpp @@ -886,7 +886,7 @@ static SQInteger closure_pcall(HSQUIRRELVM v) static SQInteger closure_call(HSQUIRRELVM v) { SQObjectPtr &c = stack_get(v, -1); - if (type(c) == OT_CLOSURE && (_closure(c)->_function->_bgenerator == false)) + if (sq_type(c) == OT_CLOSURE && (_closure(c)->_function->_bgenerator == false)) { return sq_tailcall(v, sq_gettop(v) - 1); } diff --git a/squirrel/sqfuncstate.cpp b/squirrel/sqfuncstate.cpp index 522f336..6d633c7 100644 --- a/squirrel/sqfuncstate.cpp +++ b/squirrel/sqfuncstate.cpp @@ -120,7 +120,7 @@ void SQFuncState::Dump(SQFunctionProto *func) scprintf(_SC("SQInstruction sizeof %d\n"),(SQInt32)sizeof(SQInstruction)); scprintf(_SC("SQObject sizeof %d\n"), (SQInt32)sizeof(SQObject)); scprintf(_SC("--------------------------------------------------------------------\n")); - scprintf(_SC("*****FUNCTION [%s]\n"),type(func->_name)==OT_STRING?_stringval(func->_name):_SC("unknown")); + scprintf(_SC("*****FUNCTION [%s]\n"),sq_type(func->_name)==OT_STRING?_stringval(func->_name):_SC("unknown")); scprintf(_SC("-----LITERALS\n")); SQObjectPtr refidx,key,val; SQInteger idx; diff --git a/squirrel/sqvm.cpp b/squirrel/sqvm.cpp index 505cb9c..3cb643a 100644 --- a/squirrel/sqvm.cpp +++ b/squirrel/sqvm.cpp @@ -1747,7 +1747,7 @@ void SQVM::dumpstack(SQInteger stackbase,bool dumpall) SQObjectPtr &obj=_stack[i]; if(stackbase==i)scprintf(_SC(">"));else scprintf(_SC(" ")); scprintf(_SC("[" _PRINT_INT_FMT "]:"),n); - switch(type(obj)){ + switch(sq_type(obj)){ case OT_FLOAT: scprintf(_SC("FLOAT %.3f"),_float(obj));break; case OT_INTEGER: scprintf(_SC("INTEGER " _PRINT_INT_FMT),_integer(obj));break; case OT_BOOL: scprintf(_SC("BOOL %s"),_integer(obj)?"true":"false");break;