mirror of
https://github.com/lua/lua.git
synced 2026-01-30 19:34:48 +00:00
always use macros to operate on lua_Numbers
This commit is contained in:
parent
a30c66f0fc
commit
4ba0cb4580
4
lvm.c
4
lvm.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lvm.c,v 2.235 2015/02/20 14:27:53 roberto Exp roberto $
|
||||
** $Id: lvm.c,v 2.236 2015/03/02 16:04:52 roberto Exp roberto $
|
||||
** Lua virtual machine
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -127,7 +127,7 @@ static int forlimit (const TValue *obj, lua_Integer *p, lua_Integer step,
|
||||
lua_Number n; /* try to convert to float */
|
||||
if (!tonumber(obj, &n)) /* cannot convert to float? */
|
||||
return 0; /* not a number */
|
||||
if (n > 0) { /* if true, float is larger than max integer */
|
||||
if (luai_numlt(0, n)) { /* if true, float is larger than max integer */
|
||||
*p = LUA_MAXINTEGER;
|
||||
if (step < 0) *stopnow = 1;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user