[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.4.0 (beta) now available
- From: François Perrad <francois.perrad@...>
- Date: Fri, 4 Oct 2019 18:44:22 +0200
const
diff --git a/src/lcorolib.c b/src/lcorolib.c
index 4d47ea2..a6896ad 100644
--- a/src/lcorolib.c
+++ b/src/lcorolib.c
@@ -116,7 +116,7 @@ static int luaB_yield (lua_State *L) {
#define COS_NORM 3
-static const char *statname[] = {"running", "dead", "suspended", "normal"};
+static const char *const statname[] = {"running", "dead", "suspended", "normal"};
static int auxstatus (lua_State *L, lua_State *co) {
diff --git a/src/ldblib.c b/src/ldblib.c
index a9a84c5..fc164a8 100644
--- a/src/ldblib.c
+++ b/src/ldblib.c
@@ -24,7 +24,7 @@
** The hook table at registry[HOOKKEY] maps threads to their current
** hook function.
*/
-static const char* HOOKKEY = "_HOOKKEY";
+static const char* const HOOKKEY = "_HOOKKEY";
/*
diff --git a/src/lgc.c b/src/lgc.c
index f24074f..cf62a45 100644
--- a/src/lgc.c
+++ b/src/lgc.c
@@ -998,7 +998,7 @@ static void sweep2old (lua_State *L, GCObject **p) {
*/
static GCObject **sweepgen (lua_State *L, global_State *g, GCObject **p,
GCObject *limit) {
- static lu_byte nextage[] = {
+ static const lu_byte nextage[] = {
G_SURVIVAL, /* from G_NEW */
G_OLD1, /* from G_SURVIVAL */
G_OLD1, /* from G_OLD0 */
diff --git a/src/loadlib.c b/src/loadlib.c
index d7a3fb2..689767f 100644
--- a/src/loadlib.c
+++ b/src/loadlib.c
@@ -59,7 +59,7 @@
** key for table in the registry that keeps handles
** for all loaded C libraries
*/
-static const char *CLIBS = "_CLIBS";
+static const char *const CLIBS = "_CLIBS";
#define LIB_FAIL "open"
diff --git a/src/lparser.c b/src/lparser.c
index 2dcd320..8c81203 100644
--- a/src/lparser.c
+++ b/src/lparser.c
@@ -1523,8 +1523,8 @@ static void fixforjump (FuncState *fs, int pc, int dest, int back) {
*/
static void forbody (LexState *ls, int base, int line, int nvars, int isgen) {
/* forbody -> DO block */
- static OpCode forprep[2] = {OP_FORPREP, OP_TFORPREP};
- static OpCode forloop[2] = {OP_FORLOOP, OP_TFORLOOP};
+ static const OpCode forprep[2] = {OP_FORPREP, OP_TFORPREP};
+ static const OpCode forloop[2] = {OP_FORLOOP, OP_TFORLOOP};
BlockCnt bl;
FuncState *fs = ls->fs;
int prep, endfor;
--
switch
diff --git a/src/luac.c b/src/luac.c
index c79543c..517f365 100644
--- a/src/luac.c
+++ b/src/luac.c
@@ -508,8 +508,8 @@ static void PrintCode(const Proto* f)
break;
case OP_MMBIN:
printf("%d %d %d",a,b,c);
- break;
printf(COMMENT); printf("%s ",eventname(c));
+ break;
case OP_MMBINI:
printf("%d %d %d",a,sb,c);
printf(COMMENT); printf("%s ",eventname(c));
--