summaryrefslogtreecommitdiff
path: root/test/example.c
diff options
context:
space:
mode:
authorMika Lindqvist <postmaster@raasu.org>2025-10-09 11:40:16 +0300
committerHans Kristian Rosbach <hk-github@circlestorm.org>2025-10-22 13:17:13 +0200
commit7b29794c1807fcdeb1b81729a1d7ae1ac93fbd8b (patch)
treef75d419023930084ea11b919a23b935e0892fdda /test/example.c
parentfa09b0558fd30943a65c45e360703c15ec0a72e3 (diff)
downloadProject-Tick-7b29794c1807fcdeb1b81729a1d7ae1ac93fbd8b.tar.gz
Project-Tick-7b29794c1807fcdeb1b81729a1d7ae1ac93fbd8b.zip
Fix type mismatch on platforms where int32_t and uint32_t use long instead of int
* Based on PR #1934
Diffstat (limited to 'test/example.c')
-rw-r--r--test/example.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/example.c b/test/example.c
index f52cad427d..5393fa5de9 100644
--- a/test/example.c
+++ b/test/example.c
@@ -74,7 +74,7 @@ static void test_gzio(const char *fname, unsigned char *uncompr, z_size_t uncomp
#ifdef NO_GZCOMPRESS
fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n");
#else
- int err;
+ z_int32_t err;
size_t read;
size_t len = strlen(hello)+1;
gzFile file;
@@ -653,7 +653,7 @@ static void test_deflate_get_dict(unsigned char *compr, size_t comprLen) {
PREFIX3(stream) c_stream; /* compression stream */
int err;
unsigned char *dictNew = NULL;
- unsigned int *dictLen;
+ z_uint32_t *dictLen;
c_stream.zalloc = zalloc;
c_stream.zfree = zfree;
@@ -674,7 +674,7 @@ static void test_deflate_get_dict(unsigned char *compr, size_t comprLen) {
error("deflate should report Z_STREAM_END\n");
dictNew = calloc(256, 1);
- dictLen = (unsigned int *)calloc(4, 1);
+ dictLen = (z_uint32_t *)calloc(4, 1);
err = PREFIX(deflateGetDictionary)(&c_stream, dictNew, dictLen);
CHECK_ERR(err, "deflateGetDictionary");
@@ -695,8 +695,8 @@ static void test_deflate_get_dict(unsigned char *compr, size_t comprLen) {
static void test_deflate_pending(unsigned char *compr, size_t comprLen) {
PREFIX3(stream) c_stream; /* compression stream */
int err;
- int *bits = calloc(256, 1);
- unsigned *ped = calloc(256, 1);
+ z_int32_t *bits = calloc(256, 1);
+ z_uint32_t *ped = calloc(256, 1);
size_t len = strlen(hello)+1;