From 79cbc3468caeab89b1c8492d54e1c28e7aafd1ed Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 5 Jul 2011 09:49:35 -0300 Subject: removed and deprecated functions really removed from the code base --- lbaselib.c | 21 ++++----------------- lmathlib.c | 11 +++++------ loadlib.c | 17 +++++------------ ltablib.c | 14 +++----------- 4 files changed, 17 insertions(+), 46 deletions(-) diff --git a/lbaselib.c b/lbaselib.c index 92bbd103..d05e14a5 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.262 2011/06/16 14:12:24 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.263 2011/07/02 15:56:43 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -120,11 +120,6 @@ static int luaB_setmetatable (lua_State *L) { } -static int luaB_removed (lua_State *L) { - return luaL_error(L, "removed function"); -} - - static int luaB_rawequal (lua_State *L) { luaL_checkany(L, 1); luaL_checkany(L, 2); @@ -355,14 +350,6 @@ static int luaB_load (lua_State *L) { return load_aux(L, status); } - -#if defined(LUA_COMPAT_LOADSTRING) -#define luaB_loadstring luaB_load -#else -#define luaB_loadstring luaB_removed -#endif - - /* }====================================================== */ @@ -454,12 +441,13 @@ static const luaL_Reg base_funcs[] = { {"collectgarbage", luaB_collectgarbage}, {"dofile", luaB_dofile}, {"error", luaB_error}, - {"getfenv", luaB_removed}, {"getmetatable", luaB_getmetatable}, {"ipairs", luaB_ipairs}, {"loadfile", luaB_loadfile}, {"load", luaB_load}, - {"loadstring", luaB_loadstring}, +#if defined(LUA_COMPAT_LOADSTRING) + {"loadstring", luaB_load}, +#endif {"next", luaB_next}, {"pairs", luaB_pairs}, {"pcall", luaB_pcall}, @@ -469,7 +457,6 @@ static const luaL_Reg base_funcs[] = { {"rawget", luaB_rawget}, {"rawset", luaB_rawset}, {"select", luaB_select}, - {"setfenv", luaB_removed}, {"setmetatable", luaB_setmetatable}, {"tonumber", luaB_tonumber}, {"tostring", luaB_tostring}, diff --git a/lmathlib.c b/lmathlib.c index 39069ed0..035dd090 100644 --- a/lmathlib.c +++ b/lmathlib.c @@ -1,5 +1,5 @@ /* -** $Id: lmathlib.c,v 1.78 2010/11/12 15:47:34 roberto Exp roberto $ +** $Id: lmathlib.c,v 1.79 2010/11/18 18:38:27 roberto Exp roberto $ ** Standard mathematical library ** See Copyright Notice in lua.h */ @@ -134,15 +134,12 @@ static int math_log (lua_State *L) { return 1; } +#if defined(LUA_COMPAT_LOG10) static int math_log10 (lua_State *L) { -#if !defined(LUA_COMPAT_LOG10) - return luaL_error(L, "function " LUA_QL("log10") - " is deprecated; use log(x, 10) instead"); -#else lua_pushnumber(L, l_tg(log10)(luaL_checknumber(L, 1))); return 1; -#endif } +#endif static int math_exp (lua_State *L) { lua_pushnumber(L, l_tg(exp)(luaL_checknumber(L, 1))); @@ -252,7 +249,9 @@ static const luaL_Reg mathlib[] = { {"fmod", math_fmod}, {"frexp", math_frexp}, {"ldexp", math_ldexp}, +#if defined(LUA_COMPAT_LOG10) {"log10", math_log10}, +#endif {"log", math_log}, {"max", math_max}, {"min", math_min}, diff --git a/loadlib.c b/loadlib.c index 8794441f..eb9c9a49 100644 --- a/loadlib.c +++ b/loadlib.c @@ -1,5 +1,5 @@ /* -** $Id: loadlib.c,v 1.98 2011/04/08 19:17:36 roberto Exp roberto $ +** $Id: loadlib.c,v 1.99 2011/06/28 17:13:28 roberto Exp roberto $ ** Dynamic library loader for Lua ** See Copyright Notice in lua.h ** @@ -569,17 +569,6 @@ static int ll_seeall (lua_State *L) { return 0; } - -#else - -static int ll_seeall (lua_State *L) { - return luaL_error(L, "deprecated function"); -} - -static int ll_module (lua_State *L) { - return luaL_error(L, "deprecated function"); -} - #endif /* }====================================================== */ @@ -610,13 +599,17 @@ static void setpath (lua_State *L, const char *fieldname, const char *envname1, static const luaL_Reg pk_funcs[] = { {"loadlib", ll_loadlib}, {"searchpath", ll_searchpath}, +#if defined(LUA_COMPAT_MODULE) {"seeall", ll_seeall}, +#endif {NULL, NULL} }; static const luaL_Reg ll_funcs[] = { +#if defined(LUA_COMPAT_MODULE) {"module", ll_module}, +#endif {"require", ll_require}, {NULL, NULL} }; diff --git a/ltablib.c b/ltablib.c index 152135a7..b2e89e8e 100644 --- a/ltablib.c +++ b/ltablib.c @@ -1,5 +1,5 @@ /* -** $Id: ltablib.c,v 1.59 2010/12/17 12:15:34 roberto Exp roberto $ +** $Id: ltablib.c,v 1.60 2011/07/02 16:01:44 roberto Exp roberto $ ** Library for Table Manipulation ** See Copyright Notice in lua.h */ @@ -20,11 +20,6 @@ (luaL_checktype(L, n, LUA_TTABLE), luaL_len(L, n)) -static int removedfunc (lua_State *L) { - return luaL_error(L, "removed function"); -} - - #if defined(LUA_COMPAT_MAXN) static int maxn (lua_State *L) { lua_Number max = 0; @@ -40,8 +35,6 @@ static int maxn (lua_State *L) { lua_pushnumber(L, max); return 1; } -#else -#define maxn removedfunc #endif @@ -267,10 +260,9 @@ static int sort (lua_State *L) { static const luaL_Reg tab_funcs[] = { {"concat", tconcat}, - {"foreach", removedfunc}, - {"foreachi", removedfunc}, - {"getn", removedfunc}, +#if defined(LUA_COMPAT_MAXN) {"maxn", maxn}, +#endif {"insert", tinsert}, {"pack", pack}, {"unpack", unpack}, -- cgit v1.2.3-55-g6feb