diff options
-rw-r--r-- | src/tre/ltre.c | 5 | ||||
-rw-r--r-- | src/tre/ltre_w.c | 24 | ||||
-rw-r--r-- | test/runtest.lua | 2 |
3 files changed, 11 insertions, 20 deletions
diff --git a/src/tre/ltre.c b/src/tre/ltre.c index 0a5275c..06c66c8 100644 --- a/src/tre/ltre.c +++ b/src/tre/ltre.c @@ -7,7 +7,7 @@ #include "lua.h" #include "lauxlib.h" #include "../common.h" -extern void add_wide_lib (lua_State *L, int methods); +extern void add_wide_lib (lua_State *L); #include <tre/tre.h> @@ -342,8 +342,7 @@ REX_API int REX_OPENLIB (lua_State *L) { alg_register(L, r_methods, r_functions, "TRE regexes"); #ifdef REX_ADDWIDECHARFUNCS - add_wide_lib (L, 1); - add_wide_lib (L, 0); + add_wide_lib (L); #endif return 1; } diff --git a/src/tre/ltre_w.c b/src/tre/ltre_w.c index ade0ab8..4744cb1 100644 --- a/src/tre/ltre_w.c +++ b/src/tre/ltre_w.c @@ -216,26 +216,18 @@ static const luaL_Reg r_functions[] = { }; /* Add the library */ -void add_wide_lib (lua_State *L, int methods) +void add_wide_lib (lua_State *L) { (void)alg_register; + lua_pushvalue(L, -2); #if LUA_VERSION_NUM == 501 - if (methods) { - lua_pushvalue(L, -2); - luaL_register(L, NULL, r_methods); - lua_pop(L, 1); - } - else - luaL_register(L, NULL, r_functions); + luaL_register(L, NULL, r_methods); + lua_pop(L, 1); + luaL_register(L, NULL, r_functions); #else - lua_pushvalue(L, -2); - if (methods) { - lua_pushvalue(L, -1); - luaL_setfuncs(L, r_methods, 1); - lua_pop(L, 1); - } - else - luaL_setfuncs(L, r_functions, 1); + lua_pushvalue(L, -1); + luaL_setfuncs(L, r_methods, 1); + luaL_setfuncs(L, r_functions, 1); #endif } diff --git a/test/runtest.lua b/test/runtest.lua index 9fa38e7..4121710 100644 --- a/test/runtest.lua +++ b/test/runtest.lua @@ -38,7 +38,7 @@ end local avail_tests = { gnu = { lib = "rex_gnu", "common_sets", "emacs_sets", "gnu_sets" }, - onig = { lib = "rex_onig", "common_sets", "onig_sets", } + onig = { lib = "rex_onig", "common_sets", "onig_sets", }, pcre = { lib = "rex_pcre", "common_sets", "pcre_sets", "pcre_sets2", }, spencer = { lib = "rex_spencer", "common_sets", "posix_sets", "spencer_sets" }, tre = { lib = "rex_tre", "common_sets", "posix_sets", "spencer_sets", --[["tre_sets"]] }, |