From 5a7de075a2e13eacf3bcd200bc18e5f3c0eba037 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Sun, 13 Dec 2015 23:32:27 +0100 Subject: [PATCH] lua_misc.cpp: Fix compiler error 'overflow in implicit constant conversion' - Set Lua api version to 1.26 --- src/gui/lua/lua_misc.cpp | 4 ++-- src/gui/lua/luainstance.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/lua/lua_misc.cpp b/src/gui/lua/lua_misc.cpp index 03b396975..072b44802 100644 --- a/src/gui/lua/lua_misc.cpp +++ b/src/gui/lua/lua_misc.cpp @@ -118,12 +118,12 @@ int CLuaInstMisc::strSub(lua_State *L) return 1; } const char *s1; - int pos=0, len=std::string::npos; + size_t pos=0, len=std::string::npos; std::string ret=""; s1 = luaL_checkstring(L, 2); pos = luaL_checkint(L, 3); if (numargs > 3) - len = luaL_checkint(L, 4); + len = (size_t)luaL_checkint(L, 4); std::string str(s1); ret = str.substr(pos, len); diff --git a/src/gui/lua/luainstance.h b/src/gui/lua/luainstance.h index 96cce8fee..c77fc2b5b 100644 --- a/src/gui/lua/luainstance.h +++ b/src/gui/lua/luainstance.h @@ -31,7 +31,7 @@ extern "C" { #include "luainstance_helpers.h" #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 25 +#define LUA_API_VERSION_MINOR 26 /* inspired by Steve Kemp http://www.steve.org.uk/ */ class CLuaInstance