summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2013-03-21 12:00:00 +0000
committerrepogen <>2013-03-21 12:00:00 +0000
commitdc27609467d2699ac9252e89d632432ac5f798f2 (patch)
treeb934d79a77a76df417078dc6ac162bb0012708bb
parenta101faf3e9db5b8b47cb0bcfb973b13d46ca304a (diff)
downloadlua-github-dc27609467d2699ac9252e89d632432ac5f798f2.tar.gz
-rw-r--r--README2
-rw-r--r--doc/contents.html10
-rw-r--r--doc/manual.html6
-rw-r--r--src/lapi.c4
-rw-r--r--src/lauxlib.c4
-rw-r--r--src/lbitlib.c8
-rw-r--r--src/lgc.c6
-rw-r--r--src/liolib.c26
-rw-r--r--src/llex.c4
-rw-r--r--src/lua.h7
-rw-r--r--src/luaconf.h6
-rw-r--r--src/lvm.c4
12 files changed, 51 insertions, 36 deletions
diff --git a/README b/README
index 2a27f405..6e2aee6c 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
-This is Lua 5.2.2, released on 7 Mar 2013.
+This is Lua 5.2.2, released on 21 Mar 2013.
For installation instructions, license details, and
further information about Lua, see doc/readme.html.
diff --git a/doc/contents.html b/doc/contents.html
index 701ac25d..0ce297da 100644
--- a/doc/contents.html
+++ b/doc/contents.html
@@ -149,8 +149,8 @@ Freely available under the terms of the
<A HREF="manual.html#pdf-error">error</A><BR>
<A HREF="manual.html#pdf-getmetatable">getmetatable</A><BR>
<A HREF="manual.html#pdf-ipairs">ipairs</A><BR>
-<A HREF="manual.html#pdf-loadfile">loadfile</A><BR>
<A HREF="manual.html#pdf-load">load</A><BR>
+<A HREF="manual.html#pdf-loadfile">loadfile</A><BR>
<A HREF="manual.html#pdf-next">next</A><BR>
<A HREF="manual.html#pdf-pairs">pairs</A><BR>
<A HREF="manual.html#pdf-pcall">pcall</A><BR>
@@ -400,10 +400,10 @@ Freely available under the terms of the
<A HREF="manual.html#lua_rawequal">lua_rawequal</A><BR>
<A HREF="manual.html#lua_rawget">lua_rawget</A><BR>
<A HREF="manual.html#lua_rawgeti">lua_rawgeti</A><BR>
+<A HREF="manual.html#lua_rawgetp">lua_rawgetp</A><BR>
<A HREF="manual.html#lua_rawlen">lua_rawlen</A><BR>
<A HREF="manual.html#lua_rawset">lua_rawset</A><BR>
<A HREF="manual.html#lua_rawseti">lua_rawseti</A><BR>
-<A HREF="manual.html#lua_rawgetp">lua_rawgetp</A><BR>
<A HREF="manual.html#lua_rawsetp">lua_rawsetp</A><BR>
<A HREF="manual.html#lua_register">lua_register</A><BR>
<A HREF="manual.html#lua_remove">lua_remove</A><BR>
@@ -462,8 +462,8 @@ Freely available under the terms of the
<A HREF="manual.html#luaL_buffinitsize">luaL_buffinitsize</A><BR>
<A HREF="manual.html#luaL_callmeta">luaL_callmeta</A><BR>
<A HREF="manual.html#luaL_checkany">luaL_checkany</A><BR>
-<A HREF="manual.html#luaL_checkinteger">luaL_checkinteger</A><BR>
<A HREF="manual.html#luaL_checkint">luaL_checkint</A><BR>
+<A HREF="manual.html#luaL_checkinteger">luaL_checkinteger</A><BR>
<A HREF="manual.html#luaL_checklong">luaL_checklong</A><BR>
<A HREF="manual.html#luaL_checklstring">luaL_checklstring</A><BR>
<A HREF="manual.html#luaL_checknumber">luaL_checknumber</A><BR>
@@ -494,8 +494,8 @@ Freely available under the terms of the
<A HREF="manual.html#luaL_newmetatable">luaL_newmetatable</A><BR>
<A HREF="manual.html#luaL_newstate">luaL_newstate</A><BR>
<A HREF="manual.html#luaL_openlibs">luaL_openlibs</A><BR>
-<A HREF="manual.html#luaL_optinteger">luaL_optinteger</A><BR>
<A HREF="manual.html#luaL_optint">luaL_optint</A><BR>
+<A HREF="manual.html#luaL_optinteger">luaL_optinteger</A><BR>
<A HREF="manual.html#luaL_optlong">luaL_optlong</A><BR>
<A HREF="manual.html#luaL_optlstring">luaL_optlstring</A><BR>
<A HREF="manual.html#luaL_optnumber">luaL_optnumber</A><BR>
@@ -523,7 +523,7 @@ Freely available under the terms of the
<HR>
<SMALL CLASS="footer">
Last update:
-Tue Feb 19 15:14:47 BRT 2013
+Tue Mar 12 11:22:18 BRT 2013
</SMALL>
<!--
Last change: revised for Lua 5.2.2
diff --git a/doc/manual.html b/doc/manual.html
index 251d4dce..85365363 100644
--- a/doc/manual.html
+++ b/doc/manual.html
@@ -33,7 +33,7 @@ Freely available under the terms of the
<!-- ====================================================================== -->
<p>
-<!-- $Id: manual.of,v 1.102 2013/03/07 18:25:28 roberto Exp $ -->
+<!-- $Id: manual.of,v 1.103 2013/03/14 18:51:56 roberto Exp $ -->
@@ -8417,7 +8417,7 @@ When <code>pos</code> is an integer between 1 and <code>#list</code>,
it shifts down the elements
<code>list[pos+1], list[pos+2], &middot;&middot;&middot;, list[#list]</code>
and erases element <code>list[#list]</code>;
-The index <code>pos</code> can also be 0, when <code>#list</code> is 0,
+The index <code>pos</code> can also be 0 when <code>#list</code> is 0,
or <code>#list + 1</code>;
in those cases, the function erases the element <code>list[pos]</code>.
@@ -10497,7 +10497,7 @@ Here is the complete syntax of Lua in extended BNF.
<HR>
<SMALL CLASS="footer">
Last update:
-Thu Mar 7 15:36:34 BRT 2013
+Thu Mar 21 12:58:59 BRT 2013
</SMALL>
<!--
Last change: revised for Lua 5.2.2
diff --git a/src/lapi.c b/src/lapi.c
index 62807d59..791d8545 100644
--- a/src/lapi.c
+++ b/src/lapi.c
@@ -1,5 +1,5 @@
/*
-** $Id: lapi.c,v 2.170 2012/12/05 19:49:55 roberto Exp $
+** $Id: lapi.c,v 2.171 2013/03/16 21:10:18 roberto Exp $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -1106,7 +1106,7 @@ LUA_API int lua_error (lua_State *L) {
lua_lock(L);
api_checknelems(L, 1);
luaG_errormsg(L);
- /* code unreacheable; will unlock when control actually leaves the kernel */
+ /* code unreachable; will unlock when control actually leaves the kernel */
return 0; /* to avoid warnings */
}
diff --git a/src/lauxlib.c b/src/lauxlib.c
index 42521bce..2e989d66 100644
--- a/src/lauxlib.c
+++ b/src/lauxlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lauxlib.c,v 1.247 2012/10/19 15:55:01 roberto Exp $
+** $Id: lauxlib.c,v 1.248 2013/03/21 13:54:57 roberto Exp $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
@@ -599,7 +599,7 @@ static int skipBOM (LoadF *lf) {
lf->n = 0;
do {
c = getc(lf->f);
- if (c == EOF || c != *(unsigned char *)p++) return c;
+ if (c == EOF || c != *(const unsigned char *)p++) return c;
lf->buff[lf->n++] = c; /* to be read by the parser */
} while (*p != '\0');
lf->n = 0; /* prefix matched; discard it */
diff --git a/src/lbitlib.c b/src/lbitlib.c
index 9cd91474..9637532e 100644
--- a/src/lbitlib.c
+++ b/src/lbitlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lbitlib.c,v 1.17 2013/02/21 13:44:53 roberto Exp $
+** $Id: lbitlib.c,v 1.18 2013/03/19 13:19:12 roberto Exp $
** Standard library for bitwise operations
** See Copyright Notice in lua.h
*/
@@ -147,7 +147,9 @@ static int b_rrot (lua_State *L) {
/*
** get field and width arguments for field-manipulation functions,
-** checking whether they are valid
+** checking whether they are valid.
+** ('luaL_error' called without 'return' to avoid later warnings about
+** 'width' being used uninitialized.)
*/
static int fieldargs (lua_State *L, int farg, int *width) {
int f = luaL_checkint(L, farg);
@@ -155,7 +157,7 @@ static int fieldargs (lua_State *L, int farg, int *width) {
luaL_argcheck(L, 0 <= f, farg, "field cannot be negative");
luaL_argcheck(L, 0 < w, farg + 1, "width must be positive");
if (f + w > LUA_NBITS)
- return luaL_error(L, "trying to access non-existent bits");
+ luaL_error(L, "trying to access non-existent bits");
*width = w;
return f;
}
diff --git a/src/lgc.c b/src/lgc.c
index 9eec6e37..535e988a 100644
--- a/src/lgc.c
+++ b/src/lgc.c
@@ -1,5 +1,5 @@
/*
-** $Id: lgc.c,v 2.138 2012/10/19 19:00:33 roberto Exp $
+** $Id: lgc.c,v 2.140 2013/03/16 21:10:18 roberto Exp $
** Garbage Collector
** See Copyright Notice in lua.h
*/
@@ -450,7 +450,7 @@ static lu_mem traversetable (global_State *g, Table *h) {
else /* not weak */
traversestrongtable(g, h);
return sizeof(Table) + sizeof(TValue) * h->sizearray +
- sizeof(Node) * sizenode(h);
+ sizeof(Node) * cast(size_t, sizenode(h));
}
@@ -924,7 +924,7 @@ static void setpause (global_State *g, l_mem estimate) {
** object inside the list (instead of to the header), so that the real
** sweep do not need to skip objects created between "now" and the start
** of the real sweep.
-** Returns how many objects it sweeped.
+** Returns how many objects it swept.
*/
static int entersweep (lua_State *L) {
global_State *g = G(L);
diff --git a/src/liolib.c b/src/liolib.c
index 4814aa2c..3f80db19 100644
--- a/src/liolib.c
+++ b/src/liolib.c
@@ -1,5 +1,5 @@
/*
-** $Id: liolib.c,v 2.108 2011/11/25 12:50:03 roberto Exp $
+** $Id: liolib.c,v 2.111 2013/03/21 13:57:27 roberto Exp $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@@ -29,6 +29,20 @@
#include "lualib.h"
+#if !defined(lua_checkmode)
+
+/*
+** Check whether 'mode' matches '[rwa]%+?b?'.
+** Change this macro to accept other modes for 'fopen' besides
+** the standard ones.
+*/
+#define lua_checkmode(mode) \
+ (*mode != '\0' && strchr("rwa", *(mode++)) != NULL && \
+ (*mode != '+' || ++mode) && /* skip if char is '+' */ \
+ (*mode != 'b' || ++mode) && /* skip if char is 'b' */ \
+ (*mode == '\0'))
+
+#endif
/*
** {======================================================
@@ -212,14 +226,8 @@ static int io_open (lua_State *L) {
const char *filename = luaL_checkstring(L, 1);
const char *mode = luaL_optstring(L, 2, "r");
LStream *p = newfile(L);
- int i = 0;
- /* check whether 'mode' matches '[rwa]%+?b?' */
- if (!(mode[i] != '\0' && strchr("rwa", mode[i++]) != NULL &&
- (mode[i] != '+' || ++i) && /* skip if char is '+' */
- (mode[i] != 'b' || ++i) && /* skip if char is 'b' */
- (mode[i] == '\0')))
- return luaL_error(L, "invalid mode " LUA_QS
- " (should match " LUA_QL("[rwa]%%+?b?") ")", mode);
+ const char *md = mode; /* to traverse/check mode */
+ luaL_argcheck(L, lua_checkmode(md), 2, "invalid mode");
p->f = fopen(filename, mode);
return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1;
}
diff --git a/src/llex.c b/src/llex.c
index dbd253be..1a32e348 100644
--- a/src/llex.c
+++ b/src/llex.c
@@ -1,5 +1,5 @@
/*
-** $Id: llex.c,v 2.62 2012/12/05 19:57:00 roberto Exp $
+** $Id: llex.c,v 2.63 2013/03/16 21:10:18 roberto Exp $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@@ -313,7 +313,7 @@ static int readhexaesc (LexState *ls) {
int c[3], i; /* keep input for error message */
int r = 0; /* result accumulator */
c[0] = 'x'; /* for error message */
- for (i = 1; i < 3; i++) { /* read two hexa digits */
+ for (i = 1; i < 3; i++) { /* read two hexadecimal digits */
c[i] = next(ls);
if (!lisxdigit(c[i]))
escerror(ls, c, i + 1, "hexadecimal digit expected");
diff --git a/src/lua.h b/src/lua.h
index 8765f53b..eb0482b8 100644
--- a/src/lua.h
+++ b/src/lua.h
@@ -1,5 +1,5 @@
/*
-** $Id: lua.h,v 1.284 2013/02/19 18:39:04 roberto Exp $
+** $Id: lua.h,v 1.285 2013/03/15 13:04:22 roberto Exp $
** Lua - A Scripting Language
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
** See Copyright Notice at the end of this file
@@ -119,6 +119,11 @@ typedef LUA_UNSIGNED lua_Unsigned;
#endif
+/*
+** RCS ident string
+*/
+extern const char lua_ident[];
+
/*
** state manipulation
diff --git a/src/luaconf.h b/src/luaconf.h
index 46eeb2dd..df802c95 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -1,5 +1,5 @@
/*
-** $Id: luaconf.h,v 1.175 2013/01/29 16:00:40 roberto Exp $
+** $Id: luaconf.h,v 1.176 2013/03/16 21:10:18 roberto Exp $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
@@ -44,7 +44,7 @@
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
#define LUA_USE_READLINE /* needs some extra libraries */
-#define LUA_USE_STRTODHEX /* assume 'strtod' handles hexa formats */
+#define LUA_USE_STRTODHEX /* assume 'strtod' handles hex formats */
#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */
#define LUA_USE_LONGLONG /* assume support for long long */
#endif
@@ -53,7 +53,7 @@
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* does not need -ldl */
#define LUA_USE_READLINE /* needs an extra library: -lreadline */
-#define LUA_USE_STRTODHEX /* assume 'strtod' handles hexa formats */
+#define LUA_USE_STRTODHEX /* assume 'strtod' handles hex formats */
#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */
#define LUA_USE_LONGLONG /* assume support for long long */
#endif
diff --git a/src/lvm.c b/src/lvm.c
index 9713baf5..657d5c45 100644
--- a/src/lvm.c
+++ b/src/lvm.c
@@ -1,5 +1,5 @@
/*
-** $Id: lvm.c,v 2.154 2012/08/16 17:34:28 roberto Exp $
+** $Id: lvm.c,v 2.155 2013/03/16 21:10:18 roberto Exp $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -83,7 +83,7 @@ static void traceexec (lua_State *L) {
if (counthook)
L->hookcount = 1; /* undo decrement to zero */
ci->u.l.savedpc--; /* undo increment (resume will increment it again) */
- ci->callstatus |= CIST_HOOKYIELD; /* mark that it yieled */
+ ci->callstatus |= CIST_HOOKYIELD; /* mark that it yielded */
ci->func = L->top - 1; /* protect stack below results */
luaD_throw(L, LUA_YIELD);
}