Is this lua_settop(L, 0) or any
other remove, ... not
needed?
static int Lcm_smw16(lua_State *L)
{
Lcm* ud = (Lcm*)luaL_checkudata(L, 1, "Lcm");
int a = luaL_checkint(L, 2);
int d = luaL_checkint(L, 3);
int blind = luaL_optint(L, 4, 0);
lua_settop(L, 0); // <=== no need for this
stack adjustment ?
lua_pushnumber(L, ud->smw16(a, d, blind));
return 1;
}
Exactly, it's not needed. The
return 1 already tells the interpreter that you only return the
top element of the stack.
--
Thomas
|