diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-07-05 09:49:35 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-07-05 09:49:35 -0300 |
| commit | 79cbc3468caeab89b1c8492d54e1c28e7aafd1ed (patch) | |
| tree | ca69022ba190df2f3dbfed1d2861d2cf52f4e0af | |
| parent | 9e89a55a4fd701a9991d55b73edb93639a48d624 (diff) | |
| download | lua-79cbc3468caeab89b1c8492d54e1c28e7aafd1ed.tar.gz lua-79cbc3468caeab89b1c8492d54e1c28e7aafd1ed.tar.bz2 lua-79cbc3468caeab89b1c8492d54e1c28e7aafd1ed.zip | |
removed and deprecated functions really removed from the code base
| -rw-r--r-- | lbaselib.c | 21 | ||||
| -rw-r--r-- | lmathlib.c | 11 | ||||
| -rw-r--r-- | loadlib.c | 17 | ||||
| -rw-r--r-- | ltablib.c | 14 |
4 files changed, 17 insertions, 46 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lbaselib.c,v 1.262 2011/06/16 14:12:24 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.263 2011/07/02 15:56:43 roberto Exp roberto $ |
| 3 | ** Basic library | 3 | ** Basic library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -120,11 +120,6 @@ static int luaB_setmetatable (lua_State *L) { | |||
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | 122 | ||
| 123 | static int luaB_removed (lua_State *L) { | ||
| 124 | return luaL_error(L, "removed function"); | ||
| 125 | } | ||
| 126 | |||
| 127 | |||
| 128 | static int luaB_rawequal (lua_State *L) { | 123 | static int luaB_rawequal (lua_State *L) { |
| 129 | luaL_checkany(L, 1); | 124 | luaL_checkany(L, 1); |
| 130 | luaL_checkany(L, 2); | 125 | luaL_checkany(L, 2); |
| @@ -355,14 +350,6 @@ static int luaB_load (lua_State *L) { | |||
| 355 | return load_aux(L, status); | 350 | return load_aux(L, status); |
| 356 | } | 351 | } |
| 357 | 352 | ||
| 358 | |||
| 359 | #if defined(LUA_COMPAT_LOADSTRING) | ||
| 360 | #define luaB_loadstring luaB_load | ||
| 361 | #else | ||
| 362 | #define luaB_loadstring luaB_removed | ||
| 363 | #endif | ||
| 364 | |||
| 365 | |||
| 366 | /* }====================================================== */ | 353 | /* }====================================================== */ |
| 367 | 354 | ||
| 368 | 355 | ||
| @@ -454,12 +441,13 @@ static const luaL_Reg base_funcs[] = { | |||
| 454 | {"collectgarbage", luaB_collectgarbage}, | 441 | {"collectgarbage", luaB_collectgarbage}, |
| 455 | {"dofile", luaB_dofile}, | 442 | {"dofile", luaB_dofile}, |
| 456 | {"error", luaB_error}, | 443 | {"error", luaB_error}, |
| 457 | {"getfenv", luaB_removed}, | ||
| 458 | {"getmetatable", luaB_getmetatable}, | 444 | {"getmetatable", luaB_getmetatable}, |
| 459 | {"ipairs", luaB_ipairs}, | 445 | {"ipairs", luaB_ipairs}, |
| 460 | {"loadfile", luaB_loadfile}, | 446 | {"loadfile", luaB_loadfile}, |
| 461 | {"load", luaB_load}, | 447 | {"load", luaB_load}, |
| 462 | {"loadstring", luaB_loadstring}, | 448 | #if defined(LUA_COMPAT_LOADSTRING) |
| 449 | {"loadstring", luaB_load}, | ||
| 450 | #endif | ||
| 463 | {"next", luaB_next}, | 451 | {"next", luaB_next}, |
| 464 | {"pairs", luaB_pairs}, | 452 | {"pairs", luaB_pairs}, |
| 465 | {"pcall", luaB_pcall}, | 453 | {"pcall", luaB_pcall}, |
| @@ -469,7 +457,6 @@ static const luaL_Reg base_funcs[] = { | |||
| 469 | {"rawget", luaB_rawget}, | 457 | {"rawget", luaB_rawget}, |
| 470 | {"rawset", luaB_rawset}, | 458 | {"rawset", luaB_rawset}, |
| 471 | {"select", luaB_select}, | 459 | {"select", luaB_select}, |
| 472 | {"setfenv", luaB_removed}, | ||
| 473 | {"setmetatable", luaB_setmetatable}, | 460 | {"setmetatable", luaB_setmetatable}, |
| 474 | {"tonumber", luaB_tonumber}, | 461 | {"tonumber", luaB_tonumber}, |
| 475 | {"tostring", luaB_tostring}, | 462 | {"tostring", luaB_tostring}, |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lmathlib.c,v 1.78 2010/11/12 15:47:34 roberto Exp roberto $ | 2 | ** $Id: lmathlib.c,v 1.79 2010/11/18 18:38:27 roberto Exp roberto $ |
| 3 | ** Standard mathematical library | 3 | ** Standard mathematical library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -134,15 +134,12 @@ static int math_log (lua_State *L) { | |||
| 134 | return 1; | 134 | return 1; |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | #if defined(LUA_COMPAT_LOG10) | ||
| 137 | static int math_log10 (lua_State *L) { | 138 | static int math_log10 (lua_State *L) { |
| 138 | #if !defined(LUA_COMPAT_LOG10) | ||
| 139 | return luaL_error(L, "function " LUA_QL("log10") | ||
| 140 | " is deprecated; use log(x, 10) instead"); | ||
| 141 | #else | ||
| 142 | lua_pushnumber(L, l_tg(log10)(luaL_checknumber(L, 1))); | 139 | lua_pushnumber(L, l_tg(log10)(luaL_checknumber(L, 1))); |
| 143 | return 1; | 140 | return 1; |
| 144 | #endif | ||
| 145 | } | 141 | } |
| 142 | #endif | ||
| 146 | 143 | ||
| 147 | static int math_exp (lua_State *L) { | 144 | static int math_exp (lua_State *L) { |
| 148 | lua_pushnumber(L, l_tg(exp)(luaL_checknumber(L, 1))); | 145 | lua_pushnumber(L, l_tg(exp)(luaL_checknumber(L, 1))); |
| @@ -252,7 +249,9 @@ static const luaL_Reg mathlib[] = { | |||
| 252 | {"fmod", math_fmod}, | 249 | {"fmod", math_fmod}, |
| 253 | {"frexp", math_frexp}, | 250 | {"frexp", math_frexp}, |
| 254 | {"ldexp", math_ldexp}, | 251 | {"ldexp", math_ldexp}, |
| 252 | #if defined(LUA_COMPAT_LOG10) | ||
| 255 | {"log10", math_log10}, | 253 | {"log10", math_log10}, |
| 254 | #endif | ||
| 256 | {"log", math_log}, | 255 | {"log", math_log}, |
| 257 | {"max", math_max}, | 256 | {"max", math_max}, |
| 258 | {"min", math_min}, | 257 | {"min", math_min}, |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: loadlib.c,v 1.98 2011/04/08 19:17:36 roberto Exp roberto $ | 2 | ** $Id: loadlib.c,v 1.99 2011/06/28 17:13:28 roberto Exp roberto $ |
| 3 | ** Dynamic library loader for Lua | 3 | ** Dynamic library loader for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | ** | 5 | ** |
| @@ -569,17 +569,6 @@ static int ll_seeall (lua_State *L) { | |||
| 569 | return 0; | 569 | return 0; |
| 570 | } | 570 | } |
| 571 | 571 | ||
| 572 | |||
| 573 | #else | ||
| 574 | |||
| 575 | static int ll_seeall (lua_State *L) { | ||
| 576 | return luaL_error(L, "deprecated function"); | ||
| 577 | } | ||
| 578 | |||
| 579 | static int ll_module (lua_State *L) { | ||
| 580 | return luaL_error(L, "deprecated function"); | ||
| 581 | } | ||
| 582 | |||
| 583 | #endif | 572 | #endif |
| 584 | /* }====================================================== */ | 573 | /* }====================================================== */ |
| 585 | 574 | ||
| @@ -610,13 +599,17 @@ static void setpath (lua_State *L, const char *fieldname, const char *envname1, | |||
| 610 | static const luaL_Reg pk_funcs[] = { | 599 | static const luaL_Reg pk_funcs[] = { |
| 611 | {"loadlib", ll_loadlib}, | 600 | {"loadlib", ll_loadlib}, |
| 612 | {"searchpath", ll_searchpath}, | 601 | {"searchpath", ll_searchpath}, |
| 602 | #if defined(LUA_COMPAT_MODULE) | ||
| 613 | {"seeall", ll_seeall}, | 603 | {"seeall", ll_seeall}, |
| 604 | #endif | ||
| 614 | {NULL, NULL} | 605 | {NULL, NULL} |
| 615 | }; | 606 | }; |
| 616 | 607 | ||
| 617 | 608 | ||
| 618 | static const luaL_Reg ll_funcs[] = { | 609 | static const luaL_Reg ll_funcs[] = { |
| 610 | #if defined(LUA_COMPAT_MODULE) | ||
| 619 | {"module", ll_module}, | 611 | {"module", ll_module}, |
| 612 | #endif | ||
| 620 | {"require", ll_require}, | 613 | {"require", ll_require}, |
| 621 | {NULL, NULL} | 614 | {NULL, NULL} |
| 622 | }; | 615 | }; |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltablib.c,v 1.59 2010/12/17 12:15:34 roberto Exp roberto $ | 2 | ** $Id: ltablib.c,v 1.60 2011/07/02 16:01:44 roberto Exp roberto $ |
| 3 | ** Library for Table Manipulation | 3 | ** Library for Table Manipulation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -20,11 +20,6 @@ | |||
| 20 | (luaL_checktype(L, n, LUA_TTABLE), luaL_len(L, n)) | 20 | (luaL_checktype(L, n, LUA_TTABLE), luaL_len(L, n)) |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | static int removedfunc (lua_State *L) { | ||
| 24 | return luaL_error(L, "removed function"); | ||
| 25 | } | ||
| 26 | |||
| 27 | |||
| 28 | #if defined(LUA_COMPAT_MAXN) | 23 | #if defined(LUA_COMPAT_MAXN) |
| 29 | static int maxn (lua_State *L) { | 24 | static int maxn (lua_State *L) { |
| 30 | lua_Number max = 0; | 25 | lua_Number max = 0; |
| @@ -40,8 +35,6 @@ static int maxn (lua_State *L) { | |||
| 40 | lua_pushnumber(L, max); | 35 | lua_pushnumber(L, max); |
| 41 | return 1; | 36 | return 1; |
| 42 | } | 37 | } |
| 43 | #else | ||
| 44 | #define maxn removedfunc | ||
| 45 | #endif | 38 | #endif |
| 46 | 39 | ||
| 47 | 40 | ||
| @@ -267,10 +260,9 @@ static int sort (lua_State *L) { | |||
| 267 | 260 | ||
| 268 | static const luaL_Reg tab_funcs[] = { | 261 | static const luaL_Reg tab_funcs[] = { |
| 269 | {"concat", tconcat}, | 262 | {"concat", tconcat}, |
| 270 | {"foreach", removedfunc}, | 263 | #if defined(LUA_COMPAT_MAXN) |
| 271 | {"foreachi", removedfunc}, | ||
| 272 | {"getn", removedfunc}, | ||
| 273 | {"maxn", maxn}, | 264 | {"maxn", maxn}, |
| 265 | #endif | ||
| 274 | {"insert", tinsert}, | 266 | {"insert", tinsert}, |
| 275 | {"pack", pack}, | 267 | {"pack", pack}, |
| 276 | {"unpack", unpack}, | 268 | {"unpack", unpack}, |
