aboutsummaryrefslogtreecommitdiff
path: root/lundump.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-04-10 14:39:41 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-04-10 14:39:41 -0300
commit762c7370376dbd13cd8aeb4d8c8da0bb153269c3 (patch)
tree6170a2d6bc5d2a7cd4f15cf180dd17d89bf36554 /lundump.c
parentde57dc2653ff9efcdfd1ddc5f21aaaa159e5f79a (diff)
downloadlua-762c7370376dbd13cd8aeb4d8c8da0bb153269c3.tar.gz
lua-762c7370376dbd13cd8aeb4d8c8da0bb153269c3.tar.bz2
lua-762c7370376dbd13cd8aeb4d8c8da0bb153269c3.zip
last changes by lhfv5.0
Diffstat (limited to 'lundump.c')
-rw-r--r--lundump.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lundump.c b/lundump.c
index a35d2e9c..151a8507 100644
--- a/lundump.c
+++ b/lundump.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lundump.c,v 1.59 2003/01/27 15:52:57 roberto Exp roberto $ 2** $Id: lundump.c,v 1.49 2003/04/07 20:34:20 lhf Exp $
3** load pre-compiled Lua chunks 3** load pre-compiled Lua chunks
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -104,7 +104,7 @@ static TString* LoadString (LoadState* S)
104 { 104 {
105 char* s=luaZ_openspace(S->L,S->b,size); 105 char* s=luaZ_openspace(S->L,S->b,size);
106 ezread(S,s,size); 106 ezread(S,s,size);
107 return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */ 107 return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */
108 } 108 }
109} 109}
110 110
@@ -146,7 +146,7 @@ static void LoadUpvalues (LoadState* S, Proto* f)
146 luaG_runerror(S->L,"bad nupvalues in %s: read %d; expected %d", 146 luaG_runerror(S->L,"bad nupvalues in %s: read %d; expected %d",
147 S->name,n,f->nups); 147 S->name,n,f->nups);
148 f->upvalues=luaM_newvector(S->L,n,TString*); 148 f->upvalues=luaM_newvector(S->L,n,TString*);
149 f->sizeupvalues = n; 149 f->sizeupvalues=n;
150 for (i=0; i<n; i++) f->upvalues[i]=LoadString(S); 150 for (i=0; i<n; i++) f->upvalues[i]=LoadString(S);
151} 151}
152 152
@@ -226,14 +226,14 @@ static void TestSize (LoadState* S, int s, const char* what)
226static void LoadHeader (LoadState* S) 226static void LoadHeader (LoadState* S)
227{ 227{
228 int version; 228 int version;
229 lua_Number x=0,tx=TEST_NUMBER; 229 lua_Number x,tx=TEST_NUMBER;
230 LoadSignature(S); 230 LoadSignature(S);
231 version=LoadByte(S); 231 version=LoadByte(S);
232 if (version>VERSION) 232 if (version>VERSION)
233 luaG_runerror(S->L,"%s too new: " 233 luaG_runerror(S->L,"%s too new: "
234 "read version %d.%d; expected at most %d.%d", 234 "read version %d.%d; expected at most %d.%d",
235 S->name,V(version),V(VERSION)); 235 S->name,V(version),V(VERSION));
236 if (version<VERSION0) /* check last major change */ 236 if (version<VERSION0) /* check last major change */
237 luaG_runerror(S->L,"%s too old: " 237 luaG_runerror(S->L,"%s too old: "
238 "read version %d.%d; expected at least %d.%d", 238 "read version %d.%d; expected at least %d.%d",
239 S->name,V(version),V(VERSION0)); 239 S->name,V(version),V(VERSION0));