diff options
Diffstat (limited to 'lzio.c')
-rw-r--r-- | lzio.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lzio.c,v 1.10 2000/02/08 16:39:42 roberto Exp roberto $ | 2 | ** $Id: lzio.c,v 1.11 2000/03/03 14:58:26 roberto Exp roberto $ |
3 | ** a generic input stream interface | 3 | ** a generic input stream interface |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -21,7 +21,7 @@ static int zmfilbuf (ZIO* z) { | |||
21 | } | 21 | } |
22 | 22 | ||
23 | 23 | ||
24 | ZIO* zmopen (ZIO* z, const char* b, int size, const char *name) { | 24 | ZIO* zmopen (ZIO* z, const char* b, size_t size, const char *name) { |
25 | if (b==NULL) return NULL; | 25 | if (b==NULL) return NULL; |
26 | z->n = size; | 26 | z->n = size; |
27 | z->p = (const unsigned char *)b; | 27 | z->p = (const unsigned char *)b; |
@@ -41,7 +41,7 @@ ZIO* zsopen (ZIO* z, const char* s, const char *name) { | |||
41 | /* -------------------------------------------------------------- FILEs --- */ | 41 | /* -------------------------------------------------------------- FILEs --- */ |
42 | 42 | ||
43 | static int zffilbuf (ZIO* z) { | 43 | static int zffilbuf (ZIO* z) { |
44 | int n; | 44 | size_t n; |
45 | if (feof((FILE *)z->u)) return EOZ; | 45 | if (feof((FILE *)z->u)) return EOZ; |
46 | n = fread(z->buffer, 1, ZBSIZE, (FILE *)z->u); | 46 | n = fread(z->buffer, 1, ZBSIZE, (FILE *)z->u); |
47 | if (n==0) return EOZ; | 47 | if (n==0) return EOZ; |
@@ -63,9 +63,9 @@ ZIO* zFopen (ZIO* z, FILE* f, const char *name) { | |||
63 | 63 | ||
64 | 64 | ||
65 | /* --------------------------------------------------------------- read --- */ | 65 | /* --------------------------------------------------------------- read --- */ |
66 | int zread (ZIO *z, void *b, int n) { | 66 | size_t zread (ZIO *z, void *b, size_t n) { |
67 | while (n) { | 67 | while (n) { |
68 | int m; | 68 | size_t m; |
69 | if (z->n == 0) { | 69 | if (z->n == 0) { |
70 | if (z->filbuf(z) == EOZ) | 70 | if (z->filbuf(z) == EOZ) |
71 | return n; /* return number of missing bytes */ | 71 | return n; /* return number of missing bytes */ |