diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-04-23 14:48:15 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-04-23 14:48:15 -0300 |
| commit | 0ddc0f47bd2a03678e1afbc384550aecb55a318f (patch) | |
| tree | b441f7e68329c59aa3f44bb4967f404b5319dbe4 | |
| parent | cac075a1221f373053196dbb24bdcff4609b8241 (diff) | |
| download | lua-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.
Diffstat (limited to '')
| -rw-r--r-- | ljumptab.h | 2 | ||||
| -rw-r--r-- | lmathlib.c | 2 | ||||
| -rw-r--r-- | loadlib.c | 2 | ||||
| -rw-r--r-- | lobject.h | 3 | ||||
| -rw-r--r-- | lopcodes.c | 2 | ||||
| -rw-r--r-- | lopcodes.h | 20 | ||||
| -rw-r--r-- | lopnames.h | 3 | ||||
| -rw-r--r-- | loslib.c | 2 | ||||
| -rw-r--r-- | lprefix.h | 2 | ||||
| -rw-r--r-- | ltable.h | 2 | ||||
| -rw-r--r-- | lvm.h | 4 | ||||
| -rw-r--r-- | manual/manual.of | 2 |
12 files changed, 22 insertions, 24 deletions
| @@ -16,7 +16,7 @@ | |||
| 16 | #define vmbreak vmfetch(); vmdispatch(GET_OPCODE(i)); | 16 | #define vmbreak vmfetch(); vmdispatch(GET_OPCODE(i)); |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | static void *disptab[NUM_OPCODES] = { | 19 | static 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: |
| @@ -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))) |
| @@ -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 |
| @@ -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 | */ |
| 362 | typedef struct TString { | 361 | typedef struct TString { |
| 363 | CommonHeader; | 362 | CommonHeader; |
| @@ -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 | ||
| @@ -201,9 +201,9 @@ OP_MOVE,/* A B R[A] := R[B] */ | |||
| 201 | OP_LOADI,/* A sBx R[A] := sBx */ | 201 | OP_LOADI,/* A sBx R[A] := sBx */ |
| 202 | OP_LOADF,/* A sBx R[A] := (lua_Number)sBx */ | 202 | OP_LOADF,/* A sBx R[A] := (lua_Number)sBx */ |
| 203 | OP_LOADK,/* A Bx R[A] := K[Bx] */ | 203 | OP_LOADK,/* A Bx R[A] := K[Bx] */ |
| 204 | OP_LOADKX,/* A R[A] := K[extra arg] */ | 204 | OP_LOADKX,/* A R[A] := K[extra arg] */ |
| 205 | OP_LOADFALSE,/* A R[A] := false */ | 205 | OP_LOADFALSE,/* A R[A] := false */ |
| 206 | OP_LFALSESKIP,/*A R[A] := false; pc++ */ | 206 | OP_LFALSESKIP,/*A R[A] := false; pc++ */ |
| 207 | OP_LOADTRUE,/* A R[A] := true */ | 207 | OP_LOADTRUE,/* A R[A] := true */ |
| 208 | OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */ | 208 | OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */ |
| 209 | OP_GETUPVAL,/* A B R[A] := UpValue[B] */ | 209 | OP_GETUPVAL,/* A B R[A] := UpValue[B] */ |
| @@ -263,11 +263,11 @@ OP_BNOT,/* A B R[A] := ~R[B] */ | |||
| 263 | OP_NOT,/* A B R[A] := not R[B] */ | 263 | OP_NOT,/* A B R[A] := not R[B] */ |
| 264 | OP_LEN,/* A B R[A] := length of R[B] */ | 264 | OP_LEN,/* A B R[A] := length of R[B] */ |
| 265 | 265 | ||
| 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] */ |
| 267 | 267 | ||
| 268 | OP_CLOSE,/* A close all upvalues >= R[A] */ | 268 | OP_CLOSE,/* A close all upvalues >= R[A] */ |
| 269 | OP_TBC,/* A mark variable A "to be closed" */ | 269 | OP_TBC,/* A mark variable A "to be closed" */ |
| 270 | OP_JMP,/* sJ pc += sJ */ | 270 | OP_JMP,/* sJ pc += sJ */ |
| 271 | OP_EQ,/* A B k if ((R[A] == R[B]) ~= k) then pc++ */ | 271 | OP_EQ,/* A B k if ((R[A] == R[B]) ~= k) then pc++ */ |
| 272 | OP_LT,/* A B k if ((R[A] < R[B]) ~= k) then pc++ */ | 272 | OP_LT,/* A B k if ((R[A] < R[B]) ~= k) then pc++ */ |
| 273 | OP_LE,/* A B k if ((R[A] <= R[B]) ~= k) then pc++ */ | 273 | 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++ */ | |||
| 279 | OP_GTI,/* A sB k if ((R[A] > sB) ~= k) then pc++ */ | 279 | OP_GTI,/* A sB k if ((R[A] > sB) ~= k) then pc++ */ |
| 280 | OP_GEI,/* A sB k if ((R[A] >= sB) ~= k) then pc++ */ | 280 | OP_GEI,/* A sB k if ((R[A] >= sB) ~= k) then pc++ */ |
| 281 | 281 | ||
| 282 | OP_TEST,/* A k if (not R[A] == k) then pc++ */ | 282 | OP_TEST,/* A k if (not R[A] == k) then pc++ */ |
| 283 | OP_TESTSET,/* A B k if (not R[B] == k) then pc++ else R[A] := R[B] */ | 283 | OP_TESTSET,/* A B k if (not R[B] == k) then pc++ else R[A] := R[B] */ |
| 284 | 284 | ||
| 285 | OP_CALL,/* A B C R[A], ... ,R[A+C-2] := R[A](R[A+1], ... ,R[A+B-1]) */ | 285 | OP_CALL,/* A B C R[A], ... ,R[A+C-2] := R[A](R[A+1], ... ,R[A+B-1]) */ |
| 286 | OP_TAILCALL,/* A B C k return R[A](R[A+1], ... ,R[A+B-1]) */ | 286 | OP_TAILCALL,/* A B C k return R[A](R[A+1], ... ,R[A+B-1]) */ |
| 287 | 287 | ||
| 288 | OP_RETURN,/* A B C k return R[A], ... ,R[A+B-2] (see note) */ | 288 | OP_RETURN,/* A B C k return R[A], ... ,R[A+B-2] (see note) */ |
| 289 | OP_RETURN0,/* return */ | 289 | OP_RETURN0,/* return */ |
| 290 | OP_RETURN1,/* A return R[A] */ | 290 | OP_RETURN1,/* A return R[A] */ |
| 291 | 291 | ||
| 292 | OP_FORLOOP,/* A Bx update counters; if loop continues then pc-=Bx; */ | 292 | OP_FORLOOP,/* A Bx update counters; if loop continues then pc-=Bx; */ |
| 293 | OP_FORPREP,/* A Bx <check values and prepare counters>; | 293 | 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 */ | |||
| 301 | 301 | ||
| 302 | OP_CLOSURE,/* A Bx R[A] := closure(KPROTO[Bx]) */ | 302 | OP_CLOSURE,/* A Bx R[A] := closure(KPROTO[Bx]) */ |
| 303 | 303 | ||
| 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 */ |
| 305 | 305 | ||
| 306 | OP_VARARGPREP,/*A (adjust vararg parameters) */ | 306 | OP_VARARGPREP,/*A (adjust vararg parameters) */ |
| 307 | 307 | ||
| 308 | OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ | 308 | OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ |
| 309 | } OpCode; | 309 | } OpCode; |
| @@ -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 | ||
| 12 | static const char *const opnames[] = { | 15 | static const char *const opnames[] = { |
| @@ -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 | ||
| @@ -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 */ |
| @@ -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 | ||
| 33 | LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); | 33 | LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); |
| @@ -41,9 +41,9 @@ | |||
| 41 | ** Rounding modes for float->integer coercion | 41 | ** Rounding modes for float->integer coercion |
| 42 | */ | 42 | */ |
| 43 | typedef enum { | 43 | typedef 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. | |||
| 9013 | Literal decimal integer constants that overflow are read as floats, | 9013 | Literal decimal integer constants that overflow are read as floats, |
| 9014 | instead of wrapping around. | 9014 | instead of wrapping around. |
| 9015 | You can use hexadecimal notation for such constants if you | 9015 | You can use hexadecimal notation for such constants if you |
| 9016 | want the old bevhavior | 9016 | want the old behavior |
| 9017 | (reading them as integers with wrap around). | 9017 | (reading them as integers with wrap around). |
| 9018 | } | 9018 | } |
| 9019 | 9019 | ||
