mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
move variable fetching from Lua out of min/max macros
This commit is contained in:
parent
c8cdded81e
commit
604ae7d072
1 changed files with 6 additions and 2 deletions
|
@ -32,13 +32,17 @@ static int lib_abs(lua_State *L)
|
|||
|
||||
static int lib_min(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, min(luaL_checkinteger(L, 1), luaL_checkinteger(L, 2)));
|
||||
int a = luaL_checkinteger(L, 1);
|
||||
int b = luaL_checkinteger(L, 2);
|
||||
lua_pushinteger(L, min(a,b));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_max(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, max(luaL_checkinteger(L, 1), luaL_checkinteger(L, 2)));
|
||||
int a = luaL_checkinteger(L, 1);
|
||||
int b = luaL_checkinteger(L, 2);
|
||||
lua_pushinteger(L, max(a,b));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue