Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/gzip Add a few explicit casts for sign mismatches.



details:   https://anonhg.NetBSD.org/src/rev/7c0e7b0c7d11
branches:  trunk
changeset: 766392:7c0e7b0c7d11
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Jun 21 13:25:45 2011 +0000

description:
Add a few explicit casts for sign mismatches.

diffstat:

 usr.bin/gzip/Makefile |   6 +-----
 usr.bin/gzip/gzip.c   |  27 ++++++++++++++-------------
 2 files changed, 15 insertions(+), 18 deletions(-)

diffs (126 lines):

diff -r e2d1795d1e5f -r 7c0e7b0c7d11 usr.bin/gzip/Makefile
--- a/usr.bin/gzip/Makefile     Tue Jun 21 12:41:24 2011 +0000
+++ b/usr.bin/gzip/Makefile     Tue Jun 21 13:25:45 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.15 2011/06/20 07:44:01 mrg Exp $
+#      $NetBSD: Makefile,v 1.16 2011/06/21 13:25:45 joerg Exp $
 
 USE_FORT?= yes # data-driven bugs?
 
@@ -25,7 +25,3 @@
                ${BINDIR}/zgrep ${BINDIR}/zfgrep
 
 .include <bsd.prog.mk>
-
-.if defined(HAVE_GCC) || defined(HAVE_PCC)
-COPTS.gzip.c+= -Wno-pointer-sign
-.endif
diff -r e2d1795d1e5f -r 7c0e7b0c7d11 usr.bin/gzip/gzip.c
--- a/usr.bin/gzip/gzip.c       Tue Jun 21 12:41:24 2011 +0000
+++ b/usr.bin/gzip/gzip.c       Tue Jun 21 13:25:45 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gzip.c,v 1.102 2011/06/19 02:19:09 christos Exp $      */
+/*     $NetBSD: gzip.c,v 1.103 2011/06/21 13:25:45 joerg Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green
@@ -30,7 +30,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003, 2004, 2006\
  Matthew R. Green.  All rights reserved.");
-__RCSID("$NetBSD: gzip.c,v 1.102 2011/06/19 02:19:09 christos Exp $");
+__RCSID("$NetBSD: gzip.c,v 1.103 2011/06/21 13:25:45 joerg Exp $");
 #endif /* not lint */
 
 /*
@@ -580,7 +580,7 @@
                i++;
 #endif
 
-       z.next_out = outbufp + i;
+       z.next_out = (unsigned char *)outbufp + i;
        z.avail_out = BUFLEN - i;
 
        error = deflateInit2(&z, numflag, Z_DEFLATED,
@@ -601,7 +601,7 @@
                        }
 
                        out_tot += BUFLEN;
-                       z.next_out = outbufp;
+                       z.next_out = (unsigned char *)outbufp;
                        z.avail_out = BUFLEN;
                }
 
@@ -617,7 +617,7 @@
 
                        crc = crc32(crc, (const Bytef *)inbufp, (unsigned)in_size);
                        in_tot += in_size;
-                       z.next_in = inbufp;
+                       z.next_in = (unsigned char *)inbufp;
                        z.avail_in = in_size;
                }
 
@@ -650,7 +650,7 @@
                        goto out;
                }
                out_tot += len;
-               z.next_out = outbufp;
+               z.next_out = (unsigned char *)outbufp;
                z.avail_out = BUFLEN;
 
                if (error == Z_STREAM_END)
@@ -744,9 +744,9 @@
 
        memset(&z, 0, sizeof z);
        z.avail_in = prelen;
-       z.next_in = pre;
+       z.next_in = (unsigned char *)pre;
        z.avail_out = BUFLEN;
-       z.next_out = outbufp;
+       z.next_out = (unsigned char *)outbufp;
        z.zalloc = NULL;
        z.zfree = NULL;
        z.opaque = 0;
@@ -761,7 +761,7 @@
                        if (z.avail_in > 0) {
                                memmove(inbufp, z.next_in, z.avail_in);
                        }
-                       z.next_in = inbufp;
+                       z.next_in = (unsigned char *)inbufp;
                        in_size = read(in, z.next_in + z.avail_in,
                            BUFLEN - z.avail_in);
 
@@ -956,7 +956,7 @@
                                state++;
                        }
 
-                       z.next_out = outbufp;
+                       z.next_out = (unsigned char *)outbufp;
                        z.avail_out = BUFLEN;
 
                        break;
@@ -1671,12 +1671,12 @@
 #endif
        case FT_GZIP:
                usize = gz_uncompress(STDIN_FILENO, STDOUT_FILENO, 
-                             header1, sizeof header1, &gsize, "(stdin)");
+                             (char *)header1, sizeof header1, &gsize, "(stdin)");
                break;
 #ifndef NO_BZIP2_SUPPORT
        case FT_BZIP2:
                usize = unbzip2(STDIN_FILENO, STDOUT_FILENO,
-                               header1, sizeof header1, &gsize);
+                               (char *)header1, sizeof header1, &gsize);
                break;
 #endif
 #ifndef NO_COMPRESS_SUPPORT
@@ -1686,7 +1686,8 @@
                        return;
                }
 
-               usize = zuncompress(in, stdout, header1, sizeof header1, &gsize);
+               usize = zuncompress(in, stdout, (char *)header1,
+                   sizeof header1, &gsize);
                fclose(in);
                break;
 #endif



Home | Main Index | Thread Index | Old Index