]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Remove FAR variants of voidpf
authorhansr <hk-git@circlestorm.org>
Sat, 18 Oct 2014 10:11:48 +0000 (12:11 +0200)
committerhansr <hk-git@circlestorm.org>
Sat, 18 Oct 2014 10:11:48 +0000 (12:11 +0200)
And a few Bytef leftovers from test/example.c

compress.c
deflate.c
infback.c
inflate.c
test/example.c
zlib.h
zutil.c

index 236e6ef2ccf23e5cae58446a18ac0565311ee2b8..cdb603c4a6c2b814f74fa70a363da888b770e0e0 100644 (file)
@@ -37,7 +37,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
 
     stream.zalloc = (alloc_func)0;
     stream.zfree = (free_func)0;
-    stream.opaque = (voidpf)0;
+    stream.opaque = (voidp)0;
 
     err = deflateInit(&stream, level);
     if (err != Z_OK) return err;
index d64557b4afefc68eb4a29d2331834d02bc9b61c7..992ad613b8ce03f2d4876dd79b59539d9a259f23 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -285,7 +285,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
         return Z_STREAM_ERROR;
 #else
         strm->zalloc = zcalloc;
-        strm->opaque = (voidpf)0;
+        strm->opaque = (voidp)0;
 #endif
     }
     if (strm->zfree == (free_func)0)
@@ -1081,12 +1081,12 @@ int ZEXPORT deflateCopy (dest, source)
 
     ss = source->state;
 
-    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
+    zmemcpy((voidp)dest, (voidp)source, sizeof(z_stream));
 
     ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
     if (ds == Z_NULL) return Z_MEM_ERROR;
     dest->state = (struct internal_state *) ds;
-    zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state));
+    zmemcpy((voidp)ds, (voidp)ss, sizeof(deflate_state));
     ds->strm = dest;
 
     ds->window = (Byte *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
@@ -1102,8 +1102,8 @@ int ZEXPORT deflateCopy (dest, source)
     }
 
     zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
-    zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos));
-    zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos));
+    zmemcpy((voidp)ds->prev, (voidp)ss->prev, ds->w_size * sizeof(Pos));
+    zmemcpy((voidp)ds->head, (voidp)ss->head, ds->hash_size * sizeof(Pos));
     zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
 
     ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
index c082388cf0410fbb6c2a6fee3fdfe29fdfcab33d..e873426c71ab5628de600a70deb1205be322ec1e 100644 (file)
--- a/infback.c
+++ b/infback.c
@@ -46,7 +46,7 @@ int stream_size;
         return Z_STREAM_ERROR;
 #else
         strm->zalloc = zcalloc;
-        strm->opaque = (voidpf)0;
+        strm->opaque = (voidp)0;
 #endif
     }
     if (strm->zfree == (free_func)0)
index f943d5b359f936a26e7247e477bab943d5579088..e888e6342f5df79e756673067aa20766b311bb28 100644 (file)
--- a/inflate.c
+++ b/inflate.c
@@ -194,7 +194,7 @@ int stream_size;
         return Z_STREAM_ERROR;
 #else
         strm->zalloc = zcalloc;
-        strm->opaque = (voidpf)0;
+        strm->opaque = (voidp)0;
 #endif
     }
     if (strm->zfree == (free_func)0)
@@ -1463,8 +1463,8 @@ z_streamp source;
     }
 
     /* copy state */
-    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
-    zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state));
+    zmemcpy((voidp)dest, (voidp)source, sizeof(z_stream));
+    zmemcpy((voidp)copy, (voidp)state, sizeof(struct inflate_state));
     if (state->lencode >= state->codes &&
         state->lencode <= state->codes + ENOUGH - 1) {
         copy->lencode = copy->codes + (state->lencode - state->codes);
index 62141e58609f8250040dca1a3050e31f09069407..b64f0d640f3b614aece58506926fcd7fc613d73d 100644 (file)
@@ -86,7 +86,7 @@ void test_compress(compr, comprLen, uncompr, uncomprLen)
     int err;
     uLong len = (uLong)strlen(hello)+1;
 
-    err = compress(compr, &comprLen, (const Bytef*)hello, len);
+    err = compress(compr, &comprLen, (const Byte*)hello, len);
     CHECK_ERR(err, "compress");
 
     strcpy((char*)uncompr, "garbage");
@@ -201,7 +201,7 @@ void test_deflate(compr, comprLen)
 
     c_stream.zalloc = zalloc;
     c_stream.zfree = zfree;
-    c_stream.opaque = (voidpf)0;
+    c_stream.opaque = (voidp)0;
 
     err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
     CHECK_ERR(err, "deflateInit");
@@ -240,7 +240,7 @@ void test_inflate(compr, comprLen, uncompr, uncomprLen)
 
     d_stream.zalloc = zalloc;
     d_stream.zfree = zfree;
-    d_stream.opaque = (voidpf)0;
+    d_stream.opaque = (voidp)0;
 
     d_stream.next_in  = compr;
     d_stream.avail_in = 0;
@@ -279,7 +279,7 @@ void test_large_deflate(compr, comprLen, uncompr, uncomprLen)
 
     c_stream.zalloc = zalloc;
     c_stream.zfree = zfree;
-    c_stream.opaque = (voidpf)0;
+    c_stream.opaque = (voidp)0;
 
     err = deflateInit(&c_stream, Z_BEST_SPEED);
     CHECK_ERR(err, "deflateInit");
@@ -336,7 +336,7 @@ void test_large_inflate(compr, comprLen, uncompr, uncomprLen)
 
     d_stream.zalloc = zalloc;
     d_stream.zfree = zfree;
-    d_stream.opaque = (voidpf)0;
+    d_stream.opaque = (voidp)0;
 
     d_stream.next_in  = compr;
     d_stream.avail_in = (uInt)comprLen;
@@ -376,7 +376,7 @@ void test_flush(compr, comprLen)
 
     c_stream.zalloc = zalloc;
     c_stream.zfree = zfree;
-    c_stream.opaque = (voidpf)0;
+    c_stream.opaque = (voidp)0;
 
     err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
     CHECK_ERR(err, "deflateInit");
@@ -415,7 +415,7 @@ void test_sync(compr, comprLen, uncompr, uncomprLen)
 
     d_stream.zalloc = zalloc;
     d_stream.zfree = zfree;
-    d_stream.opaque = (voidpf)0;
+    d_stream.opaque = (voidp)0;
 
     d_stream.next_in  = compr;
     d_stream.avail_in = 2; /* just read the zlib header */
@@ -457,13 +457,13 @@ void test_dict_deflate(compr, comprLen)
 
     c_stream.zalloc = zalloc;
     c_stream.zfree = zfree;
-    c_stream.opaque = (voidpf)0;
+    c_stream.opaque = (voidp)0;
 
     err = deflateInit(&c_stream, Z_BEST_COMPRESSION);
     CHECK_ERR(err, "deflateInit");
 
     err = deflateSetDictionary(&c_stream,
-                (const Bytef*)dictionary, (int)sizeof(dictionary));
+                (const Byte*)dictionary, (int)sizeof(dictionary));
     CHECK_ERR(err, "deflateSetDictionary");
 
     dictId = c_stream.adler;
@@ -496,7 +496,7 @@ void test_dict_inflate(compr, comprLen, uncompr, uncomprLen)
 
     d_stream.zalloc = zalloc;
     d_stream.zfree = zfree;
-    d_stream.opaque = (voidpf)0;
+    d_stream.opaque = (voidp)0;
 
     d_stream.next_in  = compr;
     d_stream.avail_in = (uInt)comprLen;
@@ -515,7 +515,7 @@ void test_dict_inflate(compr, comprLen, uncompr, uncomprLen)
                 fprintf(stderr, "unexpected dictionary");
                 exit(1);
             }
-            err = inflateSetDictionary(&d_stream, (const Bytef*)dictionary,
+            err = inflateSetDictionary(&d_stream, (const Byte*)dictionary,
                                        (int)sizeof(dictionary));
         }
         CHECK_ERR(err, "inflate with dict");
diff --git a/zlib.h b/zlib.h
index 55d0e399e71fc6b7f82447254024544e17878dd7..aa315befa200d38fe4b62277b689cdffa7fca455 100644 (file)
--- a/zlib.h
+++ b/zlib.h
@@ -77,8 +77,8 @@ extern "C" {
   even in case of corrupted input.
 */
 
-typedef voidpf (*alloc_func) (voidpf opaque, uInt items, uInt size);
-typedef void   (*free_func)  (voidpf opaque, voidpf address);
+typedef voidp  (*alloc_func) (voidp opaque, uInt items, uInt size);
+typedef void   (*free_func)  (voidp opaque, voidp address);
 
 struct internal_state;
 
@@ -96,7 +96,7 @@ typedef struct z_stream_s {
 
     alloc_func zalloc;  /* used to allocate the internal state */
     free_func  zfree;   /* used to free the internal state */
-    voidpf     opaque;  /* private data object passed to zalloc and zfree */
+    voidp      opaque;  /* private data object passed to zalloc and zfree */
 
     int     data_type;  /* best guess about the data type: binary or text */
     uLong   adler;      /* adler32 value of the uncompressed data */
@@ -1101,7 +1101,7 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags (void);
     Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
      1.0: size of uInt
      3.2: size of uLong
-     5.4: size of voidpf (pointer)
+     5.4: size of voidp (pointer)
      7.6: size of z_off_t
 
     Compiler, assembler, and debug options:
diff --git a/zutil.c b/zutil.c
index 8639ca60c508fe96dd0799b307bd39a5a0a63027..ec2050b3e26136bcd2a5f6b51af95fb2b6f4f824 100644 (file)
--- a/zutil.c
+++ b/zutil.c
@@ -45,7 +45,7 @@ uLong ZEXPORT zlibCompileFlags()
     case 8:     flags += 2 << 2;        break;
     default:    flags += 3 << 2;
     }
-    switch ((int)(sizeof(voidpf))) {
+    switch ((int)(sizeof(voidp))) {
     case 2:     break;
     case 4:     flags += 1 << 4;        break;
     case 8:     flags += 2 << 4;        break;
@@ -120,19 +120,19 @@ const char * ZEXPORT zError(err)
 
 #ifndef MY_ZCALLOC /* Any system without a special alloc function */
 
-voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
-    voidpf opaque;
+voidp ZLIB_INTERNAL zcalloc (opaque, items, size)
+    voidp opaque;
     unsigned items;
     unsigned size;
 {
     if (opaque) items += size - size; /* make compiler happy */
-    return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
-                              (voidpf)calloc(items, size);
+    return sizeof(uInt) > 2 ? (voidp)malloc(items * size) :
+                              (voidp)calloc(items, size);
 }
 
 void ZLIB_INTERNAL zcfree (opaque, ptr)
-    voidpf opaque;
-    voidpf ptr;
+    voidp opaque;
+    voidp ptr;
 {
     free(ptr);
     if (opaque) return; /* make compiler happy */