Replaced lua_isXYZ with cLuaState::CheckParamXYZ
This commit is contained in:
parent
174f508021
commit
8c8ec1094d
@ -115,10 +115,10 @@ static int tolua_CompressStringZLIB(lua_State * tolua_S)
|
|||||||
{
|
{
|
||||||
cLuaState S(tolua_S);
|
cLuaState S(tolua_S);
|
||||||
if (
|
if (
|
||||||
!lua_isstring(tolua_S, 1) ||
|
!S.CheckParamString(1) &&
|
||||||
(
|
(
|
||||||
!lua_isnumber(tolua_S, 2) &&
|
!S.CheckParamNumber(2) ||
|
||||||
!lua_isnil(tolua_S, 2)
|
!S.CheckParamEnd(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -146,8 +146,8 @@ static int tolua_UncompressStringZLIB(lua_State * tolua_S)
|
|||||||
{
|
{
|
||||||
cLuaState S(tolua_S);
|
cLuaState S(tolua_S);
|
||||||
if (
|
if (
|
||||||
!lua_isstring(tolua_S, 1) ||
|
!S.CheckParamString(1) &&
|
||||||
!lua_isnumber(tolua_S, 2)
|
!S.CheckParamNumber(2)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
cLuaState::LogStackTrace(tolua_S);
|
cLuaState::LogStackTrace(tolua_S);
|
||||||
@ -173,7 +173,10 @@ static int tolua_UncompressStringZLIB(lua_State * tolua_S)
|
|||||||
static int tolua_CompressStringGZIP(lua_State * tolua_S)
|
static int tolua_CompressStringGZIP(lua_State * tolua_S)
|
||||||
{
|
{
|
||||||
cLuaState S(tolua_S);
|
cLuaState S(tolua_S);
|
||||||
if (!lua_isstring(tolua_S, 1))
|
if (
|
||||||
|
!S.CheckParamString(1) &&
|
||||||
|
!S.CheckParamEnd(2)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
cLuaState::LogStackTrace(tolua_S);
|
cLuaState::LogStackTrace(tolua_S);
|
||||||
return 0;
|
return 0;
|
||||||
@ -198,15 +201,14 @@ static int tolua_UncompressStringGZIP(lua_State * tolua_S)
|
|||||||
{
|
{
|
||||||
cLuaState S(tolua_S);
|
cLuaState S(tolua_S);
|
||||||
if (
|
if (
|
||||||
!lua_isstring(tolua_S, 1)
|
!S.CheckParamString(1) &&
|
||||||
|
!S.CheckParamEnd(2)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
cLuaState::LogStackTrace(tolua_S);
|
cLuaState::LogStackTrace(tolua_S);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Get the params:
|
// Get the params:
|
||||||
AString ToUncompress;
|
AString ToUncompress;
|
||||||
S.GetStackValues(1, ToUncompress);
|
S.GetStackValues(1, ToUncompress);
|
||||||
@ -226,15 +228,14 @@ static int tolua_InflateString(lua_State * tolua_S)
|
|||||||
{
|
{
|
||||||
cLuaState S(tolua_S);
|
cLuaState S(tolua_S);
|
||||||
if (
|
if (
|
||||||
!lua_isstring(tolua_S, 1)
|
!S.CheckParamString(1) &&
|
||||||
|
!S.CheckParamEnd(2)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
cLuaState::LogStackTrace(tolua_S);
|
cLuaState::LogStackTrace(tolua_S);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Get the params:
|
// Get the params:
|
||||||
AString ToUncompress;
|
AString ToUncompress;
|
||||||
S.GetStackValues(1, ToUncompress);
|
S.GetStackValues(1, ToUncompress);
|
||||||
|
Loading…
Reference in New Issue
Block a user