diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-03-07 16:30:16 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-03-07 16:30:16 -0300 |
| commit | 4ba0cb4580969a42748e2f4f617ab16fdcb1d7ca (patch) | |
| tree | c7e00d6702cd9831e40e791eb9aa7551c69c095f | |
| parent | a30c66f0fc17bf733c2289a0d7a76930dac80f47 (diff) | |
| download | lua-4ba0cb4580969a42748e2f4f617ab16fdcb1d7ca.tar.gz lua-4ba0cb4580969a42748e2f4f617ab16fdcb1d7ca.tar.bz2 lua-4ba0cb4580969a42748e2f4f617ab16fdcb1d7ca.zip | |
always use macros to operate on lua_Numbers
| -rw-r--r-- | lvm.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.c,v 2.235 2015/02/20 14:27:53 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.236 2015/03/02 16:04:52 roberto Exp roberto $ |
| 3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -127,7 +127,7 @@ static int forlimit (const TValue *obj, lua_Integer *p, lua_Integer step, | |||
| 127 | lua_Number n; /* try to convert to float */ | 127 | lua_Number n; /* try to convert to float */ |
| 128 | if (!tonumber(obj, &n)) /* cannot convert to float? */ | 128 | if (!tonumber(obj, &n)) /* cannot convert to float? */ |
| 129 | return 0; /* not a number */ | 129 | return 0; /* not a number */ |
| 130 | if (n > 0) { /* if true, float is larger than max integer */ | 130 | if (luai_numlt(0, n)) { /* if true, float is larger than max integer */ |
| 131 | *p = LUA_MAXINTEGER; | 131 | *p = LUA_MAXINTEGER; |
| 132 | if (step < 0) *stopnow = 1; | 132 | if (step < 0) *stopnow = 1; |
| 133 | } | 133 | } |
