some sq_type were missing

This commit is contained in:
albertodemichelis 2017-11-17 04:13:59 +08:00
parent ab7243ca59
commit 3835c65eab
4 changed files with 4 additions and 4 deletions

View File

@ -1197,7 +1197,7 @@ SQRESULT sq_call(HSQUIRRELVM v,SQInteger params,SQBool retval,SQBool raiseerror)
SQRESULT sq_tailcall(HSQUIRRELVM v, SQInteger nparams) SQRESULT sq_tailcall(HSQUIRRELVM v, SQInteger nparams)
{ {
SQObjectPtr &res = v->GetUp(-(nparams + 1)); 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")); return sq_throwerror(v, _SC("only closure can be tail called"));
} }
SQClosure *clo = _closure(res); SQClosure *clo = _closure(res);

View File

@ -886,7 +886,7 @@ static SQInteger closure_pcall(HSQUIRRELVM v)
static SQInteger closure_call(HSQUIRRELVM v) static SQInteger closure_call(HSQUIRRELVM v)
{ {
SQObjectPtr &c = stack_get(v, -1); 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); return sq_tailcall(v, sq_gettop(v) - 1);
} }

View File

@ -120,7 +120,7 @@ void SQFuncState::Dump(SQFunctionProto *func)
scprintf(_SC("SQInstruction sizeof %d\n"),(SQInt32)sizeof(SQInstruction)); scprintf(_SC("SQInstruction sizeof %d\n"),(SQInt32)sizeof(SQInstruction));
scprintf(_SC("SQObject sizeof %d\n"), (SQInt32)sizeof(SQObject)); scprintf(_SC("SQObject sizeof %d\n"), (SQInt32)sizeof(SQObject));
scprintf(_SC("--------------------------------------------------------------------\n")); 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")); scprintf(_SC("-----LITERALS\n"));
SQObjectPtr refidx,key,val; SQObjectPtr refidx,key,val;
SQInteger idx; SQInteger idx;

View File

@ -1747,7 +1747,7 @@ void SQVM::dumpstack(SQInteger stackbase,bool dumpall)
SQObjectPtr &obj=_stack[i]; SQObjectPtr &obj=_stack[i];
if(stackbase==i)scprintf(_SC(">"));else scprintf(_SC(" ")); if(stackbase==i)scprintf(_SC(">"));else scprintf(_SC(" "));
scprintf(_SC("[" _PRINT_INT_FMT "]:"),n); 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_FLOAT: scprintf(_SC("FLOAT %.3f"),_float(obj));break;
case OT_INTEGER: scprintf(_SC("INTEGER " _PRINT_INT_FMT),_integer(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; case OT_BOOL: scprintf(_SC("BOOL %s"),_integer(obj)?"true":"false");break;