1 diff -ur lua-5.1.3-pt2/src/ldump.c lua-5.1.3-pt3/src/ldump.c
2 --- lua-5.1.3-pt2/src/ldump.c 2008-04-05 14:25:13.000000000 +0200
3 +++ lua-5.1.3-pt3/src/ldump.c 2008-04-05 14:28:27.000000000 +0200
6 if (s==NULL || getstr(s)==NULL)
14 - size_t size=s->tsv.len+1; /* include trailing '\0' */
15 + unsigned int size=s->tsv.len+1; /* include trailing '\0' */
17 DumpBlock(getstr(s),size,D);
19 diff -ur lua-5.1.3-pt2/src/lundump.c lua-5.1.3-pt3/src/lundump.c
20 --- lua-5.1.3-pt2/src/lundump.c 2008-04-05 14:25:13.000000000 +0200
21 +++ lua-5.1.3-pt3/src/lundump.c 2008-04-05 14:28:27.000000000 +0200
29 #ifdef LUAC_TRUST_BINARIES
34 -#define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size))
35 #define LoadByte(S) (lu_byte)LoadChar(S)
36 #define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x))
37 #define LoadVector(S,b,n,size) LoadMem(S,b,n,size)
39 IF (r!=0, "unexpected end");
42 +static void LoadMem (LoadState* S, void* b, int n, size_t size)
44 + LoadBlock(S,b,n*size);
56 + c=p[0]; p[0]=p[1]; p[1]=c;
63 + c=p[0]; p[0]=p[3]; p[3]=c;
64 + c=p[1]; p[1]=p[2]; p[2]=c;
71 + c=p[0]; p[0]=p[7]; p[7]=c;
72 + c=p[1]; p[1]=p[6]; p[6]=c;
73 + c=p[2]; p[2]=p[5]; p[5]=c;
74 + c=p[3]; p[3]=p[4]; p[4]=c;
85 static int LoadChar(LoadState* S)
90 static TString* LoadString(LoadState* S)
98 char s[LUAC_HEADERSIZE];
100 LoadBlock(S,s,LUAC_HEADERSIZE);
101 + S->swap=(s[6]!=h[6]); s[6]=h[6];
102 IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header");
106 *h++=(char)LUAC_FORMAT;
107 *h++=(char)*(char*)&x; /* endianness */
108 *h++=(char)sizeof(int);
109 - *h++=(char)sizeof(size_t);
110 + *h++=(char)sizeof(unsigned int);
111 *h++=(char)sizeof(Instruction);
112 *h++=(char)sizeof(lua_Number);