diff options
author | Guilherme Lepsch <lepsch@expertisesolutions.com.br> | 2015-07-15 15:28:22 -0300 |
---|---|---|
committer | Guilherme Lepsch <lepsch@expertisesolutions.com.br> | 2015-07-30 13:44:31 -0300 |
commit | 473a0f7f67b08baa1b5f64422bd592849c0997d8 (patch) | |
tree | 11d4f9013a0c6024f3b2582cf6822d1b037c062c | |
parent | ec48df78c3e13e70dd9685db468573c7e64639c1 (diff) | |
download | efl-473a0f7f67b08baa1b5f64422bd592849c0997d8.tar.gz |
Newer Lua API fixes
-rw-r--r-- | src/lib/evas/filters/evas_filter_parser.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index e5fef556c7..e4e1363d14 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -705,7 +705,7 @@ _lua_implicit_metatable_drop(lua_State *L, const char *name) if (lua_istable(L, 1) && lua_getmetatable(L, 1)) { luaL_getmetatable(L, name); - if (lua_equal(L, -1, -2)) + if (lua_compare(L, -1, -2, LUA_OPEQ)) { lua_remove(L, 1); ret = 1; @@ -1931,7 +1931,7 @@ _lua_parameter_parse(Evas_Filter_Program *pgm, lua_State *L, { luaL_getmetatable(L, _lua_color_meta); lua_getmetatable(L, i); - if (!lua_isnil(L, -1) && lua_equal(L, -2, -1)) + if (!lua_isnil(L, -1) && lua_compare(L, -2, -1, LUA_OPEQ)) { // this is a color already cid = i; @@ -2321,7 +2321,8 @@ _lua_class_create(lua_State *L, const char *name, const luaL_Reg *meta, const luaL_Reg *methods) { luaL_newmetatable(L, name); - luaL_register(L, NULL, meta); + lua_pushvalue(L, -1); + lua_setglobal(L, meta); lua_pushliteral(L, "__metatable"); lua_pushvalue(L, -2); lua_rawset(L, -3); @@ -2329,7 +2330,8 @@ _lua_class_create(lua_State *L, const char *name, { lua_pushliteral(L, _lua_methods_table); lua_newtable(L); - luaL_register(L, NULL, methods); + lua_pushvalue(L, -1); + lua_setglobal(L, methods); lua_rawset(L, -3); } lua_pushvalue(L, -1); @@ -2358,7 +2360,8 @@ _lua_state_create(Evas_Filter_Program *pgm) // Implement print lua_getglobal(L, "_G"); - luaL_register(L, NULL, printlib); + lua_pushvalue(L, -1); + lua_setglobal(L, printlib); lua_pop(L, 1); // Add backtrace error function @@ -2431,7 +2434,7 @@ _lua_backtrace(lua_State *L) if (!lua_isstring(L, 1)) /* 'message' not a string? */ return 1; /* keep it intact */ ERR("Lua error: %s", lua_tolstring(L, 1, NULL)); - lua_getfield(L, LUA_GLOBALSINDEX, "debug"); + lua_getglobal(L, "debug"); if (!lua_istable(L, -1)) { lua_pop(L, 1); |