From 160184d2ddf0add44b20ba9065934b5646b1b03c Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 21 Apr 2016 21:52:13 -0500 Subject: [PATCH] Revert "add some stack-condition error checking to sqstdlib registration routines" This reverts part of commit b9fc9317520586f281a52ec3613205cd6b2018d5. --- sqstdlib/sqstdio.cpp | 2 -- sqstdlib/sqstdmath.cpp | 2 -- sqstdlib/sqstdstring.cpp | 2 -- sqstdlib/sqstdsystem.cpp | 2 -- 4 files changed, 8 deletions(-) diff --git a/sqstdlib/sqstdio.cpp b/sqstdlib/sqstdio.cpp index 83d2b66..84c225a 100644 --- a/sqstdlib/sqstdio.cpp +++ b/sqstdlib/sqstdio.cpp @@ -472,8 +472,6 @@ static const SQRegFunction iolib_funcs[]={ SQRESULT sqstd_register_iolib(HSQUIRRELVM v) { - if(sq_gettype(v,-1) != OT_TABLE) - return sq_throwerror(v,_SC("table expected")); SQInteger top = sq_gettop(v); //create delegate declare_stream(v,_SC("file"),(SQUserPointer)SQSTD_FILE_TYPE_TAG,_SC("std_file"),_file_methods,iolib_funcs); diff --git a/sqstdlib/sqstdmath.cpp b/sqstdlib/sqstdmath.cpp index 038ba5c..c41ffd5 100644 --- a/sqstdlib/sqstdmath.cpp +++ b/sqstdlib/sqstdmath.cpp @@ -88,8 +88,6 @@ static const SQRegFunction mathlib_funcs[] = { SQRESULT sqstd_register_mathlib(HSQUIRRELVM v) { - if(sq_gettype(v,-1) != OT_TABLE) - return sq_throwerror(v,_SC("table expected")); SQInteger i=0; while(mathlib_funcs[i].name!=0) { sq_pushstring(v,mathlib_funcs[i].name,-1); diff --git a/sqstdlib/sqstdstring.cpp b/sqstdlib/sqstdstring.cpp index 8537891..5b8074b 100644 --- a/sqstdlib/sqstdstring.cpp +++ b/sqstdlib/sqstdstring.cpp @@ -473,8 +473,6 @@ static const SQRegFunction stringlib_funcs[]={ SQInteger sqstd_register_stringlib(HSQUIRRELVM v) { - if(sq_gettype(v,-1) != OT_TABLE) - return sq_throwerror(v,_SC("table expected")); sq_pushstring(v,_SC("regexp"),-1); sq_newclass(v,SQFalse); SQInteger i = 0; diff --git a/sqstdlib/sqstdsystem.cpp b/sqstdlib/sqstdsystem.cpp index 2b4190c..b008a44 100644 --- a/sqstdlib/sqstdsystem.cpp +++ b/sqstdlib/sqstdsystem.cpp @@ -132,8 +132,6 @@ static const SQRegFunction systemlib_funcs[]={ SQInteger sqstd_register_systemlib(HSQUIRRELVM v) { - if(sq_gettype(v,-1) != OT_TABLE) - return sq_throwerror(v,_SC("table expected")); SQInteger i=0; while(systemlib_funcs[i].name!=0) {