lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Hackers,
How should the stack look after the calls below?

    lua_pushinteger(L, p1);
    lua_pushinteger(L, p2);
    lua_pushinteger(L, p3);
    lua_pushnumber(L, p4);
    lua_call(L, 4, 1);
    if (lua_isuserdata(L, -1)) {
        value = lua_tonumber(L, -1);
        lua_pop(L, 1);
    }
    lua_pop(L, lua_gettop(L));

What is the correct way to clean the stack?

regards,
Ranier Vilela