Skip to content

Commit

Permalink
Update included Lua to 5.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Oct 17, 2018
1 parent 36e9588 commit 73715b1
Show file tree
Hide file tree
Showing 61 changed files with 145 additions and 89 deletions.
4 changes: 2 additions & 2 deletions liblua/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ c89:


freebsd:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline"
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"

generic: $(ALL)

linux:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"

macosx:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"

mingw:
$(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \
Expand Down
7 changes: 4 additions & 3 deletions liblua/lapi.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 2.259 2016/02/29 14:27:14 roberto Exp $
** $Id: lapi.c,v 2.259.1.2 2017/12/06 18:35:12 roberto Exp $
** Lua API
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -533,6 +533,7 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
lua_lock(L);
if (n == 0) {
setfvalue(L->top, fn);
api_incr_top(L);
}
else {
CClosure *cl;
Expand All @@ -546,9 +547,9 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
/* does not need barrier because closure is white */
}
setclCvalue(L, L->top, cl);
api_incr_top(L);
luaC_checkGC(L);
}
api_incr_top(L);
luaC_checkGC(L);
lua_unlock(L);
}

Expand Down
2 changes: 1 addition & 1 deletion liblua/lapi.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lapi.h,v 2.9 2015/03/06 19:49:50 roberto Exp $
** $Id: lapi.h,v 2.9.1.1 2017/04/19 17:20:42 roberto Exp $
** Auxiliary functions from Lua API
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lauxlib.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lauxlib.c,v 1.289 2016/12/20 18:37:00 roberto Exp $
** $Id: lauxlib.c,v 1.289.1.1 2017/04/19 17:20:42 roberto Exp $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lauxlib.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lauxlib.h,v 1.131 2016/12/06 14:54:31 roberto Exp $
** $Id: lauxlib.h,v 1.131.1.1 2017/04/19 17:20:42 roberto Exp $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lbaselib.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lbaselib.c,v 1.314 2016/09/05 19:06:34 roberto Exp $
** $Id: lbaselib.c,v 1.314.1.1 2017/04/19 17:39:34 roberto Exp $
** Basic library
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lbitlib.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lbitlib.c,v 1.30 2015/11/11 19:08:09 roberto Exp $
** $Id: lbitlib.c,v 1.30.1.1 2017/04/19 17:20:42 roberto Exp $
** Standard library for bitwise operations
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lcode.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lcode.c,v 2.112 2016/12/22 13:08:50 roberto Exp $
** $Id: lcode.c,v 2.112.1.1 2017/04/19 17:20:42 roberto Exp $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lcode.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lcode.h,v 1.64 2016/01/05 16:22:37 roberto Exp $
** $Id: lcode.h,v 1.64.1.1 2017/04/19 17:20:42 roberto Exp $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lcorolib.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lcorolib.c,v 1.10 2016/04/11 19:19:55 roberto Exp $
** $Id: lcorolib.c,v 1.10.1.1 2017/04/19 17:20:42 roberto Exp $
** Coroutine Library
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lctype.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lctype.c,v 1.12 2014/11/02 19:19:04 roberto Exp $
** $Id: lctype.c,v 1.12.1.1 2017/04/19 17:20:42 roberto Exp $
** 'ctype' functions for Lua
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lctype.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lctype.h,v 1.12 2011/07/15 12:50:29 roberto Exp $
** $Id: lctype.h,v 1.12.1.1 2013/04/12 18:48:47 roberto Exp $
** 'ctype' functions for Lua
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/ldblib.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: ldblib.c,v 1.151 2015/11/23 11:29:43 roberto Exp $
** $Id: ldblib.c,v 1.151.1.1 2017/04/19 17:20:42 roberto Exp $
** Interface from Lua to its debug API
** See Copyright Notice in lua.h
*/
Expand Down
3 changes: 2 additions & 1 deletion liblua/ldebug.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: ldebug.c,v 2.121 2016/10/19 12:32:10 roberto Exp $
** $Id: ldebug.c,v 2.121.1.2 2017/07/10 17:21:50 roberto Exp $
** Debug Interface
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -653,6 +653,7 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) {
CallInfo *ci = L->ci;
const char *msg;
va_list argp;
luaC_checkGC(L); /* error message uses memory */
va_start(argp, fmt);
msg = luaO_pushvfstring(L, fmt, argp); /* format message */
va_end(argp);
Expand Down
2 changes: 1 addition & 1 deletion liblua/ldebug.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: ldebug.h,v 2.14 2015/05/22 17:45:56 roberto Exp $
** $Id: ldebug.h,v 2.14.1.1 2017/04/19 17:20:42 roberto Exp $
** Auxiliary functions from Debug Interface module
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/ldo.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: ldo.c,v 2.157 2016/12/13 15:52:21 roberto Exp $
** $Id: ldo.c,v 2.157.1.1 2017/04/19 17:20:42 roberto Exp $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/ldo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: ldo.h,v 2.29 2015/12/21 13:02:14 roberto Exp $
** $Id: ldo.h,v 2.29.1.1 2017/04/19 17:20:42 roberto Exp $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/ldump.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: ldump.c,v 2.37 2015/10/08 15:53:49 roberto Exp $
** $Id: ldump.c,v 2.37.1.1 2017/04/19 17:20:42 roberto Exp $
** save precompiled Lua chunks
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lfunc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lfunc.c,v 2.45 2014/11/02 19:19:04 roberto Exp $
** $Id: lfunc.c,v 2.45.1.1 2017/04/19 17:39:34 roberto Exp $
** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lfunc.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lfunc.h,v 2.15 2015/01/13 15:49:11 roberto Exp $
** $Id: lfunc.h,v 2.15.1.1 2017/04/19 17:39:34 roberto Exp $
** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h
*/
Expand Down
5 changes: 3 additions & 2 deletions liblua/lgc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lgc.c,v 2.215 2016/12/22 13:08:50 roberto Exp $
** $Id: lgc.c,v 2.215.1.2 2017/08/31 16:15:27 roberto Exp $
** Garbage Collector
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -643,8 +643,9 @@ static void clearkeys (global_State *g, GCObject *l, GCObject *f) {
for (n = gnode(h, 0); n < limit; n++) {
if (!ttisnil(gval(n)) && (iscleared(g, gkey(n)))) {
setnilvalue(gval(n)); /* remove value ... */
removeentry(n); /* and remove entry from table */
}
if (ttisnil(gval(n))) /* is entry empty? */
removeentry(n); /* remove entry from table */
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion liblua/lgc.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lgc.h,v 2.91 2015/12/21 13:02:14 roberto Exp $
** $Id: lgc.h,v 2.91.1.1 2017/04/19 17:39:34 roberto Exp $
** Garbage Collector
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/linit.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: linit.c,v 1.39 2016/12/04 20:17:24 roberto Exp $
** $Id: linit.c,v 1.39.1.1 2017/04/19 17:20:42 roberto Exp $
** Initialization of libraries for lua.c and other clients
** See Copyright Notice in lua.h
*/
Expand Down
13 changes: 9 additions & 4 deletions liblua/liolib.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: liolib.c,v 2.151 2016/12/20 18:37:00 roberto Exp $
** $Id: liolib.c,v 2.151.1.1 2017/04/19 17:29:57 roberto Exp $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -206,11 +206,16 @@ static int aux_close (lua_State *L) {
}


static int f_close (lua_State *L) {
tofile(L); /* make sure argument is an open stream */
return aux_close(L);
}


static int io_close (lua_State *L) {
if (lua_isnone(L, 1)) /* no argument? */
lua_getfield(L, LUA_REGISTRYINDEX, IO_OUTPUT); /* use standard output */
tofile(L); /* make sure argument is an open stream */
return aux_close(L);
return f_close(L);
}


Expand Down Expand Up @@ -712,7 +717,7 @@ static const luaL_Reg iolib[] = {
** methods for file handles
*/
static const luaL_Reg flib[] = {
{"close", io_close},
{"close", f_close},
{"flush", f_flush},
{"lines", f_lines},
{"read", f_read},
Expand Down
2 changes: 1 addition & 1 deletion liblua/llex.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: llex.c,v 2.96 2016/05/02 14:02:12 roberto Exp $
** $Id: llex.c,v 2.96.1.1 2017/04/19 17:20:42 roberto Exp $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/llex.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: llex.h,v 1.79 2016/05/02 14:02:12 roberto Exp $
** $Id: llex.h,v 1.79.1.1 2017/04/19 17:20:42 roberto Exp $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/llimits.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: llimits.h,v 1.141 2015/11/19 19:16:22 roberto Exp $
** $Id: llimits.h,v 1.141.1.1 2017/04/19 17:20:42 roberto Exp $
** Limits, basic types, and some other 'installation-dependent' definitions
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lmathlib.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lmathlib.c,v 1.119 2016/12/22 13:08:50 roberto Exp $
** $Id: lmathlib.c,v 1.119.1.1 2017/04/19 17:20:42 roberto Exp $
** Standard mathematical library
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lmem.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lmem.c,v 1.91 2015/03/06 19:45:54 roberto Exp $
** $Id: lmem.c,v 1.91.1.1 2017/04/19 17:20:42 roberto Exp $
** Interface to Memory Manager
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lmem.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lmem.h,v 1.43 2014/12/19 17:26:14 roberto Exp $
** $Id: lmem.h,v 1.43.1.1 2017/04/19 17:20:42 roberto Exp $
** Interface to Memory Manager
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/loadlib.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: loadlib.c,v 1.130 2017/01/12 17:14:26 roberto Exp $
** $Id: loadlib.c,v 1.130.1.1 2017/04/19 17:20:42 roberto Exp $
** Dynamic library loader for Lua
** See Copyright Notice in lua.h
**
Expand Down
5 changes: 3 additions & 2 deletions liblua/lobject.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lobject.c,v 2.113 2016/12/22 13:08:50 roberto Exp $
** $Id: lobject.c,v 2.113.1.1 2017/04/19 17:29:57 roberto Exp $
** Some generic functions over Lua objects
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -435,7 +435,8 @@ const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) {
}
case 'p': { /* a pointer */
char buff[4*sizeof(void *) + 8]; /* should be enough space for a '%p' */
int l = l_sprintf(buff, sizeof(buff), "%p", va_arg(argp, void *));
void *p = va_arg(argp, void *);
int l = lua_pointer2str(buff, sizeof(buff), p);
pushstr(L, buff, l);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion liblua/lobject.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lobject.h,v 2.117 2016/08/01 19:51:24 roberto Exp $
** $Id: lobject.h,v 2.117.1.1 2017/04/19 17:39:34 roberto Exp $
** Type definitions for Lua objects
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lopcodes.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lopcodes.c,v 1.55 2015/01/05 13:48:33 roberto Exp $
** $Id: lopcodes.c,v 1.55.1.1 2017/04/19 17:20:42 roberto Exp $
** Opcodes for Lua virtual machine
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lopcodes.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lopcodes.h,v 1.149 2016/07/19 17:12:21 roberto Exp $
** $Id: lopcodes.h,v 1.149.1.1 2017/04/19 17:20:42 roberto Exp $
** Opcodes for Lua virtual machine
** See Copyright Notice in lua.h
*/
Expand Down
8 changes: 5 additions & 3 deletions liblua/loslib.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: loslib.c,v 1.65 2016/07/18 17:58:58 roberto Exp $
** $Id: loslib.c,v 1.65.1.1 2017/04/19 17:29:57 roberto Exp $
** Standard Operating System library
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -293,7 +293,8 @@ static int os_date (lua_State *L) {
else
stm = l_localtime(&t, &tmr);
if (stm == NULL) /* invalid date? */
luaL_error(L, "time result cannot be represented in this installation");
return luaL_error(L,
"time result cannot be represented in this installation");
if (strcmp(s, "*t") == 0) {
lua_createtable(L, 0, 9); /* 9 = number of fields */
setallfields(L, stm);
Expand Down Expand Up @@ -340,7 +341,8 @@ static int os_time (lua_State *L) {
setallfields(L, &ts); /* update fields with normalized values */
}
if (t != (time_t)(l_timet)t || t == (time_t)(-1))
luaL_error(L, "time result cannot be represented in this installation");
return luaL_error(L,
"time result cannot be represented in this installation");
l_pushtime(L, t);
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions liblua/lparser.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lparser.c,v 2.155 2016/08/01 19:51:24 roberto Exp $
** $Id: lparser.c,v 2.155.1.2 2017/04/29 18:11:40 roberto Exp $
** Lua Parser
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -1392,7 +1392,7 @@ static void test_then_block (LexState *ls, int *escapelist) {
luaK_goiffalse(ls->fs, &v); /* will jump to label if condition is true */
enterblock(fs, &bl, 0); /* must enter block before 'goto' */
gotostat(ls, v.t); /* handle goto/break */
skipnoopstat(ls); /* skip other no-op statements */
while (testnext(ls, ';')) {} /* skip colons */
if (block_follow(ls, 0)) { /* 'goto' is the entire block? */
leaveblock(fs);
return; /* and that is it */
Expand Down
2 changes: 1 addition & 1 deletion liblua/lparser.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lparser.h,v 1.76 2015/12/30 18:16:13 roberto Exp $
** $Id: lparser.h,v 1.76.1.1 2017/04/19 17:20:42 roberto Exp $
** Lua Parser
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lprefix.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lprefix.h,v 1.2 2014/12/29 16:54:13 roberto Exp $
** $Id: lprefix.h,v 1.2.1.1 2017/04/19 17:20:42 roberto Exp $
** Definitions for Lua code that must come before any other header file
** See Copyright Notice in lua.h
*/
Expand Down
2 changes: 1 addition & 1 deletion liblua/lstate.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lstate.c,v 2.133 2015/11/13 12:16:51 roberto Exp $
** $Id: lstate.c,v 2.133.1.1 2017/04/19 17:39:34 roberto Exp $
** Global State
** See Copyright Notice in lua.h
*/
Expand Down
Loading

0 comments on commit 73715b1

Please sign in to comment.