summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-04-23 14:48:15 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-04-23 14:48:15 -0300
commit0ddc0f47bd2a03678e1afbc384550aecb55a318f (patch)
treeb441f7e68329c59aa3f44bb4967f404b5319dbe4
parentcac075a1221f373053196dbb24bdcff4609b8241 (diff)
downloadlua-0ddc0f47bd2a03678e1afbc384550aecb55a318f.tar.gz
lua-0ddc0f47bd2a03678e1afbc384550aecb55a318f.tar.bz2
lua-0ddc0f47bd2a03678e1afbc384550aecb55a318f.zip
Several details about 5.4.0 rc1
Corrected several small details: added 'const', adjusts in tabs x spaces, removed unused #includes and #defines, misspellings, etc.
-rw-r--r--ljumptab.h2
-rw-r--r--lmathlib.c2
-rw-r--r--loadlib.c2
-rw-r--r--lobject.h3
-rw-r--r--lopcodes.c2
-rw-r--r--lopcodes.h20
-rw-r--r--lopnames.h3
-rw-r--r--loslib.c2
-rw-r--r--lprefix.h2
-rw-r--r--ltable.h2
-rw-r--r--lvm.h4
-rw-r--r--manual/manual.of2
12 files changed, 22 insertions, 24 deletions
diff --git a/ljumptab.h b/ljumptab.h
index 0edd79d5..8306f250 100644
--- a/ljumptab.h
+++ b/ljumptab.h
@@ -16,7 +16,7 @@
16#define vmbreak vmfetch(); vmdispatch(GET_OPCODE(i)); 16#define vmbreak vmfetch(); vmdispatch(GET_OPCODE(i));
17 17
18 18
19static void *disptab[NUM_OPCODES] = { 19static const void *const disptab[NUM_OPCODES] = {
20 20
21#if 0 21#if 0
22** you can update the following list with this command: 22** you can update the following list with this command:
diff --git a/lmathlib.c b/lmathlib.c
index 63f6036a..86def470 100644
--- a/lmathlib.c
+++ b/lmathlib.c
@@ -328,7 +328,7 @@ static Rand64 nextrand (Rand64 *state) {
328*/ 328*/
329 329
330/* must throw out the extra (64 - FIGS) bits */ 330/* must throw out the extra (64 - FIGS) bits */
331#define shift64_FIG (64 - FIGS) 331#define shift64_FIG (64 - FIGS)
332 332
333/* to scale to [0, 1), multiply by scaleFIG = 2^(-FIGS) */ 333/* to scale to [0, 1), multiply by scaleFIG = 2^(-FIGS) */
334#define scaleFIG (l_mathop(0.5) / ((Rand64)1 << (FIGS - 1))) 334#define scaleFIG (l_mathop(0.5) / ((Rand64)1 << (FIGS - 1)))
diff --git a/loadlib.c b/loadlib.c
index 56167f64..9d86b158 100644
--- a/loadlib.c
+++ b/loadlib.c
@@ -269,8 +269,6 @@ static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym) {
269#endif 269#endif
270 270
271 271
272#define AUXMARK "\1" /* auxiliary mark */
273
274 272
275/* 273/*
276** return registry.LUA_NOENV as a boolean 274** return registry.LUA_NOENV as a boolean
diff --git a/lobject.h b/lobject.h
index 428145a4..2d63c001 100644
--- a/lobject.h
+++ b/lobject.h
@@ -356,8 +356,7 @@ typedef struct GCObject {
356 356
357 357
358/* 358/*
359** Header for string value; string bytes follow the end of this structure 359** Header for string value; string bytes follow the end of this structure.
360** (aligned according to 'UTString'; see next).
361*/ 360*/
362typedef struct TString { 361typedef struct TString {
363 CommonHeader; 362 CommonHeader;
diff --git a/lopcodes.c b/lopcodes.c
index 4e983e08..c67aa227 100644
--- a/lopcodes.c
+++ b/lopcodes.c
@@ -10,8 +10,6 @@
10#include "lprefix.h" 10#include "lprefix.h"
11 11
12 12
13#include <stddef.h>
14
15#include "lopcodes.h" 13#include "lopcodes.h"
16 14
17 15
diff --git a/lopcodes.h b/lopcodes.h
index d3a3f08e..122e5d21 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -201,9 +201,9 @@ OP_MOVE,/* A B R[A] := R[B] */
201OP_LOADI,/* A sBx R[A] := sBx */ 201OP_LOADI,/* A sBx R[A] := sBx */
202OP_LOADF,/* A sBx R[A] := (lua_Number)sBx */ 202OP_LOADF,/* A sBx R[A] := (lua_Number)sBx */
203OP_LOADK,/* A Bx R[A] := K[Bx] */ 203OP_LOADK,/* A Bx R[A] := K[Bx] */
204OP_LOADKX,/* A R[A] := K[extra arg] */ 204OP_LOADKX,/* A R[A] := K[extra arg] */
205OP_LOADFALSE,/* A R[A] := false */ 205OP_LOADFALSE,/* A R[A] := false */
206OP_LFALSESKIP,/*A R[A] := false; pc++ */ 206OP_LFALSESKIP,/*A R[A] := false; pc++ */
207OP_LOADTRUE,/* A R[A] := true */ 207OP_LOADTRUE,/* A R[A] := true */
208OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */ 208OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */
209OP_GETUPVAL,/* A B R[A] := UpValue[B] */ 209OP_GETUPVAL,/* A B R[A] := UpValue[B] */
@@ -263,11 +263,11 @@ OP_BNOT,/* A B R[A] := ~R[B] */
263OP_NOT,/* A B R[A] := not R[B] */ 263OP_NOT,/* A B R[A] := not R[B] */
264OP_LEN,/* A B R[A] := length of R[B] */ 264OP_LEN,/* A B R[A] := length of R[B] */
265 265
266OP_CONCAT,/* A B R[A] := R[A].. ... ..R[A + B - 1] */ 266OP_CONCAT,/* A B R[A] := R[A].. ... ..R[A + B - 1] */
267 267
268OP_CLOSE,/* A close all upvalues >= R[A] */ 268OP_CLOSE,/* A close all upvalues >= R[A] */
269OP_TBC,/* A mark variable A "to be closed" */ 269OP_TBC,/* A mark variable A "to be closed" */
270OP_JMP,/* sJ pc += sJ */ 270OP_JMP,/* sJ pc += sJ */
271OP_EQ,/* A B k if ((R[A] == R[B]) ~= k) then pc++ */ 271OP_EQ,/* A B k if ((R[A] == R[B]) ~= k) then pc++ */
272OP_LT,/* A B k if ((R[A] < R[B]) ~= k) then pc++ */ 272OP_LT,/* A B k if ((R[A] < R[B]) ~= k) then pc++ */
273OP_LE,/* A B k if ((R[A] <= R[B]) ~= k) then pc++ */ 273OP_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++ */
279OP_GTI,/* A sB k if ((R[A] > sB) ~= k) then pc++ */ 279OP_GTI,/* A sB k if ((R[A] > sB) ~= k) then pc++ */
280OP_GEI,/* A sB k if ((R[A] >= sB) ~= k) then pc++ */ 280OP_GEI,/* A sB k if ((R[A] >= sB) ~= k) then pc++ */
281 281
282OP_TEST,/* A k if (not R[A] == k) then pc++ */ 282OP_TEST,/* A k if (not R[A] == k) then pc++ */
283OP_TESTSET,/* A B k if (not R[B] == k) then pc++ else R[A] := R[B] */ 283OP_TESTSET,/* A B k if (not R[B] == k) then pc++ else R[A] := R[B] */
284 284
285OP_CALL,/* A B C R[A], ... ,R[A+C-2] := R[A](R[A+1], ... ,R[A+B-1]) */ 285OP_CALL,/* A B C R[A], ... ,R[A+C-2] := R[A](R[A+1], ... ,R[A+B-1]) */
286OP_TAILCALL,/* A B C k return R[A](R[A+1], ... ,R[A+B-1]) */ 286OP_TAILCALL,/* A B C k return R[A](R[A+1], ... ,R[A+B-1]) */
287 287
288OP_RETURN,/* A B C k return R[A], ... ,R[A+B-2] (see note) */ 288OP_RETURN,/* A B C k return R[A], ... ,R[A+B-2] (see note) */
289OP_RETURN0,/* return */ 289OP_RETURN0,/* return */
290OP_RETURN1,/* A return R[A] */ 290OP_RETURN1,/* A return R[A] */
291 291
292OP_FORLOOP,/* A Bx update counters; if loop continues then pc-=Bx; */ 292OP_FORLOOP,/* A Bx update counters; if loop continues then pc-=Bx; */
293OP_FORPREP,/* A Bx <check values and prepare counters>; 293OP_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 */
301 301
302OP_CLOSURE,/* A Bx R[A] := closure(KPROTO[Bx]) */ 302OP_CLOSURE,/* A Bx R[A] := closure(KPROTO[Bx]) */
303 303
304OP_VARARG,/* A C R[A], R[A+1], ..., R[A+C-2] = vararg */ 304OP_VARARG,/* A C R[A], R[A+1], ..., R[A+C-2] = vararg */
305 305
306OP_VARARGPREP,/*A (adjust vararg parameters) */ 306OP_VARARGPREP,/*A (adjust vararg parameters) */
307 307
308OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ 308OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */
309} OpCode; 309} OpCode;
diff --git a/lopnames.h b/lopnames.h
index f20147e3..965cec9b 100644
--- a/lopnames.h
+++ b/lopnames.h
@@ -7,6 +7,9 @@
7#if !defined(lopnames_h) 7#if !defined(lopnames_h)
8#define lopnames_h 8#define lopnames_h
9 9
10#include <stddef.h>
11
12
10/* ORDER OP */ 13/* ORDER OP */
11 14
12static const char *const opnames[] = { 15static const char *const opnames[] = {
diff --git a/loslib.c b/loslib.c
index 29449e40..5e0fafb4 100644
--- a/loslib.c
+++ b/loslib.c
@@ -91,7 +91,7 @@
91 91
92/* ISO C definitions */ 92/* ISO C definitions */
93#define l_gmtime(t,r) ((void)(r)->tm_sec, gmtime(t)) 93#define l_gmtime(t,r) ((void)(r)->tm_sec, gmtime(t))
94#define l_localtime(t,r) ((void)(r)->tm_sec, localtime(t)) 94#define l_localtime(t,r) ((void)(r)->tm_sec, localtime(t))
95 95
96#endif /* } */ 96#endif /* } */
97 97
diff --git a/lprefix.h b/lprefix.h
index dd14767e..484f2ad6 100644
--- a/lprefix.h
+++ b/lprefix.h
@@ -33,7 +33,7 @@
33/* 33/*
34** Windows stuff 34** Windows stuff
35*/ 35*/
36#if defined(_WIN32) /* { */ 36#if defined(_WIN32) /* { */
37 37
38#if !defined(_CRT_SECURE_NO_WARNINGS) 38#if !defined(_CRT_SECURE_NO_WARNINGS)
39#define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */ 39#define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */
diff --git a/ltable.h b/ltable.h
index 9565833f..ebd7f8ec 100644
--- a/ltable.h
+++ b/ltable.h
@@ -27,7 +27,7 @@
27 27
28 28
29/* returns the Node, given the value of a table entry */ 29/* returns the Node, given the value of a table entry */
30#define nodefromval(v) cast(Node *, (v)) 30#define nodefromval(v) cast(Node *, (v))
31 31
32 32
33LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); 33LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key);
diff --git a/lvm.h b/lvm.h
index 71038572..2d4ac160 100644
--- a/lvm.h
+++ b/lvm.h
@@ -41,9 +41,9 @@
41** Rounding modes for float->integer coercion 41** Rounding modes for float->integer coercion
42 */ 42 */
43typedef enum { 43typedef enum {
44 F2Ieq, /* no rounding; accepts only integral values */ 44 F2Ieq, /* no rounding; accepts only integral values */
45 F2Ifloor, /* takes the floor of the number */ 45 F2Ifloor, /* takes the floor of the number */
46 F2Iceil, /* takes the ceil of the number */ 46 F2Iceil /* takes the ceil of the number */
47} F2Imod; 47} F2Imod;
48 48
49 49
diff --git a/manual/manual.of b/manual/manual.of
index b237ad46..9eeb94aa 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -9013,7 +9013,7 @@ not a float.
9013Literal decimal integer constants that overflow are read as floats, 9013Literal decimal integer constants that overflow are read as floats,
9014instead of wrapping around. 9014instead of wrapping around.
9015You can use hexadecimal notation for such constants if you 9015You can use hexadecimal notation for such constants if you
9016want the old bevhavior 9016want the old behavior
9017(reading them as integers with wrap around). 9017(reading them as integers with wrap around).
9018} 9018}
9019 9019