From 5d6b15859e25da8271a3820662bb9d1f8a935107 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 3 Apr 2017 22:12:57 +1000 Subject: Remove need for LUA_COMPAT_APIINTCASTS --- src/GNUmakefile | 2 +- src/openssl.c | 38 +++++++++++++++----------------------- 2 files changed, 16 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/GNUmakefile b/src/GNUmakefile index 132f3bf..9e4fde4 100644 --- a/src/GNUmakefile +++ b/src/GNUmakefile @@ -20,7 +20,7 @@ OS_$(d) = $(shell $(d)/../mk/vendor.os) CC_$(d) = $(shell env CC="$(CC) "$(d)/../mk/vendor.cc) LUAPATH_$(d) = $(shell env CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(= sizeof r) { - N = luaL_checkunsigned(L, 1); - } else { - N = luaL_checknumber(L, 1); - } + N = auxL_checkunsigned(L, 1); luaL_argcheck(L, N > 1, 1, lua_pushfstring(L, "[0, %d): interval is empty", (int)N)); @@ -9941,11 +9937,7 @@ static int rand_uniform(lua_State *L) { r = r % N; } - if (sizeof (lua_Unsigned) >= sizeof r) { - lua_pushunsigned(L, r); - } else { - lua_pushnumber(L, r); - } + auxL_pushunsigned(L, r); return 1; } /* rand_uniform() */ -- cgit v1.2.3-59-g8ed1b