aboutsummaryrefslogtreecommitdiff
path: root/c-api/compat-5.3.c
diff options
context:
space:
mode:
authorThePhD <phdofthehouse@gmail.com>2017-09-13 00:47:11 -0400
committerThePhD <phdofthehouse@gmail.com>2017-09-13 00:47:11 -0400
commit0c9d43217432499d757eb65af483085505a6c601 (patch)
tree8ce6a3c1bff4e2562c4772d2d188b101d9757c04 /c-api/compat-5.3.c
parent08212947bb97a5fffa2e56ddd6313710758896d0 (diff)
downloadlua-compat-5.3-0c9d43217432499d757eb65af483085505a6c601.tar.gz
lua-compat-5.3-0c9d43217432499d757eb65af483085505a6c601.tar.bz2
lua-compat-5.3-0c9d43217432499d757eb65af483085505a6c601.zip
fix `lua_Integer` casts that error on Visual C++ and other pedantic conversion-warning compilers for 64-bit builds
Diffstat (limited to 'c-api/compat-5.3.c')
-rw-r--r--c-api/compat-5.3.c4
1 files 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) {
101COMPAT53_API void lua_len (lua_State *L, int i) { 101COMPAT53_API void lua_len (lua_State *L, int i) {
102 switch (lua_type(L, i)) { 102 switch (lua_type(L, i)) {
103 case LUA_TSTRING: 103 case LUA_TSTRING:
104 lua_pushnumber(L, (lua_Integer)lua_objlen(L, i)); 104 lua_pushnumber(L, (lua_Number)lua_objlen(L, i));
105 break; 105 break;
106 case LUA_TTABLE: 106 case LUA_TTABLE:
107 if (!luaL_callmeta(L, i, "__len")) 107 if (!luaL_callmeta(L, i, "__len"))
108 lua_pushnumber(L, (lua_Integer)lua_objlen(L, i)); 108 lua_pushnumber(L, (lua_Number)lua_objlen(L, i));
109 break; 109 break;
110 case LUA_TUSERDATA: 110 case LUA_TUSERDATA:
111 if (luaL_callmeta(L, i, "__len")) 111 if (luaL_callmeta(L, i, "__len"))