]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Cast result of zalloc to char * to avoid warnings
authorPavel P <pavlov.pavel@gmail.com>
Wed, 7 Aug 2024 18:59:39 +0000 (20:59 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 9 Aug 2024 11:34:43 +0000 (13:34 +0200)
 + remove unnecessary cast when using `original_buf`

deflate.c
inflate.c

index 66b5506a521e5cb68acbd343622baf31344982a5..af0f27bdbc1d479c56ab00f1dd5a36d0d38756d1 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -239,7 +239,7 @@ Z_INTERNAL deflate_allocs* alloc_deflate(PREFIX3(stream) *strm, int windowBits,
     int total_size = PAD_64(curr_size + (WINDOW_PAD_SIZE - 1));
 
     /* Allocate buffer, align to 64-byte cacheline, and zerofill the resulting buffer */
-    char *original_buf = strm->zalloc(strm->opaque, 1, total_size);
+    char *original_buf = (char *)strm->zalloc(strm->opaque, 1, total_size);
     if (original_buf == NULL)
         return NULL;
 
@@ -248,7 +248,7 @@ Z_INTERNAL deflate_allocs* alloc_deflate(PREFIX3(stream) *strm, int windowBits,
 
     /* Initialize alloc_bufs */
     deflate_allocs *alloc_bufs  = (struct deflate_allocs_s *)(buff + alloc_pos);
-    alloc_bufs->buf_start = (char *)original_buf;
+    alloc_bufs->buf_start = original_buf;
     alloc_bufs->zfree = strm->zfree;
 
     /* Assign buffers */
index 956f37db7dfb4d5774af192d73f662fc6e004a0f..cfcbf5235944d4269112c6d34b7bf6b4e3026683 100644 (file)
--- a/inflate.c
+++ b/inflate.c
@@ -170,7 +170,7 @@ Z_INTERNAL inflate_allocs* alloc_inflate(PREFIX3(stream) *strm) {
     int total_size = PAD_64(curr_size + (WINDOW_PAD_SIZE - 1));
 
     /* Allocate buffer, align to 64-byte cacheline, and zerofill the resulting buffer */
-    char *original_buf = strm->zalloc(strm->opaque, 1, total_size);
+    char *original_buf = (char *)strm->zalloc(strm->opaque, 1, total_size);
     if (original_buf == NULL)
         return NULL;
 
@@ -179,7 +179,7 @@ Z_INTERNAL inflate_allocs* alloc_inflate(PREFIX3(stream) *strm) {
 
     /* Initialize alloc_bufs */
     inflate_allocs *alloc_bufs  = (struct inflate_allocs_s *)(buff + alloc_pos);
-    alloc_bufs->buf_start = (char *)original_buf;
+    alloc_bufs->buf_start = original_buf;
     alloc_bufs->zfree = strm->zfree;
 
     alloc_bufs->window =  (unsigned char *)HINT_ALIGNED_WINDOW((buff + window_pos));