Skip to content
Snippets Groups Projects
Commit 604ae7d0 authored by Inuyasha's avatar Inuyasha
Browse files

move variable fetching from Lua out of min/max macros

parent c8cdded8
No related branches found
No related tags found
No related merge requests found
...@@ -32,13 +32,17 @@ static int lib_abs(lua_State *L) ...@@ -32,13 +32,17 @@ static int lib_abs(lua_State *L)
static int lib_min(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; return 1;
} }
static int lib_max(lua_State *L) 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; return 1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment