From 0ebe2fafdda0470d0a11aa0e5b84f8b6c500d584 Mon Sep 17 00:00:00 2001 From: Mika Lindqvist Date: Thu, 4 Jun 2020 15:45:05 +0300 Subject: [PATCH] Use char* instead of caddr_t. --- test/minigzip.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/minigzip.c b/test/minigzip.c index 6dc02599..1ac0d5f8 100644 --- a/test/minigzip.c +++ b/test/minigzip.c @@ -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)); -- 2.47.2