aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lbaselib.c21
-rw-r--r--lmathlib.c11
-rw-r--r--loadlib.c17
-rw-r--r--ltablib.c14
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 @@
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
123static int luaB_removed (lua_State *L) {
124 return luaL_error(L, "removed function");
125}
126
127
128static int luaB_rawequal (lua_State *L) { 123static 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},
diff --git a/lmathlib.c b/lmathlib.c
index 39069ed0..035dd090 100644
--- a/lmathlib.c
+++ b/lmathlib.c
@@ -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)
137static int math_log10 (lua_State *L) { 138static 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
147static int math_exp (lua_State *L) { 144static 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},
diff --git a/loadlib.c b/loadlib.c
index 8794441f..eb9c9a49 100644
--- a/loadlib.c
+++ b/loadlib.c
@@ -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
575static int ll_seeall (lua_State *L) {
576 return luaL_error(L, "deprecated function");
577}
578
579static 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,
610static const luaL_Reg pk_funcs[] = { 599static 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
618static const luaL_Reg ll_funcs[] = { 609static 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};
diff --git a/ltablib.c b/ltablib.c
index 152135a7..b2e89e8e 100644
--- a/ltablib.c
+++ b/ltablib.c
@@ -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
23static 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)
29static int maxn (lua_State *L) { 24static 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
268static const luaL_Reg tab_funcs[] = { 261static 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},