diff options
Diffstat (limited to 'src/lua/net/luaopen_Buffer.cpp')
-rw-r--r-- | src/lua/net/luaopen_Buffer.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lua/net/luaopen_Buffer.cpp b/src/lua/net/luaopen_Buffer.cpp index 3a8353b..9278544 100644 --- a/src/lua/net/luaopen_Buffer.cpp +++ b/src/lua/net/luaopen_Buffer.cpp @@ -23,15 +23,15 @@ namespace net { Buffer* buffer = checkNetBuffer(L); const int vp = 2; - if (luax_isinteger(L, vp)) + if (luax_isintegerstrict(L, vp)) { int n = luax_checkinteger(L, vp); int size = sizeof(n); buffer->append(&n, size); luax_pushinteger(L, size); return 1; - } - else if (luax_isfloat(L, vp)) + } + else if (luax_isfloatstrict(L, vp)) { float n = luax_checknumber(L, vp); int size = sizeof(n); @@ -39,7 +39,7 @@ namespace net luax_pushinteger(L, size); return 1; } - else if (luax_isboolean(L, vp)) + else if (luax_isbooleanstrict(L, vp)) { bool n = luax_checkbool(L, vp); int size = sizeof(n); @@ -47,7 +47,7 @@ namespace net luax_pushinteger(L, size); return 1; } - else if (luax_isstring(L, vp)) + else if (luax_isstringstrict(L, vp)) { const char* str = luax_checkstring(L, vp); int size = strlen(str) + 1; @@ -83,7 +83,7 @@ namespace net int integer = buffer->grabInteger(&len, offset); luax_pushinteger(L, integer); luax_pushinteger(L, len); - return 1; + return 2; } static int l_grabFloat(lua_State* L) @@ -94,7 +94,7 @@ namespace net float floatv = buffer->grabFloat(&len, offset); luax_pushnumber(L, floatv); luax_pushinteger(L, len); - return 1; + return 2; } static int l_grabBoolean(lua_State* L) @@ -105,7 +105,7 @@ namespace net bool boolean = buffer->grabBoolean(&len, offset); luax_pushboolean(L, boolean); luax_pushinteger(L, len); - return 1; + return 2; } static const luaL_Reg netbuffer_function[] = { |