summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lbaselib.c21
-rw-r--r--src/llex.c6
-rw-r--r--src/lmathlib.c11
-rw-r--r--src/loadlib.c17
-rw-r--r--src/lobject.h8
-rw-r--r--src/ltablib.c14
-rw-r--r--src/lua.hpp9
7 files changed, 24 insertions, 62 deletions
diff --git a/src/lbaselib.c b/src/lbaselib.c
index 8172f131..e4daf5d4 100644
--- a/src/lbaselib.c
+++ b/src/lbaselib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lbaselib.c,v 1.263 2011/07/02 15:56:43 roberto Exp $
+** $Id: lbaselib.c,v 1.264 2011/07/05 12:49:35 roberto Exp $
** 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/src/llex.c b/src/llex.c
index 7d150794..e613f93b 100644
--- a/src/llex.c
+++ b/src/llex.c
@@ -1,5 +1,5 @@
/*
-** $Id: llex.c,v 2.49 2011/06/23 14:54:48 roberto Exp $
+** $Id: llex.c,v 2.50 2011/07/05 19:13:45 roberto Exp $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@@ -354,7 +354,7 @@ static void read_string (LexState *ls, int del, SemInfo *seminfo) {
case '\n':
case '\r': save(ls, '\n'); inclinenumber(ls); continue;
case EOZ: continue; /* will raise an error next loop */
- case '*': { /* skip following span of spaces */
+ case 'z': { /* zap following span of spaces */
next(ls); /* skip the '*' */
while (lisspace(ls->current)) {
if (currIsNewline(ls)) inclinenumber(ls);
@@ -364,7 +364,7 @@ static void read_string (LexState *ls, int del, SemInfo *seminfo) {
}
default: {
if (!lisdigit(ls->current))
- c = ls->current; /* handles \\, \", \', and \? */
+ c = ls->current; /* handles \\, \", and \' */
else /* digital escape \ddd */
c = readdecesc(ls);
break;
diff --git a/src/lmathlib.c b/src/lmathlib.c
index 1127fd51..b17237f0 100644
--- a/src/lmathlib.c
+++ b/src/lmathlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lmathlib.c,v 1.79 2010/11/18 18:38:27 roberto Exp $
+** $Id: lmathlib.c,v 1.80 2011/07/05 12:49:35 roberto Exp $
** 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/src/loadlib.c b/src/loadlib.c
index 32c6ed25..0313d8e4 100644
--- a/src/loadlib.c
+++ b/src/loadlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: loadlib.c,v 1.99 2011/06/28 17:13:28 roberto Exp $
+** $Id: loadlib.c,v 1.100 2011/07/05 12:49:35 roberto Exp $
** 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/src/lobject.h b/src/lobject.h
index 7f7a6830..d69d6153 100644
--- a/src/lobject.h
+++ b/src/lobject.h
@@ -1,5 +1,5 @@
/*
-** $Id: lobject.h,v 2.60 2011/06/13 14:13:06 roberto Exp $
+** $Id: lobject.h,v 2.61 2011/07/04 20:29:02 roberto Exp $
** Type definitions for Lua objects
** See Copyright Notice in lua.h
*/
@@ -275,14 +275,17 @@ typedef struct lua_TValue TValue;
#endif
#undef TValuefields
+#undef NILCONSTANT
#if defined(LUA_NANTRICKLE)
/* little endian */
#define TValuefields \
union { struct { Value v_; int tt_; } i; double d_; } u
+#define NILCONSTANT {{{NULL}, tag2tt(LUA_TNIL)}}
#else
/* big endian */
#define TValuefields \
union { struct { int tt_; Value v_; } i; double d_; } u
+#define NILCONSTANT {{tag2tt(LUA_TNIL), {NULL}}}
#endif
#undef numfield
@@ -294,9 +297,6 @@ typedef struct lua_TValue TValue;
#define tag2tt(t) (NNMARK | (t))
-#undef NILCONSTANT
-#define NILCONSTANT {{{NULL}, tag2tt(LUA_TNIL)}}
-
#undef val_
#define val_(o) ((o)->u.i.v_)
#undef num_
diff --git a/src/ltablib.c b/src/ltablib.c
index 6898442e..06353c7b 100644
--- a/src/ltablib.c
+++ b/src/ltablib.c
@@ -1,5 +1,5 @@
/*
-** $Id: ltablib.c,v 1.60 2011/07/02 16:01:44 roberto Exp $
+** $Id: ltablib.c,v 1.61 2011/07/05 12:49:35 roberto Exp $
** 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},
diff --git a/src/lua.hpp b/src/lua.hpp
deleted file mode 100644
index ec417f59..00000000
--- a/src/lua.hpp
+++ /dev/null
@@ -1,9 +0,0 @@
-// lua.hpp
-// Lua header files for C++
-// <<extern "C">> not supplied automatically because Lua also compiles as C++
-
-extern "C" {
-#include "lua.h"
-#include "lualib.h"
-#include "lauxlib.h"
-}