Skip to content

Commit 26fde6b

Browse files
committed
Update Lua 5.4 to 5.4.0-rc3 and bump version to 535.0.3+540rc3
1 parent 12b57b4 commit 26fde6b

18 files changed

+43
-32
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "lua-src"
3-
version = "535.0.2+540rc1"
3+
version = "535.0.3+540rc3"
44
authors = ["Aleksandr Orlenko <[email protected]>"]
55
edition = "2018"
66
repository = "https://github.com/khvzak/lua-src-rs"
77
keywords = ["lua", "lua51", "lua52", "lua53", "lua54"]
88
readme = "README.md"
99
license = "MIT"
1010
description = """
11-
Sources of Lua 5.1/5.2/5.3/5.4(rc1) and logic to build them.
11+
Sources of Lua 5.1/5.2/5.3/5.4(rc3) and logic to build them.
1212
"""
1313

1414
[workspace]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# lua-src
22

3-
This crate contains the sources of Lua 5.1/5.2/5.3/5.4(rc1) and logic to build them.
3+
This crate contains the sources of Lua 5.1/5.2/5.3/5.4(rc3) and logic to build them.
44
Intended to be consumed by the [mlua](https://crates.io/crates/mlua) crate.
55

66
# License

lua-5.4.0/lauxlib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static int pushglobalfuncname (lua_State *L, lua_Debug *ar) {
8787
lua_remove(L, -2); /* remove original name */
8888
}
8989
lua_copy(L, -1, top + 1); /* copy name to proper place */
90-
lua_settop(L, top + 1); /* remove table "loaded" an name copy */
90+
lua_settop(L, top + 1); /* remove table "loaded" and name copy */
9191
return 1;
9292
}
9393
else {

lua-5.4.0/ldump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static void dumpFunction (DumpState *D, const Proto *f, TString *psource) {
196196

197197
static void dumpHeader (DumpState *D) {
198198
dumpLiteral(D, LUA_SIGNATURE);
199-
dumpInt(D, LUAC_VERSION);
199+
dumpByte(D, LUAC_VERSION);
200200
dumpByte(D, LUAC_FORMAT);
201201
dumpLiteral(D, LUAC_DATA);
202202
dumpByte(D, sizeof(Instruction));

lua-5.4.0/ljumptab.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define vmbreak vmfetch(); vmdispatch(GET_OPCODE(i));
1717

1818

19-
static void *disptab[NUM_OPCODES] = {
19+
static const void *const disptab[NUM_OPCODES] = {
2020

2121
#if 0
2222
** you can update the following list with this command:

lua-5.4.0/lmathlib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ static Rand64 nextrand (Rand64 *state) {
328328
*/
329329

330330
/* must throw out the extra (64 - FIGS) bits */
331-
#define shift64_FIG (64 - FIGS)
331+
#define shift64_FIG (64 - FIGS)
332332

333333
/* to scale to [0, 1), multiply by scaleFIG = 2^(-FIGS) */
334334
#define scaleFIG (l_mathop(0.5) / ((Rand64)1 << (FIGS - 1)))

lua-5.4.0/loadlib.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ static const char *const CLIBS = "_CLIBS";
6767
#define setprogdir(L) ((void)0)
6868

6969

70+
/*
71+
** Special type equivalent to '(void*)' for functions in gcc
72+
** (to suppress warnings when converting function pointers)
73+
*/
74+
typedef void (*voidf)(void);
75+
76+
7077
/*
7178
** system-dependent functions
7279
*/
@@ -206,7 +213,7 @@ static void *lsys_load (lua_State *L, const char *path, int seeglb) {
206213

207214

208215
static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym) {
209-
lua_CFunction f = (lua_CFunction)GetProcAddress((HMODULE)lib, sym);
216+
lua_CFunction f = (lua_CFunction)(voidf)GetProcAddress((HMODULE)lib, sym);
210217
if (f == NULL) pusherror(L);
211218
return f;
212219
}
@@ -269,8 +276,6 @@ static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym) {
269276
#endif
270277

271278

272-
#define AUXMARK "\1" /* auxiliary mark */
273-
274279

275280
/*
276281
** return registry.LUA_NOENV as a boolean

lua-5.4.0/lobject.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,7 @@ typedef struct GCObject {
356356

357357

358358
/*
359-
** Header for string value; string bytes follow the end of this structure
360-
** (aligned according to 'UTString'; see next).
359+
** Header for string value; string bytes follow the end of this structure.
361360
*/
362361
typedef struct TString {
363362
CommonHeader;

lua-5.4.0/lopcodes.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#include "lprefix.h"
1111

1212

13-
#include <stddef.h>
14-
1513
#include "lopcodes.h"
1614

1715

lua-5.4.0/lopcodes.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ OP_MOVE,/* A B R[A] := R[B] */
201201
OP_LOADI,/* A sBx R[A] := sBx */
202202
OP_LOADF,/* A sBx R[A] := (lua_Number)sBx */
203203
OP_LOADK,/* A Bx R[A] := K[Bx] */
204-
OP_LOADKX,/* A R[A] := K[extra arg] */
205-
OP_LOADFALSE,/* A R[A] := false */
206-
OP_LFALSESKIP,/*A R[A] := false; pc++ */
204+
OP_LOADKX,/* A R[A] := K[extra arg] */
205+
OP_LOADFALSE,/* A R[A] := false */
206+
OP_LFALSESKIP,/*A R[A] := false; pc++ */
207207
OP_LOADTRUE,/* A R[A] := true */
208208
OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */
209209
OP_GETUPVAL,/* A B R[A] := UpValue[B] */
@@ -263,11 +263,11 @@ OP_BNOT,/* A B R[A] := ~R[B] */
263263
OP_NOT,/* A B R[A] := not R[B] */
264264
OP_LEN,/* A B R[A] := length of R[B] */
265265

266-
OP_CONCAT,/* A B R[A] := R[A].. ... ..R[A + B - 1] */
266+
OP_CONCAT,/* A B R[A] := R[A].. ... ..R[A + B - 1] */
267267

268268
OP_CLOSE,/* A close all upvalues >= R[A] */
269269
OP_TBC,/* A mark variable A "to be closed" */
270-
OP_JMP,/* sJ pc += sJ */
270+
OP_JMP,/* sJ pc += sJ */
271271
OP_EQ,/* A B k if ((R[A] == R[B]) ~= k) then pc++ */
272272
OP_LT,/* A B k if ((R[A] < R[B]) ~= k) then pc++ */
273273
OP_LE,/* A B k if ((R[A] <= R[B]) ~= k) then pc++ */
@@ -279,15 +279,15 @@ OP_LEI,/* A sB k if ((R[A] <= sB) ~= k) then pc++ */
279279
OP_GTI,/* A sB k if ((R[A] > sB) ~= k) then pc++ */
280280
OP_GEI,/* A sB k if ((R[A] >= sB) ~= k) then pc++ */
281281

282-
OP_TEST,/* A k if (not R[A] == k) then pc++ */
282+
OP_TEST,/* A k if (not R[A] == k) then pc++ */
283283
OP_TESTSET,/* A B k if (not R[B] == k) then pc++ else R[A] := R[B] */
284284

285285
OP_CALL,/* A B C R[A], ... ,R[A+C-2] := R[A](R[A+1], ... ,R[A+B-1]) */
286286
OP_TAILCALL,/* A B C k return R[A](R[A+1], ... ,R[A+B-1]) */
287287

288288
OP_RETURN,/* A B C k return R[A], ... ,R[A+B-2] (see note) */
289-
OP_RETURN0,/* return */
290-
OP_RETURN1,/* A return R[A] */
289+
OP_RETURN0,/* return */
290+
OP_RETURN1,/* A return R[A] */
291291

292292
OP_FORLOOP,/* A Bx update counters; if loop continues then pc-=Bx; */
293293
OP_FORPREP,/* A Bx <check values and prepare counters>;
@@ -301,9 +301,9 @@ OP_SETLIST,/* A B C k R[A][(C-1)*FPF+i] := R[A+i], 1 <= i <= B */
301301

302302
OP_CLOSURE,/* A Bx R[A] := closure(KPROTO[Bx]) */
303303

304-
OP_VARARG,/* A C R[A], R[A+1], ..., R[A+C-2] = vararg */
304+
OP_VARARG,/* A C R[A], R[A+1], ..., R[A+C-2] = vararg */
305305

306-
OP_VARARGPREP,/*A (adjust vararg parameters) */
306+
OP_VARARGPREP,/*A (adjust vararg parameters) */
307307

308308
OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */
309309
} OpCode;

0 commit comments

Comments
 (0)