From 0c9d43217432499d757eb65af483085505a6c601 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Wed, 13 Sep 2017 00:47:11 -0400 Subject: fix `lua_Integer` casts that error on Visual C++ and other pedantic conversion-warning compilers for 64-bit builds --- c-api/compat-5.3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c-api/compat-5.3.c b/c-api/compat-5.3.c index fab89c0..811f248 100644 --- a/c-api/compat-5.3.c +++ b/c-api/compat-5.3.c @@ -101,11 +101,11 @@ COMPAT53_API void lua_copy (lua_State *L, int from, int to) { COMPAT53_API void lua_len (lua_State *L, int i) { switch (lua_type(L, i)) { case LUA_TSTRING: - lua_pushnumber(L, (lua_Integer)lua_objlen(L, i)); + lua_pushnumber(L, (lua_Number)lua_objlen(L, i)); break; case LUA_TTABLE: if (!luaL_callmeta(L, i, "__len")) - lua_pushnumber(L, (lua_Integer)lua_objlen(L, i)); + lua_pushnumber(L, (lua_Number)lua_objlen(L, i)); break; case LUA_TUSERDATA: if (luaL_callmeta(L, i, "__len")) -- cgit v1.2.3-55-g6feb