Changed calling conventions again
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
#include "table.hpp"
|
||||
#include "source.hpp"
|
||||
|
||||
// Clear the table. Removes metatable and all key-value pairs.
|
||||
int lpx_table_clear(lua_State *L) {
|
||||
LuaDefineGlobalMethod(table_clear) {
|
||||
LuaArg tab;
|
||||
LuaStack LS(L, tab);
|
||||
|
||||
@@ -20,7 +21,7 @@ int lpx_table_clear(lua_State *L) {
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
int lpx_table_coerce(lua_State *L) {
|
||||
LuaDefineGlobalMethod(table_coerce) {
|
||||
if (!lua_istable(L, -1)) {
|
||||
lua_pop(L, 1);
|
||||
lua_newtable(L);
|
||||
@@ -28,7 +29,3 @@ int lpx_table_coerce(lua_State *L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void luaopen_lpx_table (lua_State *L) {
|
||||
LuaStack::reg(L, "table", "clear", LuaArgCheck<1, lpx_table_clear>);
|
||||
LuaStack::reg(L, "table", "coerce", LuaArgCheck<1, lpx_table_coerce>);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user