Skip to content

Commit 51269bd

Browse files
committed
Adjustment in useless parameter L in macros luai_num*
1 parent 377cbea commit 51269bd

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

llimits.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,12 @@ typedef unsigned long l_uint32;
234234

235235
/* floor division (defined as 'floor(a/b)') */
236236
#if !defined(luai_numidiv)
237-
#define luai_numidiv(L,a,b) ((void)L, l_floor(luai_numdiv(L,a,b)))
237+
#define luai_numidiv(L,a,b) l_floor(luai_numdiv(L,a,b))
238238
#endif
239239

240240
/* float division */
241241
#if !defined(luai_numdiv)
242-
#define luai_numdiv(L,a,b) ((a)/(b))
242+
#define luai_numdiv(L,a,b) ((void)L, (a)/(b))
243243
#endif
244244

245245
/*
@@ -267,10 +267,10 @@ typedef unsigned long l_uint32;
267267

268268
/* the others are quite standard operations */
269269
#if !defined(luai_numadd)
270-
#define luai_numadd(L,a,b) ((a)+(b))
271-
#define luai_numsub(L,a,b) ((a)-(b))
272-
#define luai_nummul(L,a,b) ((a)*(b))
273-
#define luai_numunm(L,a) (-(a))
270+
#define luai_numadd(L,a,b) ((void)L, (a)+(b))
271+
#define luai_numsub(L,a,b) ((void)L, (a)-(b))
272+
#define luai_nummul(L,a,b) ((void)L, (a)*(b))
273+
#define luai_numunm(L,a) ((void)L, -(a))
274274
#define luai_numeq(a,b) ((a)==(b))
275275
#define luai_numlt(a,b) ((a)<(b))
276276
#define luai_numle(a,b) ((a)<=(b))

lvm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ static int forprep (lua_State *L, StkId ra) {
268268
/*
269269
** Execute a step of a float numerical for loop, returning
270270
** true iff the loop must continue. (The integer case is
271-
** written online with opcode OP_FORLOOP, for performance.)
271+
** written inline with opcode OP_FORLOOP, for performance.)
272272
*/
273-
static int floatforloop (StkId ra) {
273+
static int floatforloop (lua_State *L, StkId ra) {
274274
lua_Number step = fltvalue(s2v(ra + 1));
275275
lua_Number limit = fltvalue(s2v(ra));
276276
lua_Number idx = fltvalue(s2v(ra + 2)); /* control variable */
@@ -1841,7 +1841,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
18411841
pc -= GETARG_Bx(i); /* jump back */
18421842
}
18431843
}
1844-
else if (floatforloop(ra)) /* float loop */
1844+
else if (floatforloop(L, ra)) /* float loop */
18451845
pc -= GETARG_Bx(i); /* jump back */
18461846
updatetrap(ci); /* allows a signal to break the loop */
18471847
vmbreak;

0 commit comments

Comments
 (0)