From: Pavel P Date: Wed, 27 Nov 2024 21:13:34 +0000 (+0200) Subject: Fix casting warning/error in test_compress_bound.cc X-Git-Tag: 2.2.3~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fdc3aa26aabeafc70cf25cc41614afd1bf9175c;p=thirdparty%2Fzlib-ng.git Fix casting warning/error in test_compress_bound.cc Fixes the following error when building with msvc compiler ``` test_compress_bound.cc D:\zlib-ng\test\test_compress_bound.cc(41,50): error C2220: the following warning is treated as an error D:\zlib-ng\test\test_compress_bound.cc(41,50): warning C4267: 'argument': conversion from 'size_t' to 'unsigned long', possible loss of data D:\zlib-ng\test\test_compress_bound.cc(43,68): warning C4267: 'argument': conversion from 'size_t' to 'unsigned long', possible loss of data ``` --- diff --git a/test/test_compress_bound.cc b/test/test_compress_bound.cc index b83b59f4..1acda02f 100644 --- a/test/test_compress_bound.cc +++ b/test/test_compress_bound.cc @@ -34,7 +34,7 @@ public: uncompressed[j] = (uint8_t)j; } - for (z_size_t i = 0; i < MAX_LENGTH; i++) { + for (z_uintmax_t i = 0; i < MAX_LENGTH; i++) { z_uintmax_t dest_len = sizeof(dest); /* calculate actual output length */