Fixed a warning and other minor issues

Fixed some minor issues from the feedback for 5.4-beta rc1.
This commit is contained in:
Roberto Ierusalimschy 2019-10-04 16:17:04 -03:00
parent b98d41db99
commit 7bd1e53753
6 changed files with 9 additions and 8 deletions

View File

@ -1650,8 +1650,8 @@ void luaK_posfix (FuncState *fs, BinOpr opr,
case OPR_SUB: { case OPR_SUB: {
if (finishbinexpneg(fs, e1, e2, OP_ADDI, line, TM_SUB)) if (finishbinexpneg(fs, e1, e2, OP_ADDI, line, TM_SUB))
break; /* coded as (r1 + -I) */ break; /* coded as (r1 + -I) */
/* ELSE *//* FALLTHROUGH */ /* ELSE */
} } /* FALLTHROUGH */
case OPR_DIV: case OPR_IDIV: case OPR_MOD: case OPR_POW: { case OPR_DIV: case OPR_IDIV: case OPR_MOD: case OPR_POW: {
codearith(fs, opr, e1, e2, 0, line); codearith(fs, opr, e1, e2, 0, line);
break; break;

View File

@ -116,7 +116,8 @@ static int luaB_yield (lua_State *L) {
#define COS_NORM 3 #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) { static int auxstatus (lua_State *L, lua_State *co) {

View File

@ -24,7 +24,7 @@
** The hook table at registry[HOOKKEY] maps threads to their current ** The hook table at registry[HOOKKEY] maps threads to their current
** hook function. ** hook function.
*/ */
static const char* HOOKKEY = "_HOOKKEY"; static const char *const HOOKKEY = "_HOOKKEY";
/* /*

2
lgc.c
View File

@ -998,7 +998,7 @@ static void sweep2old (lua_State *L, GCObject **p) {
*/ */
static GCObject **sweepgen (lua_State *L, global_State *g, GCObject **p, static GCObject **sweepgen (lua_State *L, global_State *g, GCObject **p,
GCObject *limit) { GCObject *limit) {
static lu_byte nextage[] = { static const lu_byte nextage[] = {
G_SURVIVAL, /* from G_NEW */ G_SURVIVAL, /* from G_NEW */
G_OLD1, /* from G_SURVIVAL */ G_OLD1, /* from G_SURVIVAL */
G_OLD1, /* from G_OLD0 */ G_OLD1, /* from G_OLD0 */

View File

@ -59,7 +59,7 @@
** key for table in the registry that keeps handles ** key for table in the registry that keeps handles
** for all loaded C libraries ** for all loaded C libraries
*/ */
static const char *CLIBS = "_CLIBS"; static const char *const CLIBS = "_CLIBS";
#define LIB_FAIL "open" #define LIB_FAIL "open"

View File

@ -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) { static void forbody (LexState *ls, int base, int line, int nvars, int isgen) {
/* forbody -> DO block */ /* forbody -> DO block */
static OpCode forprep[2] = {OP_FORPREP, OP_TFORPREP}; static const OpCode forprep[2] = {OP_FORPREP, OP_TFORPREP};
static OpCode forloop[2] = {OP_FORLOOP, OP_TFORLOOP}; static const OpCode forloop[2] = {OP_FORLOOP, OP_TFORLOOP};
BlockCnt bl; BlockCnt bl;
FuncState *fs = ls->fs; FuncState *fs = ls->fs;
int prep, endfor; int prep, endfor;