tshut up gcc! - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit 3ca675a579e5dc06a10c199aa7b9d78eefa69642
parent 85b8545edbd1ffba5d97ad74f360d2274db63726
Author: rsc 
Date:   Thu, 20 Apr 2006 20:28:08 +0000

shut up gcc!

Diffstat:
  M src/cmd/gzip/gunzip.c               |       4 ++--
  M src/cmd/gzip/gzip.c                 |       4 ++--
  M src/cmd/gzip/unzip.c                |       6 +++---
  M src/cmd/gzip/zip.c                  |       4 ++--

4 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/cmd/gzip/gunzip.c b/src/cmd/gzip/gunzip.c
t@@ -189,7 +189,7 @@ gunzip(int ofd, char *ofile, Biobuf *bin)
                 if(!table && verbose)
                         fprint(2, "extracting %s to %s\n", h.file, ofile);
 
-                err = inflate((void*)ofd, crcwrite, bin, (int(*)(void*))Bgetc);
+                err = inflate((void*)(uintptr)ofd, crcwrite, bin, (int(*)(void*))Bgetc);
                 if(err != FlateOk)
                         error("inflate failed: %s", flateerr(err));
 
t@@ -324,7 +324,7 @@ crcwrite(void *out, void *buf, int n)
 
         wlen += n;
         crc = blockcrc(crctab, crc, buf, n);
-        fd = (int)out;
+        fd = (int)(uintptr)out;
         if(fd < 0)
                 return n;
         nw = write(fd, buf, n);
diff --git a/src/cmd/gzip/gzip.c b/src/cmd/gzip/gzip.c
t@@ -180,7 +180,7 @@ gzip(char *file, long mtime, int ifd, Biobuf *bout)
         crc = 0;
         eof = 0;
         totr = 0;
-        err = deflate(bout, gzwrite, (void*)ifd, crcread, level, debug);
+        err = deflate(bout, gzwrite, (void*)(uintptr)ifd, crcread, level, debug);
         if(err != FlateOk){
                 fprint(2, "gzip: deflate failed: %s\n", flateerr(err));
                 return 0;
t@@ -206,7 +206,7 @@ crcread(void *fd, void *buf, int n)
 
         nr = 0;
         for(; !eof && n > 0; n -= m){
-                m = read((int)fd, (char*)buf+nr, n);
+                m = read((int)(uintptr)fd, (char*)buf+nr, n);
                 if(m <= 0){
                         eof = 1;
                         if(m < 0)
diff --git a/src/cmd/gzip/unzip.c b/src/cmd/gzip/unzip.c
t@@ -441,7 +441,7 @@ unzipEntry(Biobuf *bin, ZipHead *czh)
                         error("copying data for %s failed: %r", zh.file);
         }else if(zh.meth == 8){
                 off = Boffset(bin);
-                err = inflate((void*)fd, crcwrite, bin, (int(*)(void*))Bgetc);
+                err = inflate((void*)(uintptr)fd, crcwrite, bin, (int(*)(void*))Bgetc);
                 if(err != FlateOk)
                         error("inflate failed: %s", flateerr(err));
                 rlen = Boffset(bin) - off;
t@@ -650,7 +650,7 @@ crcwrite(void *out, void *buf, int n)
 
         wlen += n;
         crc = blockcrc(crctab, crc, buf, n);
-        fd = (int)out;
+        fd = (int)(uintptr)out;
         if(fd < 0)
                 return n;
         nw = write(fd, buf, n);
t@@ -673,7 +673,7 @@ copyout(int ofd, Biobuf *bin, long len)
                 if(n <= 0)
                         return 0;
                 rlen += n;
-                if(crcwrite((void*)ofd, buf, n) != n)
+                if(crcwrite((void*)(uintptr)ofd, buf, n) != n)
                         return 0;
         }
         return 1;
diff --git a/src/cmd/gzip/zip.c b/src/cmd/gzip/zip.c
t@@ -169,7 +169,7 @@ zip(Biobuf *bout, char *file, int stdout)
                 eof = 0;
                 totr = 0;
                 totw = 0;
-                err = deflate(bout, zwrite, (void*)fd, crcread, level, debug);
+                err = deflate(bout, zwrite, (void*)(uintptr)fd, crcread, level, debug);
                 if(err != FlateOk)
                         error("deflate failed: %s: %r", flateerr(err));
 
t@@ -324,7 +324,7 @@ crcread(void *fd, void *buf, int n)
 
         nr = 0;
         for(; !eof && n > 0; n -= m){
-                m = read((int)fd, (char*)buf+nr, n);
+                m = read((int)(uintptr)fd, (char*)buf+nr, n);
                 if(m <= 0){
                         eof = 1;
                         if(m < 0)