]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix casting warning/error in test_compress_bound.cc
authorPavel P <pavlov.pavel@gmail.com>
Wed, 27 Nov 2024 21:13:34 +0000 (23:13 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 1 Dec 2024 15:04:33 +0000 (16:04 +0100)
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
```

test/test_compress_bound.cc

index b83b59f4fb703597194d757b704e4886801b8a0a..1acda02fc52603059d4bf6e5b47a455c36dfe372 100644 (file)
@@ -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 */