]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed signed comparison warning in zng_calloc_aligned.
authorNathan Moinvaziri <nathan@nathanm.com>
Sun, 20 Mar 2022 02:41:24 +0000 (19:41 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 27 Mar 2022 17:17:21 +0000 (19:17 +0200)
zutil.c: In function ‘zng_calloc_aligned’:
zutil.c:133:20: warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘long unsigned int’ [-Wsign-compare]

zutil.c

diff --git a/zutil.c b/zutil.c
index c3ef19f5bcef7ff112b530a33d48cfc2a798cb15..2ca6aae4b2e8a0836feb6030f2de219e66a1bcf4 100644 (file)
--- a/zutil.c
+++ b/zutil.c
@@ -114,7 +114,7 @@ void Z_INTERNAL zng_cfree(void *opaque, void *ptr) {
  * we have to ask for extra memory and return an aligned pointer. */
 void Z_INTERNAL *zng_calloc_aligned(zng_calloc_func zalloc, void *opaque, unsigned items, unsigned size, unsigned align) {
     uintptr_t return_ptr, original_ptr;
-    int32_t alloc_size, align_diff;
+    uint32_t alloc_size, align_diff;
     void *ptr;
 
     /* If no custom calloc function used then call zlib-ng's aligned calloc */