Changed calling conventions again

This commit is contained in:
2020-12-05 18:57:53 -05:00
parent 150a71433b
commit c751678179
14 changed files with 403 additions and 219 deletions

View File

@@ -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>);
}