summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2014-12-22 12:00:00 +0000
committerrepogen <>2014-12-22 12:00:00 +0000
commit65cb014c87f5ecfee995afc9babba930d6a9f0bc (patch)
tree46ce169079bd359d6b66599a4dacc9897ae77096
parent514a0c89db308fafb79ee7cbfad11f74fcf3f652 (diff)
downloadlua-github-65cb014c87f5ecfee995afc9babba930d6a9f0bc.tar.gz
Lua 5.3.0-rc25.3.0-rc2
-rw-r--r--README2
-rw-r--r--doc/manual.html16
-rw-r--r--src/lcode.c8
-rw-r--r--src/lgc.c12
-rw-r--r--src/llimits.h4
-rw-r--r--src/lmem.h8
-rw-r--r--src/lobject.h4
-rw-r--r--src/luaconf.h4
-rw-r--r--src/lvm.c5
-rw-r--r--src/lzio.h5
10 files changed, 37 insertions, 31 deletions
diff --git a/README b/README
index 0ecb155f..e845c6f6 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
-This is Lua 5.3.0, released on 16 Dec 2014.
+This is Lua 5.3.0, released on 22 Dec 2014.
For installation instructions, license details, and
further information about Lua, see doc/readme.html.
diff --git a/doc/manual.html b/doc/manual.html
index b64747db..1807c003 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.141 2014/12/16 16:21:31 roberto Exp $ -->
+<!-- $Id: manual.of,v 1.142 2014/12/22 13:31:36 roberto Exp $ -->
@@ -8346,13 +8346,13 @@ its default value is&nbsp;1 and can be negative.
<p>
-<hr><h3><a name="pdf-string.pack"><code>string.pack (fmt, v1, v2, ...)</code></a></h3>
+<hr><h3><a name="pdf-string.pack"><code>string.pack (fmt, v1, v2, &middot;&middot;&middot;)</code></a></h3>
<p>
-Returns a binary string containing the values v1, v2, etc.
+Returns a binary string containing the values <code>v1</code>, <code>v2</code>, etc.
packed (that is, serialized in binary form)
-according to the format string fmt (see <a href="#6.4.2">&sect;6.4.2</a>).
+according to the format string <code>fmt</code> (see <a href="#6.4.2">&sect;6.4.2</a>).
@@ -8803,7 +8803,7 @@ It raises an error if it meets any invalid byte sequence.
<p>
<hr><h3><a name="pdf-utf8.len"><code>utf8.len (s [, i [, j]])</code></a></h3>
Returns the number of UTF-8 characters in string <code>s</code>
-that start between positions <code>i</code> and @{j} (both inclusive).
+that start between positions <code>i</code> and <code>j</code> (both inclusive).
The default for <code>i</code> is 1 and for <code>j</code> is -1.
If it finds any invalid byte sequence,
returns a false value plus the position of the first invalid byte.
@@ -9796,7 +9796,9 @@ because of its reliance on C&nbsp;function <code>gmtime</code> and C&nbsp;functi
<p>
-Returns the number of seconds from time <code>t1</code> to time <code>t2</code>.
+Returns the difference, in seconds,
+from time <code>t1</code> to time <code>t2</code>
+(where the times are values returned by <a href="#pdf-os.time"><code>os.time</code></a>).
In POSIX, Windows, and some other systems,
this value is exactly <code>t2</code><em>-</em><code>t1</code>.
@@ -10768,7 +10770,7 @@ and LiteralString, see <a href="#3.1">&sect;3.1</a>.)
<HR>
<SMALL CLASS="footer">
Last update:
-Tue Dec 16 14:45:50 BRST 2014
+Mon Dec 22 12:28:03 BRST 2014
</SMALL>
<!--
Last change: revised for Lua 5.3.0 (final)
diff --git a/src/lcode.c b/src/lcode.c
index cfe4a210..ad0365a8 100644
--- a/src/lcode.c
+++ b/src/lcode.c
@@ -1,5 +1,5 @@
/*
-** $Id: lcode.c,v 2.97 2014/11/24 14:59:22 roberto Exp $
+** $Id: lcode.c,v 2.98 2014/12/19 13:36:32 roberto Exp $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@@ -761,12 +761,8 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) {
** return false if folding can raise an error
*/
static int validop (int op, TValue *v1, TValue *v2) {
- lua_Number a, b;
lua_Integer i;
- cast_void(a); cast_void(b); /* macro may not use its arguments */
- if (luai_numinvalidop(op, (cast_void(tonumber(v1, &a)), a),
- (cast_void(tonumber(v2, &b)), b)))
- return 0;
+ if (luai_numinvalidop(op, nvalue(v1), nvalue(v2))) return 0;
switch (op) {
case LUA_OPBAND: case LUA_OPBOR: case LUA_OPBXOR:
case LUA_OPSHL: case LUA_OPSHR: case LUA_OPBNOT: /* conversion errors */
diff --git a/src/lgc.c b/src/lgc.c
index 7e37c0c3..8b95fb67 100644
--- a/src/lgc.c
+++ b/src/lgc.c
@@ -1,5 +1,5 @@
/*
-** $Id: lgc.c,v 2.200 2014/11/02 19:19:04 roberto Exp $
+** $Id: lgc.c,v 2.201 2014/12/20 13:58:15 roberto Exp $
** Garbage Collector
** See Copyright Notice in lua.h
*/
@@ -705,10 +705,10 @@ static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count);
/*
** sweep at most 'count' elements from a list of GCObjects erasing dead
-** objects, where a dead (not alive) object is one marked with the "old"
-** (non current) white and not fixed; change all non-dead objects back
-** to white, preparing for next collection cycle.
-** When object is a thread, sweep its list of open upvalues too.
+** objects, where a dead object is one marked with the old (non current)
+** white; change all non-dead objects back to white, preparing for next
+** collection cycle. Return where to continue the traversal or NULL if
+** list is finished.
*/
static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) {
global_State *g = G(L);
@@ -721,7 +721,7 @@ static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) {
*p = curr->next; /* remove 'curr' from list */
freeobj(L, curr); /* erase 'curr' */
}
- else { /* update marks */
+ else { /* change mark to 'white' */
curr->marked = cast_byte((marked & maskcolors) | white);
p = &curr->next; /* go to next element */
}
diff --git a/src/llimits.h b/src/llimits.h
index 59f342dc..8f71a6ff 100644
--- a/src/llimits.h
+++ b/src/llimits.h
@@ -1,5 +1,5 @@
/*
-** $Id: llimits.h,v 1.124 2014/11/02 19:33:33 roberto Exp $
+** $Id: llimits.h,v 1.125 2014/12/19 13:30:23 roberto Exp $
** Limits, basic types, and some other 'installation-dependent' definitions
** See Copyright Notice in lua.h
*/
@@ -133,7 +133,7 @@ typedef LUAI_UACINT l_uacInt;
*/
#if defined(__GNUC__)
#define l_noret void __attribute__((noreturn))
-#elif defined(_MSC_VER)
+#elif defined(_MSC_VER) && _MSC_VER >= 1200
#define l_noret void __declspec(noreturn)
#else
#define l_noret void
diff --git a/src/lmem.h b/src/lmem.h
index f701ae0f..30f48489 100644
--- a/src/lmem.h
+++ b/src/lmem.h
@@ -1,5 +1,5 @@
/*
-** $Id: lmem.h,v 1.41 2014/10/08 20:25:51 roberto Exp $
+** $Id: lmem.h,v 1.43 2014/12/19 17:26:14 roberto Exp $
** Interface to Memory Manager
** See Copyright Notice in lua.h
*/
@@ -32,6 +32,12 @@
? luaM_toobig(L) : cast_void(0)) , \
luaM_realloc_(L, (b), (on)*(e), (n)*(e)))
+/*
+** Arrays of chars do not need any test
+*/
+#define luaM_reallocvchar(L,b,on,n) \
+ cast(char *, luaM_realloc_(L, (b), (on)*sizeof(char), (n)*sizeof(char)))
+
#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0)
#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0)
#define luaM_freearray(L, b, n) luaM_realloc_(L, (b), (n)*sizeof(*(b)), 0)
diff --git a/src/lobject.h b/src/lobject.h
index abe6e7af..77b4e470 100644
--- a/src/lobject.h
+++ b/src/lobject.h
@@ -1,5 +1,5 @@
/*
-** $Id: lobject.h,v 2.104 2014/10/25 11:50:46 roberto Exp $
+** $Id: lobject.h,v 2.105 2014/12/19 13:36:32 roberto Exp $
** Type definitions for Lua objects
** See Copyright Notice in lua.h
*/
@@ -154,6 +154,8 @@ typedef struct lua_TValue TValue;
/* Macros to access values */
#define ivalue(o) check_exp(ttisinteger(o), val_(o).i)
#define fltvalue(o) check_exp(ttisfloat(o), val_(o).n)
+#define nvalue(o) check_exp(ttisnumber(o), \
+ (ttisinteger(o) ? cast_num(ivalue(o)) : fltvalue(o)))
#define gcvalue(o) check_exp(iscollectable(o), val_(o).gc)
#define pvalue(o) check_exp(ttislightuserdata(o), val_(o).p)
#define tsvalue(o) check_exp(ttisstring(o), gco2ts(val_(o).gc))
diff --git a/src/luaconf.h b/src/luaconf.h
index f470f0eb..7e9cd9a7 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -1,5 +1,5 @@
/*
-** $Id: luaconf.h,v 1.235 2014/12/16 17:17:30 roberto Exp $
+** $Id: luaconf.h,v 1.236 2014/12/19 13:31:12 roberto Exp $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
@@ -109,7 +109,7 @@
#if defined(LUA_32BITS) /* { */
/*
-** Small Lua (32-bit integers and 'float')
+** 32-bit integers and 'float'
*/
#if LUAI_BITSINT >= 32 /* use 'int' if big enough */
#define LUA_INT_INT
diff --git a/src/lvm.c b/src/lvm.c
index 09a9afa3..e35b720e 100644
--- a/src/lvm.c
+++ b/src/lvm.c
@@ -1,5 +1,5 @@
/*
-** $Id: lvm.c,v 2.230 2014/11/21 12:15:00 roberto Exp $
+** $Id: lvm.c,v 2.231 2014/12/19 13:36:32 roberto Exp $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -74,8 +74,7 @@ int luaV_tonumber_ (const TValue *obj, lua_Number *n) {
}
else if (cvt2num(obj) && /* string convertible to number? */
luaO_str2num(svalue(obj), &v) == tsvalue(obj)->len + 1) {
- /* convert result of 'luaO_str2num' to a float */
- *n = (ttisinteger(&v)) ? cast_num(ivalue(&v)) : fltvalue(&v);
+ *n = nvalue(&v); /* convert result of 'luaO_str2num' to a float */
return 1;
}
else
diff --git a/src/lzio.h b/src/lzio.h
index 2ad163a6..b2e56bcd 100644
--- a/src/lzio.h
+++ b/src/lzio.h
@@ -1,5 +1,5 @@
/*
-** $Id: lzio.h,v 1.28 2014/01/31 15:14:22 roberto Exp $
+** $Id: lzio.h,v 1.30 2014/12/19 17:26:14 roberto Exp $
** Buffered streams
** See Copyright Notice in lua.h
*/
@@ -37,7 +37,8 @@ typedef struct Mbuffer {
#define luaZ_resizebuffer(L, buff, size) \
- (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \
+ ((buff)->buffer = luaM_reallocvchar(L, (buff)->buffer, \
+ (buff)->buffsize, size), \
(buff)->buffsize = size)
#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0)