diff --git a/test_common/harness/conversions.cpp b/test_common/harness/conversions.cpp index c7731269..d52a2ac6 100644 --- a/test_common/harness/conversions.cpp +++ b/test_common/harness/conversions.cpp @@ -14,6 +14,7 @@ // limitations under the License. // #include "conversions.h" +#include #include #include #include @@ -50,10 +51,10 @@ void print_type_to_string(ExplicitType type, void *data, char *string) case kInt: sprintf(string, "%d", *((cl_int *)data)); return; case kUInt: case kUnsignedInt: sprintf(string, "%u", *((cl_uint *)data)); return; - case kLong: sprintf(string, "%lld", *((cl_long *)data)); return; + case kLong: sprintf(string, "%" PRId64 "", *((cl_long *)data)); return; case kULong: case kUnsignedLong: - sprintf(string, "%llu", *((cl_ulong *)data)); + sprintf(string, "%" PRIu64 "", *((cl_ulong *)data)); return; case kFloat: sprintf(string, "%f", *((cl_float *)data)); return; case kHalf: sprintf(string, "half"); return; diff --git a/test_common/harness/imageHelpers.cpp b/test_common/harness/imageHelpers.cpp index 3dbdffa0..f1694e88 100644 --- a/test_common/harness/imageHelpers.cpp +++ b/test_common/harness/imageHelpers.cpp @@ -23,6 +23,7 @@ #include #endif #include +#include #include #if !defined(_WIN32) #include @@ -421,7 +422,7 @@ void print_first_pixel_difference_error(size_t where, const char *sourcePixel, (int)thirdDim, (int)imageInfo->rowPitch, (int)imageInfo->rowPitch - (int)imageInfo->width * (int)pixel_size); - log_error("Failed at column: %ld ", where); + log_error("Failed at column: %zu ", where); switch (pixel_size) { @@ -454,7 +455,7 @@ void print_first_pixel_difference_error(size_t where, const char *sourcePixel, ((cl_ushort *)destPixel)[1], ((cl_ushort *)destPixel)[2]); break; case 8: - log_error("*0x%16.16llx vs. 0x%16.16llx\n", + log_error("*0x%16.16" PRIx64 " vs. 0x%16.16" PRIx64 "\n", ((cl_ulong *)sourcePixel)[0], ((cl_ulong *)destPixel)[0]); break; case 12: @@ -473,7 +474,7 @@ void print_first_pixel_difference_error(size_t where, const char *sourcePixel, ((cl_uint *)destPixel)[2], ((cl_uint *)destPixel)[3]); break; default: - log_error("Don't know how to print pixel size of %ld\n", + log_error("Don't know how to print pixel size of %zu\n", pixel_size); break; } diff --git a/test_common/harness/propertyHelpers.cpp b/test_common/harness/propertyHelpers.cpp index e368f9b6..6a10c076 100644 --- a/test_common/harness/propertyHelpers.cpp +++ b/test_common/harness/propertyHelpers.cpp @@ -19,6 +19,7 @@ #include #include +#include #include static bool findProperty(const std::vector& props, @@ -97,16 +98,16 @@ int compareProperties(const std::vector& queried, if (!found) { - log_error("ERROR: expected property 0x%llx not found!\n", + log_error("ERROR: expected property 0x%" PRIx64 " not found!\n", check_prop); return TEST_FAIL; } else if (check_value != queried_value) { - log_error( - "ERROR: mis-matched value for property 0x%llx: wanted " - "0x%llx, got 0x%llx\n", - check_prop, check_value, queried_value); + log_error("ERROR: mis-matched value for property 0x%" PRIx64 + ": wanted " + "0x%" PRIx64 ", got 0x%" PRIx64 "\n", + check_prop, check_value, queried_value); return TEST_FAIL; } } diff --git a/test_common/harness/testHarness.cpp b/test_common/harness/testHarness.cpp index d07d982c..a309f53d 100644 --- a/test_common/harness/testHarness.cpp +++ b/test_common/harness/testHarness.cpp @@ -1198,7 +1198,7 @@ cl_platform_id getPlatformFromDevice(cl_device_id deviceID) void PrintArch(void) { - vlog("sizeof( void*) = %ld\n", sizeof(void *)); + vlog("sizeof( void*) = %zu\n", sizeof(void *)); #if defined(__ppc__) vlog("ARCH:\tppc\n"); #elif defined(__ppc64__)