]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix cast and truncation warnings.
authorMika Lindqvist <postmaster@raasu.org>
Mon, 6 Oct 2025 18:22:40 +0000 (21:22 +0300)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Wed, 8 Oct 2025 13:28:22 +0000 (15:28 +0200)
test/benchmarks/benchmark_slidehash.cc
test/benchmarks/benchmark_uncompress.cc

index 53e9516817770141a7e4d03d53de7b15143d03cf..4313450ae19965fd1315620f1cb83c46d8c54ecc 100644 (file)
@@ -28,13 +28,13 @@ public:
         l0 = (uint16_t *)zng_alloc_aligned(HASH_SIZE * sizeof(uint16_t), 64);
 
         for (uint32_t i = 0; i < HASH_SIZE; i++) {
-            l0[i] = rand();
+            l0[i] = (uint16_t)rand();
         }
 
         l1 = (uint16_t *)zng_alloc_aligned(MAX_RANDOM_INTS * sizeof(uint16_t), 64);
 
         for (int32_t i = 0; i < MAX_RANDOM_INTS; i++) {
-            l1[i] = rand();
+            l1[i] = (uint16_t)rand();
         }
 
         deflate_state *s = (deflate_state*)malloc(sizeof(deflate_state));
index 5653a350dac8943585da379106511163b0654515..998b6ae29c6cd497ede6cee2a0a8cd40673a3f56 100644 (file)
@@ -26,7 +26,7 @@ private:
     uint8_t *inbuff;
     uint8_t *outbuff;
     uint8_t *compressed_buff[NUM_TESTS];
-    uLong compressed_sizes[NUM_TESTS];
+    z_uintmax_t compressed_sizes[NUM_TESTS];
     int64_t sizes[NUM_TESTS] = {1, 64, 1024, 16384, 128*1024, 1024*1024};
 
 public: