mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
always use macros to operate on lua_Numbers
This commit is contained in:
parent
a30c66f0fc
commit
4ba0cb4580
1 changed files with 2 additions and 2 deletions
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…
Add table
Add a link
Reference in a new issue