diff options
Diffstat (limited to 'lundump.c')
-rw-r--r-- | lundump.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lundump.c,v 1.33 2000/10/31 16:57:23 lhf Exp $ | 2 | ** $Id: lundump.c,v 1.34 2000/11/07 12:44:44 roberto Exp roberto $ |
3 | ** load bytecodes from files | 3 | ** load bytecodes from files |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -82,9 +82,9 @@ static size_t LoadSize (lua_State* L, ZIO* Z, int swap) | |||
82 | return x; | 82 | return x; |
83 | } | 83 | } |
84 | 84 | ||
85 | static Number LoadNumber (lua_State* L, ZIO* Z, int swap) | 85 | static lua_Number LoadNumber (lua_State* L, ZIO* Z, int swap) |
86 | { | 86 | { |
87 | Number x; | 87 | lua_Number x; |
88 | LoadBlock(L,&x,sizeof(x),Z,swap); | 88 | LoadBlock(L,&x,sizeof(x),Z,swap); |
89 | return x; | 89 | return x; |
90 | } | 90 | } |
@@ -142,7 +142,7 @@ static void LoadConstants (lua_State* L, Proto* tf, ZIO* Z, int swap) | |||
142 | for (i=0; i<n; i++) | 142 | for (i=0; i<n; i++) |
143 | tf->kstr[i]=LoadString(L,Z,swap); | 143 | tf->kstr[i]=LoadString(L,Z,swap); |
144 | tf->nknum=n=LoadInt(L,Z,swap); | 144 | tf->nknum=n=LoadInt(L,Z,swap); |
145 | tf->knum=luaM_newvector(L,n,Number); | 145 | tf->knum=luaM_newvector(L,n,lua_Number); |
146 | LoadVector(L,tf->knum,n,sizeof(*tf->knum),Z,swap); | 146 | LoadVector(L,tf->knum,n,sizeof(*tf->knum),Z,swap); |
147 | tf->nkproto=n=LoadInt(L,Z,swap); | 147 | tf->nkproto=n=LoadInt(L,Z,swap); |
148 | tf->kproto=luaM_newvector(L,n,Proto*); | 148 | tf->kproto=luaM_newvector(L,n,Proto*); |
@@ -187,7 +187,7 @@ static void TestSize (lua_State* L, int s, const char* what, ZIO* Z) | |||
187 | static int LoadHeader (lua_State* L, ZIO* Z) | 187 | static int LoadHeader (lua_State* L, ZIO* Z) |
188 | { | 188 | { |
189 | int version,swap; | 189 | int version,swap; |
190 | Number f=0,tf=TEST_NUMBER; | 190 | lua_Number f=0,tf=TEST_NUMBER; |
191 | LoadSignature(L,Z); | 191 | LoadSignature(L,Z); |
192 | version=ezgetc(L,Z); | 192 | version=ezgetc(L,Z); |
193 | if (version>VERSION) | 193 | if (version>VERSION) |
@@ -205,7 +205,7 @@ static int LoadHeader (lua_State* L, ZIO* Z) | |||
205 | TESTSIZE(SIZE_INSTRUCTION); | 205 | TESTSIZE(SIZE_INSTRUCTION); |
206 | TESTSIZE(SIZE_OP); | 206 | TESTSIZE(SIZE_OP); |
207 | TESTSIZE(SIZE_B); | 207 | TESTSIZE(SIZE_B); |
208 | TESTSIZE(sizeof(Number)); | 208 | TESTSIZE(sizeof(lua_Number)); |
209 | f=LoadNumber(L,Z,swap); | 209 | f=LoadNumber(L,Z,swap); |
210 | if ((long)f!=(long)tf) /* disregard errors in last bit of fraction */ | 210 | if ((long)f!=(long)tf) /* disregard errors in last bit of fraction */ |
211 | luaO_verror(L,"unknown number format in `%.99s':\n" | 211 | luaO_verror(L,"unknown number format in `%.99s':\n" |