From 21cff3015a325e2f965d762de5c733f0cf8525cd Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 15 Dec 1998 12:59:43 -0200 Subject: details (for regularity) --- lundump.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'lundump.c') diff --git a/lundump.c b/lundump.c index ed4bd19c..4af102b5 100644 --- a/lundump.c +++ b/lundump.c @@ -1,5 +1,5 @@ /* -** $Id: lundump.c,v 1.10 1998/06/25 15:50:09 lhf Exp $ +** $Id: lundump.c,v 1.4 1998/06/25 16:48:44 roberto Exp roberto $ ** load bytecodes from files ** See Copyright Notice in lua.h */ @@ -20,32 +20,32 @@ #define doLoadNumber(f,Z) f=LoadNumber(Z) #endif -static void unexpectedEOZ(ZIO* Z) +static void unexpectedEOZ (ZIO* Z) { luaL_verror("unexpected end of file in %s",zname(Z)); } -static int ezgetc(ZIO* Z) +static int ezgetc (ZIO* Z) { int c=zgetc(Z); if (c==EOZ) unexpectedEOZ(Z); return c; } -static void ezread(ZIO* Z, void* b, int n) +static void ezread (ZIO* Z, void* b, int n) { int r=zread(Z,b,n); if (r!=0) unexpectedEOZ(Z); } -static unsigned int LoadWord(ZIO* Z) +static unsigned int LoadWord (ZIO* Z) { unsigned int hi=ezgetc(Z); unsigned int lo=ezgetc(Z); return (hi<<8)|lo; } -static unsigned long LoadLong(ZIO* Z) +static unsigned long LoadLong (ZIO* Z) { unsigned long hi=LoadWord(Z); unsigned long lo=LoadWord(Z); @@ -55,7 +55,7 @@ static unsigned long LoadLong(ZIO* Z) #if ID_NUMBER==ID_REAL4 /* LUA_NUMBER */ /* assumes sizeof(long)==4 and sizeof(float)==4 (IEEE) */ -static float LoadFloat(ZIO* Z) +static float LoadFloat (ZIO* Z) { unsigned long l=LoadLong(Z); float f=*(float*)&l; @@ -66,7 +66,7 @@ static float LoadFloat(ZIO* Z) #if ID_NUMBER==ID_REAL8 /* LUA_NUMBER */ /* assumes sizeof(long)==4 and sizeof(double)==8 (IEEE) */ -static double LoadDouble(ZIO* Z) +static double LoadDouble (ZIO* Z) { unsigned long l[2]; double f; @@ -86,7 +86,7 @@ static double LoadDouble(ZIO* Z) } #endif -static Byte* LoadCode(ZIO* Z) +static Byte* LoadCode (ZIO* Z) { unsigned long size=LoadLong(Z); unsigned int s=size; @@ -97,7 +97,7 @@ static Byte* LoadCode(ZIO* Z) return b; } -static TaggedString* LoadTString(ZIO* Z) +static TaggedString* LoadTString (ZIO* Z) { int size=LoadWord(Z); if (size==0) @@ -110,7 +110,7 @@ static TaggedString* LoadTString(ZIO* Z) } } -static void LoadLocals(TProtoFunc* tf, ZIO* Z) +static void LoadLocals (TProtoFunc* tf, ZIO* Z) { int i,n=LoadWord(Z); if (n==0) return; @@ -124,9 +124,9 @@ static void LoadLocals(TProtoFunc* tf, ZIO* Z) tf->locvars[i].varname=NULL; } -static TProtoFunc* LoadFunction(ZIO* Z); +static TProtoFunc* LoadFunction (ZIO* Z); -static void LoadConstants(TProtoFunc* tf, ZIO* Z) +static void LoadConstants (TProtoFunc* tf, ZIO* Z) { int i,n=LoadWord(Z); tf->nconsts=n; @@ -157,7 +157,7 @@ static void LoadConstants(TProtoFunc* tf, ZIO* Z) } } -static TProtoFunc* LoadFunction(ZIO* Z) +static TProtoFunc* LoadFunction (ZIO* Z) { TProtoFunc* tf=luaF_newproto(); tf->lineDefined=LoadWord(Z); @@ -168,7 +168,7 @@ static TProtoFunc* LoadFunction(ZIO* Z) return tf; } -static void LoadSignature(ZIO* Z) +static void LoadSignature (ZIO* Z) { char* s=SIGNATURE; while (*s!=0 && ezgetc(Z)==*s) @@ -176,7 +176,7 @@ static void LoadSignature(ZIO* Z) if (*s!=0) luaL_verror("bad signature in %s",zname(Z)); } -static void LoadHeader(ZIO* Z) +static void LoadHeader (ZIO* Z) { int version,id,sizeofR; real f=-TEST_NUMBER,tf=TEST_NUMBER; @@ -205,7 +205,7 @@ static void LoadHeader(ZIO* Z) zname(Z),(double)f,(double)tf); } -static TProtoFunc* LoadChunk(ZIO* Z) +static TProtoFunc* LoadChunk (ZIO* Z) { LoadHeader(Z); return LoadFunction(Z); @@ -215,7 +215,7 @@ static TProtoFunc* LoadChunk(ZIO* Z) ** load one chunk from a file or buffer ** return main if ok and NULL at EOF */ -TProtoFunc* luaU_undump1(ZIO* Z) +TProtoFunc* luaU_undump1 (ZIO* Z) { int c=zgetc(Z); if (c==ID_CHUNK) -- cgit v1.2.3-55-g6feb