aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-10-04 16:17:04 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-10-04 16:17:04 -0300
commit7bd1e53753de7176eb0b23f2bf19ad2235dec826 (patch)
tree6b8be4dcec4e71ccf6e85f3bfa95a7bfd544714f
parentb98d41db99969f6336c32cb67274093b9a548d39 (diff)
downloadlua-7bd1e53753de7176eb0b23f2bf19ad2235dec826.tar.gz
lua-7bd1e53753de7176eb0b23f2bf19ad2235dec826.tar.bz2
lua-7bd1e53753de7176eb0b23f2bf19ad2235dec826.zip
Fixed a warning and other minor issues
Fixed some minor issues from the feedback for 5.4-beta rc1.
-rw-r--r--lcode.c4
-rw-r--r--lcorolib.c3
-rw-r--r--ldblib.c2
-rw-r--r--lgc.c2
-rw-r--r--loadlib.c2
-rw-r--r--lparser.c4
6 files changed, 9 insertions, 8 deletions
diff --git a/lcode.c b/lcode.c
index abb8a811..3e4c5b49 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1650,8 +1650,8 @@ void luaK_posfix (FuncState *fs, BinOpr opr,
1650 case OPR_SUB: { 1650 case OPR_SUB: {
1651 if (finishbinexpneg(fs, e1, e2, OP_ADDI, line, TM_SUB)) 1651 if (finishbinexpneg(fs, e1, e2, OP_ADDI, line, TM_SUB))
1652 break; /* coded as (r1 + -I) */ 1652 break; /* coded as (r1 + -I) */
1653 /* ELSE *//* FALLTHROUGH */ 1653 /* ELSE */
1654 } 1654 } /* FALLTHROUGH */
1655 case OPR_DIV: case OPR_IDIV: case OPR_MOD: case OPR_POW: { 1655 case OPR_DIV: case OPR_IDIV: case OPR_MOD: case OPR_POW: {
1656 codearith(fs, opr, e1, e2, 0, line); 1656 codearith(fs, opr, e1, e2, 0, line);
1657 break; 1657 break;
diff --git a/lcorolib.c b/lcorolib.c
index 4d47ea28..7d6e585b 100644
--- a/lcorolib.c
+++ b/lcorolib.c
@@ -116,7 +116,8 @@ static int luaB_yield (lua_State *L) {
116#define COS_NORM 3 116#define COS_NORM 3
117 117
118 118
119static const char *statname[] = {"running", "dead", "suspended", "normal"}; 119static const char *const statname[] =
120 {"running", "dead", "suspended", "normal"};
120 121
121 122
122static int auxstatus (lua_State *L, lua_State *co) { 123static int auxstatus (lua_State *L, lua_State *co) {
diff --git a/ldblib.c b/ldblib.c
index a9a84c50..77018986 100644
--- a/ldblib.c
+++ b/ldblib.c
@@ -24,7 +24,7 @@
24** The hook table at registry[HOOKKEY] maps threads to their current 24** The hook table at registry[HOOKKEY] maps threads to their current
25** hook function. 25** hook function.
26*/ 26*/
27static const char* HOOKKEY = "_HOOKKEY"; 27static const char *const HOOKKEY = "_HOOKKEY";
28 28
29 29
30/* 30/*
diff --git a/lgc.c b/lgc.c
index f24074f9..cf62a45c 100644
--- a/lgc.c
+++ b/lgc.c
@@ -998,7 +998,7 @@ static void sweep2old (lua_State *L, GCObject **p) {
998*/ 998*/
999static GCObject **sweepgen (lua_State *L, global_State *g, GCObject **p, 999static GCObject **sweepgen (lua_State *L, global_State *g, GCObject **p,
1000 GCObject *limit) { 1000 GCObject *limit) {
1001 static lu_byte nextage[] = { 1001 static const lu_byte nextage[] = {
1002 G_SURVIVAL, /* from G_NEW */ 1002 G_SURVIVAL, /* from G_NEW */
1003 G_OLD1, /* from G_SURVIVAL */ 1003 G_OLD1, /* from G_SURVIVAL */
1004 G_OLD1, /* from G_OLD0 */ 1004 G_OLD1, /* from G_OLD0 */
diff --git a/loadlib.c b/loadlib.c
index d7a3fb23..689767f3 100644
--- a/loadlib.c
+++ b/loadlib.c
@@ -59,7 +59,7 @@
59** key for table in the registry that keeps handles 59** key for table in the registry that keeps handles
60** for all loaded C libraries 60** for all loaded C libraries
61*/ 61*/
62static const char *CLIBS = "_CLIBS"; 62static const char *const CLIBS = "_CLIBS";
63 63
64#define LIB_FAIL "open" 64#define LIB_FAIL "open"
65 65
diff --git a/lparser.c b/lparser.c
index 2dcd320c..8c812039 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1523,8 +1523,8 @@ static void fixforjump (FuncState *fs, int pc, int dest, int back) {
1523*/ 1523*/
1524static void forbody (LexState *ls, int base, int line, int nvars, int isgen) { 1524static void forbody (LexState *ls, int base, int line, int nvars, int isgen) {
1525 /* forbody -> DO block */ 1525 /* forbody -> DO block */
1526 static OpCode forprep[2] = {OP_FORPREP, OP_TFORPREP}; 1526 static const OpCode forprep[2] = {OP_FORPREP, OP_TFORPREP};
1527 static OpCode forloop[2] = {OP_FORLOOP, OP_TFORLOOP}; 1527 static const OpCode forloop[2] = {OP_FORLOOP, OP_TFORLOOP};
1528 BlockCnt bl; 1528 BlockCnt bl;
1529 FuncState *fs = ls->fs; 1529 FuncState *fs = ls->fs;
1530 int prep, endfor; 1530 int prep, endfor;