Don't use deprecated LUA API's

This commit is contained in:
Tom van Dijck 2015-09-02 14:01:10 -07:00
parent aeca0bb3fd
commit 66b2febb3e
5 changed files with 11 additions and 11 deletions

View File

@ -84,11 +84,11 @@
function make.esc(value)
result = value:gsub("\\", "\\\\")
result = result:gsub(" ", "\\ ")
result = result:gsub("%(", "\\%(")
result = result:gsub("%)", "\\%)")
result = result:gsub("%(", "\\(")
result = result:gsub("%)", "\\)")
-- leave $(...) shell replacement sequences alone
result = result:gsub("$\\%((.-)\\%)", "$%(%1%)")
result = result:gsub("$\\%((.-)\\%)", "$(%1)")
return result
end

View File

@ -333,14 +333,14 @@
** CHANGE it to undefined as soon as your programs use only '...' to
** access vararg parameters (instead of the old 'arg' table).
*/
#define LUA_COMPAT_VARARG
#undef LUA_COMPAT_VARARG
/*
@@ LUA_COMPAT_MOD controls compatibility with old math.mod function.
** CHANGE it to undefined as soon as your programs use 'math.fmod' or
** the new '%' operator instead of 'math.mod'.
*/
#define LUA_COMPAT_MOD
#undef LUA_COMPAT_MOD
/*
@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting
@ -355,7 +355,7 @@
** CHANGE it to undefined as soon as you rename 'string.gfind' to
** 'string.gmatch'.
*/
#define LUA_COMPAT_GFIND
#undef LUA_COMPAT_GFIND
/*
@@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib'
@ -363,7 +363,7 @@
** CHANGE it to undefined as soon as you replace to 'luaL_register'
** your uses of 'luaL_openlib'
*/
#define LUA_COMPAT_OPENLIB
#undef LUA_COMPAT_OPENLIB

View File

@ -438,7 +438,7 @@ static int process_arguments(lua_State* L, int argc, const char** argv)
for (i = 1; i < argc; ++i)
{
lua_pushstring(L, argv[i]);
lua_rawseti(L, -2, luaL_getn(L, -2) + 1);
lua_rawseti(L, -2, lua_objlen(L, -2) + 1);
/* The /scripts option gets picked up here; used later to find the
* manifest and scripts later if necessary */

View File

@ -11,7 +11,7 @@ int main(int argc, const char** argv)
lua_State* L;
int z;
L = lua_open();
L = luaL_newstate();
luaL_openlibs(L);
z = premake_init(L);

View File

@ -40,8 +40,8 @@
local actual = premake.captured() .. premake.eol()
-- create line-by-line iterators for both values
local ait = actual:gfind("(.-)" .. premake.eol())
local eit = expected:gfind("(.-)\n")
local ait = actual:gmatch("(.-)" .. premake.eol())
local eit = expected:gmatch("(.-)\n")
-- compare each value line by line
local linenum = 1