1
0

Replaced lua_isXYZ with cLuaState::CheckParamXYZ

This commit is contained in:
STRWarrior 2015-02-23 15:29:07 +01:00
parent 174f508021
commit 8c8ec1094d

View File

@ -115,10 +115,10 @@ static int tolua_CompressStringZLIB(lua_State * tolua_S)
{
cLuaState S(tolua_S);
if (
!lua_isstring(tolua_S, 1) ||
!S.CheckParamString(1) &&
(
!lua_isnumber(tolua_S, 2) &&
!lua_isnil(tolua_S, 2)
!S.CheckParamNumber(2) ||
!S.CheckParamEnd(2)
)
)
{
@ -146,8 +146,8 @@ static int tolua_UncompressStringZLIB(lua_State * tolua_S)
{
cLuaState S(tolua_S);
if (
!lua_isstring(tolua_S, 1) ||
!lua_isnumber(tolua_S, 2)
!S.CheckParamString(1) &&
!S.CheckParamNumber(2)
)
{
cLuaState::LogStackTrace(tolua_S);
@ -173,7 +173,10 @@ static int tolua_UncompressStringZLIB(lua_State * tolua_S)
static int tolua_CompressStringGZIP(lua_State * tolua_S)
{
cLuaState S(tolua_S);
if (!lua_isstring(tolua_S, 1))
if (
!S.CheckParamString(1) &&
!S.CheckParamEnd(2)
)
{
cLuaState::LogStackTrace(tolua_S);
return 0;
@ -198,15 +201,14 @@ static int tolua_UncompressStringGZIP(lua_State * tolua_S)
{
cLuaState S(tolua_S);
if (
!lua_isstring(tolua_S, 1)
!S.CheckParamString(1) &&
!S.CheckParamEnd(2)
)
{
cLuaState::LogStackTrace(tolua_S);
return 0;
}
// Get the params:
AString ToUncompress;
S.GetStackValues(1, ToUncompress);
@ -226,15 +228,14 @@ static int tolua_InflateString(lua_State * tolua_S)
{
cLuaState S(tolua_S);
if (
!lua_isstring(tolua_S, 1)
!S.CheckParamString(1) &&
!S.CheckParamEnd(2)
)
{
cLuaState::LogStackTrace(tolua_S);
return 0;
}
// Get the params:
AString ToUncompress;
S.GetStackValues(1, ToUncompress);