Showing the changes to src/lcode.c (1 of 46 files). Show all
Unified · Split
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 2 | −** $Id: lcode.c,v 2.22 2005/11/16 11:55:27 roberto Exp $ | |
| 2 | +** $Id: lcode.c,v 2.24 2005/12/22 16:19:56 roberto Exp $ | |
| 3 | 3 | ** Code generator for Lua |
| 4 | 4 | ** See Copyright Notice in lua.h |
| 5 | 5 | */ |
| @@ -196,7 +196,7 @@ void luaK_checkstack (FuncState *fs, int n) { · 190 unmodified lines | ||
| 196 | 196 | if (newstack > fs->f->maxstacksize) { |
| 197 | 197 | if (newstack >= MAXSTACK) |
| 198 | 198 | luaX_syntaxerror(fs->ls, "function or expression too complex"); |
| 199 | − fs->f->maxstacksize = cast(lu_byte, newstack); | |
| 199 | + fs->f->maxstacksize = cast_byte(newstack); | |
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | |
| @@ -227,11 +227,11 @@ static int addk (FuncState *fs, TValue *k, TValue *v) { · 24 unmodified lines | ||
| 227 | 227 | Proto *f = fs->f; |
| 228 | 228 | int oldsize = f->sizek; |
| 229 | 229 | if (ttisnumber(idx)) { |
| 230 | − lua_assert(luaO_rawequalObj(&fs->f->k[cast(int, nvalue(idx))], v)); | |
| 231 | − return cast(int, nvalue(idx)); | |
| 230 | + lua_assert(luaO_rawequalObj(&fs->f->k[cast_int(nvalue(idx))], v)); | |
| 231 | + return cast_int(nvalue(idx)); | |
| 232 | 232 | } |
| 233 | 233 | else { /* constant not found; create a new entry */ |
| 234 | − setnvalue(idx, cast(lua_Number, fs->nk)); | |
| 234 | + setnvalue(idx, cast_num(fs->nk)); | |
| 235 | 235 | luaM_growvector(L, f->k, fs->nk, f->sizek, TValue, |
| 236 | 236 | MAXARG_Bx, "constant table overflow"); |
| 237 | 237 | while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]); |
| @@ -647,7 +647,7 @@ static int constfolding (OpCode op, expdesc *e1, expdesc *e2) { · 409 unmodified lines | ||
| 647 | 647 | case OP_LEN: return 0; /* no constant folding for 'len' */ |
| 648 | 648 | default: lua_assert(0); r = 0; break; |
| 649 | 649 | } |
| 650 | − if (r != r) return 0; /* do not attempt to produce NaN */ | |
| 650 | + if (luai_numisnan(r)) return 0; /* do not attempt to produce NaN */ | |
| 651 | 651 | e1->u.nval = r; |
| 652 | 652 | return 1; |
| 653 | 653 | } |