aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lcode.c b/lcode.c
index 3b228ff4..306661c3 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 1.51 2000/09/29 12:42:13 roberto Exp roberto $ 2** $Id: lcode.c,v 1.52 2000/11/30 18:50:47 roberto Exp roberto $
3** Code generator for Lua 3** Code generator for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -99,7 +99,7 @@ void luaK_kstr (LexState *ls, int c) {
99} 99}
100 100
101 101
102static int number_constant (FuncState *fs, Number r) { 102static int number_constant (FuncState *fs, lua_Number r) {
103 /* check whether `r' has appeared within the last LOOKBACKNUMS entries */ 103 /* check whether `r' has appeared within the last LOOKBACKNUMS entries */
104 Proto *f = fs->f; 104 Proto *f = fs->f;
105 int c = f->nknum; 105 int c = f->nknum;
@@ -107,7 +107,7 @@ static int number_constant (FuncState *fs, Number r) {
107 while (--c >= lim) 107 while (--c >= lim)
108 if (f->knum[c] == r) return c; 108 if (f->knum[c] == r) return c;
109 /* not found; create a new entry */ 109 /* not found; create a new entry */
110 luaM_growvector(fs->L, f->knum, f->nknum, 1, Number, 110 luaM_growvector(fs->L, f->knum, f->nknum, 1, lua_Number,
111 "constant table overflow", MAXARG_U); 111 "constant table overflow", MAXARG_U);
112 c = f->nknum++; 112 c = f->nknum++;
113 f->knum[c] = r; 113 f->knum[c] = r;
@@ -115,8 +115,8 @@ static int number_constant (FuncState *fs, Number r) {
115} 115}
116 116
117 117
118void luaK_number (FuncState *fs, Number f) { 118void luaK_number (FuncState *fs, lua_Number f) {
119 if (f <= (Number)MAXARG_S && (Number)(int)f == f) 119 if (f <= (lua_Number)MAXARG_S && (lua_Number)(int)f == f)
120 luaK_code1(fs, OP_PUSHINT, (int)f); /* f has a short integer value */ 120 luaK_code1(fs, OP_PUSHINT, (int)f); /* f has a short integer value */
121 else 121 else
122 luaK_code1(fs, OP_PUSHNUM, number_constant(fs, f)); 122 luaK_code1(fs, OP_PUSHNUM, number_constant(fs, f));