diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/dtypes.c | 18 | ||||
-rw-r--r-- | test/hyperslab.c | 19 | ||||
-rw-r--r-- | test/istore.c | 6 |
3 files changed, 28 insertions, 15 deletions
diff --git a/test/dtypes.c b/test/dtypes.c index 0047560..04e5737 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -2088,7 +2088,8 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) for (k=0; k<src_size; k++) { printf(" %02x", saved[j*src_size+ENDIAN(src_size, k)]); } - printf("%*s", 3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size), ""); + printf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), + ""); switch (src_type) { case INT_CHAR: memcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); @@ -2141,7 +2142,8 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) for (k=0; k<dst_size; k++) { printf(" %02x", buf[j*dst_size+ENDIAN(dst_size, k)]); } - printf("%*s", 3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size), ""); + printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), + ""); switch (dst_type) { case INT_CHAR: memcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); @@ -2193,7 +2195,8 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) for (k=0; k<dst_size; k++) { printf(" %02x", hw[ENDIAN(dst_size, k)]); } - printf("%*s", 3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size), ""); + printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), + ""); switch (dst_type) { case INT_CHAR: printf(" %29d\n", *((signed char*)hw)); @@ -2656,7 +2659,8 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst) for (k=0; k<src_size; k++) { printf(" %02x", saved[j*src_size+ENDIAN(src_size,k)]); } - printf("%*s", 3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size), ""); + printf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), + ""); if (FLT_FLOAT==src_type) { float x; memcpy(&x, (float*)saved+j, sizeof(float)); @@ -2677,7 +2681,8 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst) for (k=0; k<dst_size; k++) { printf(" %02x", buf[j*dst_size+ENDIAN(dst_size,k)]); } - printf("%*s", 3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size), ""); + printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), + ""); if (FLT_FLOAT==dst_type) { float x; memcpy(&x, (float*)buf+j, sizeof(float)); @@ -2698,7 +2703,8 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst) for (k=0; k<dst_size; k++) { printf(" %02x", hw[ENDIAN(dst_size,k)]); } - printf("%*s", 3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size), ""); + printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), + ""); if (FLT_FLOAT==dst_type) { printf(" %29.20e\n", hw_f); } else if (FLT_DOUBLE==dst_type) { diff --git a/test/hyperslab.c b/test/hyperslab.c index 01e092c..8b226a6 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -81,14 +81,14 @@ print_array(uint8_t *array, size_t nx, size_t ny, size_t nz) for (i=0; i<nx; i++) { if (nz>1) { - printf("i=%d:\n", i); + printf("i=%lu:\n", (unsigned long)i); } else { - printf("%03d:", i); + printf("%03lu:", (unsigned long)i); } for (j=0; j<ny; j++) { if (nz>1) - printf("%03d:", j); + printf("%03lu:", (unsigned long)j); for (k=0; k<nz; k++) { printf(" %3d", *array++); } @@ -253,9 +253,16 @@ test_fill(size_t nx, size_t ny, size_t nz, */ AT(); printf(" acc != ref_value\n"); - printf(" i=%d, j=%d, k=%d, " - "dx=%d, dy=%d, dz=%d, fill=%d\n", - i, j, k, dx, dy, dz, fill_value); + printf(" i=%lu, j=%lu, k=%lu, " + "dx=%lu, dy=%lu, dz=%lu, " + "fill=%d\n", + (unsigned long)i, + (unsigned long)j, + (unsigned long)k, + (unsigned long)dx, + (unsigned long)dy, + (unsigned long)dz, + fill_value); print_ref(nx, ny, nz); printf("\n Result is:\n"); print_array(dst, nx, ny, nz); diff --git a/test/istore.c b/test/istore.c index 0bd1c90..c840a1f 100644 --- a/test/istore.c +++ b/test/istore.c @@ -53,14 +53,14 @@ print_array(uint8_t *array, size_t nx, size_t ny, size_t nz) for (i = 0; i < nx; i++) { if (nz > 1) { - printf("i=%d:\n", i); + printf("i=%lu:\n", (unsigned long)i); } else { - printf("%03d:", i); + printf("%03lu:", (unsigned long)i); } for (j = 0; j < ny; j++) { if (nz > 1) - printf("%03d:", j); + printf("%03lu:", (unsigned long)j); for (k = 0; k < nz; k++) { printf(" %3d", *array++); } |