Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lbaselib cleanup #38

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/lbaselib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ unsafe extern "C" fn luaB_getmetatable(L: *mut lua_State) -> c_int {

unsafe extern "C" fn luaB_setmetatable(L: *mut lua_State) -> c_int {
let _t = lua_type(L, 2);
// TODO: FIX
luaL_checktype(L, 1, LUA_TTABLE); // FIXME? t is unused?
luaL_checktype(L, 1, LUA_TTABLE);
// FIXME
//luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2,
// "nil or table expected");
if luaL_getmetafield(L, 1, cstr!("__metatable")) != LUA_TNIL {
luaL_error(L, cstr!("cannot change a protected metatable"));
}
Expand Down Expand Up @@ -396,7 +398,7 @@ unsafe extern "C" fn generic_reader(
}

unsafe extern "C" fn luaB_load(L: *mut lua_State) -> c_int {
let status;
let status: c_int;
let mut l: size_t = 0;
let s = lua_tolstring(L, 1 as c_int, &mut l);
let mode = luaL_optstring(L, 3, cstr!("bt"));
Expand Down