]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Use char* instead of caddr_t.
authorMika Lindqvist <postmaster@raasu.org>
Thu, 4 Jun 2020 12:45:05 +0000 (15:45 +0300)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sat, 6 Jun 2020 19:28:07 +0000 (21:28 +0200)
test/minigzip.c

index 6dc02599ca3827f20c3271fdf6d891dc2ccf7193..1ac0d5f8235f8d7b251a574eeca1b2d0f6459c6a 100644 (file)
@@ -126,7 +126,7 @@ int gz_compress_mmap(FILE *in, gzFile out) {
     int len;
     int err;
     int ifd = fileno(in);
-    caddr_t buf;    /* mmap'ed buffer for the entire input file */
+    char *buf;      /* mmap'ed buffer for the entire input file */
     off_t buf_len;  /* length of the input file */
     struct stat sb;
 
@@ -136,11 +136,11 @@ int gz_compress_mmap(FILE *in, gzFile out) {
     if (buf_len <= 0) return Z_ERRNO;
 
     /* Now do the actual mmap: */
-    buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0);
-    if (buf == (caddr_t)(-1)) return Z_ERRNO;
+    buf = mmap((char *) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0);
+    if (buf == (char *)(-1)) return Z_ERRNO;
 
     /* Compress the whole file at once: */
-    len = PREFIX(gzwrite)(out, (char *)buf, (unsigned)buf_len);
+    len = PREFIX(gzwrite)(out, buf, (unsigned)buf_len);
 
     if (len != (int)buf_len) error(PREFIX(gzerror)(out, &err));