Adjustment in useless parameter L in macros luai_num*

This commit is contained in:
Roberto I
2026-03-15 15:14:14 -03:00
parent 377cbea61b
commit 51269bd783
2 changed files with 9 additions and 9 deletions

View File

@@ -234,12 +234,12 @@ typedef unsigned long l_uint32;
/* floor division (defined as 'floor(a/b)') */ /* floor division (defined as 'floor(a/b)') */
#if !defined(luai_numidiv) #if !defined(luai_numidiv)
#define luai_numidiv(L,a,b) ((void)L, l_floor(luai_numdiv(L,a,b))) #define luai_numidiv(L,a,b) l_floor(luai_numdiv(L,a,b))
#endif #endif
/* float division */ /* float division */
#if !defined(luai_numdiv) #if !defined(luai_numdiv)
#define luai_numdiv(L,a,b) ((a)/(b)) #define luai_numdiv(L,a,b) ((void)L, (a)/(b))
#endif #endif
/* /*
@@ -267,10 +267,10 @@ typedef unsigned long l_uint32;
/* the others are quite standard operations */ /* the others are quite standard operations */
#if !defined(luai_numadd) #if !defined(luai_numadd)
#define luai_numadd(L,a,b) ((a)+(b)) #define luai_numadd(L,a,b) ((void)L, (a)+(b))
#define luai_numsub(L,a,b) ((a)-(b)) #define luai_numsub(L,a,b) ((void)L, (a)-(b))
#define luai_nummul(L,a,b) ((a)*(b)) #define luai_nummul(L,a,b) ((void)L, (a)*(b))
#define luai_numunm(L,a) (-(a)) #define luai_numunm(L,a) ((void)L, -(a))
#define luai_numeq(a,b) ((a)==(b)) #define luai_numeq(a,b) ((a)==(b))
#define luai_numlt(a,b) ((a)<(b)) #define luai_numlt(a,b) ((a)<(b))
#define luai_numle(a,b) ((a)<=(b)) #define luai_numle(a,b) ((a)<=(b))

6
lvm.c
View File

@@ -268,9 +268,9 @@ static int forprep (lua_State *L, StkId ra) {
/* /*
** Execute a step of a float numerical for loop, returning ** Execute a step of a float numerical for loop, returning
** true iff the loop must continue. (The integer case is ** true iff the loop must continue. (The integer case is
** written online with opcode OP_FORLOOP, for performance.) ** written inline with opcode OP_FORLOOP, for performance.)
*/ */
static int floatforloop (StkId ra) { static int floatforloop (lua_State *L, StkId ra) {
lua_Number step = fltvalue(s2v(ra + 1)); lua_Number step = fltvalue(s2v(ra + 1));
lua_Number limit = fltvalue(s2v(ra)); lua_Number limit = fltvalue(s2v(ra));
lua_Number idx = fltvalue(s2v(ra + 2)); /* control variable */ lua_Number idx = fltvalue(s2v(ra + 2)); /* control variable */
@@ -1841,7 +1841,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
pc -= GETARG_Bx(i); /* jump back */ pc -= GETARG_Bx(i); /* jump back */
} }
} }
else if (floatforloop(ra)) /* float loop */ else if (floatforloop(L, ra)) /* float loop */
pc -= GETARG_Bx(i); /* jump back */ pc -= GETARG_Bx(i); /* jump back */
updatetrap(ci); /* allows a signal to break the loop */ updatetrap(ci); /* allows a signal to break the loop */
vmbreak; vmbreak;