From 0eb7c454d55ec45f1cafd4f1ca7b7c1dc2fbb1c7 Mon Sep 17 00:00:00 2001 From: XinZhang <627212267@qq.com> Date: Thu, 2 Aug 2018 16:30:31 +0800 Subject: [PATCH 1/2] MOD: %lu->%zu to compile by mbed-os --- serializer/tests/multitree_ut/multitree_ut.cpp | 2 +- testtools/iothub_test/src/iothubtest.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/serializer/tests/multitree_ut/multitree_ut.cpp b/serializer/tests/multitree_ut/multitree_ut.cpp index a366f1e70..789ba4a0c 100644 --- a/serializer/tests/multitree_ut/multitree_ut.cpp +++ b/serializer/tests/multitree_ut/multitree_ut.cpp @@ -349,7 +349,7 @@ TEST_FUNCTION_CLEANUP(clean) if (BASEIMPLEMENTATION::gballoc_getCurrentMemoryUsed() != 0) { char temp[1000]; - sprintf(temp, "Test did not clean memory properly, leaking %lu bytes", (long unsigned int)BASEIMPLEMENTATION::gballoc_getCurrentMemoryUsed()); + sprintf(temp, "Test did not clean memory properly, leaking %zu bytes", (long unsigned int)BASEIMPLEMENTATION::gballoc_getCurrentMemoryUsed()); BASEIMPLEMENTATION::gballoc_deinit(); ASSERT_FAIL(temp); } diff --git a/testtools/iothub_test/src/iothubtest.c b/testtools/iothub_test/src/iothubtest.c index 58a0895a0..bca884176 100644 --- a/testtools/iothub_test/src/iothubtest.c +++ b/testtools/iothub_test/src/iothubtest.c @@ -1319,7 +1319,7 @@ IOTHUB_TEST_CLIENT_RESULT IoTHubTest_SendMessage(IOTHUB_TEST_HANDLE devhubHandle ((len == 0) && (data != NULL)) || ((data != NULL) && (len == 0))) { - LogError("Invalid arguments for IoTHubTest_SendMessage, devhubHandle = %p, len = %lu, data = %p.", devhubHandle, (unsigned long)len, data); + LogError("Invalid arguments for IoTHubTest_SendMessage, devhubHandle = %p, len = %zu, data = %p.", devhubHandle, (unsigned long)len, data); result = IOTHUB_TEST_CLIENT_ERROR; } else From e1007ae7bd3a09b09108410ec3ba6b0e450e1d53 Mon Sep 17 00:00:00 2001 From: John Spaith Date: Fri, 3 Aug 2018 08:49:50 -0700 Subject: [PATCH 2/2] Remove unneeded typecasts --- serializer/tests/multitree_ut/multitree_ut.cpp | 2 +- testtools/iothub_test/src/iothubtest.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/serializer/tests/multitree_ut/multitree_ut.cpp b/serializer/tests/multitree_ut/multitree_ut.cpp index 789ba4a0c..da6f9d416 100644 --- a/serializer/tests/multitree_ut/multitree_ut.cpp +++ b/serializer/tests/multitree_ut/multitree_ut.cpp @@ -349,7 +349,7 @@ TEST_FUNCTION_CLEANUP(clean) if (BASEIMPLEMENTATION::gballoc_getCurrentMemoryUsed() != 0) { char temp[1000]; - sprintf(temp, "Test did not clean memory properly, leaking %zu bytes", (long unsigned int)BASEIMPLEMENTATION::gballoc_getCurrentMemoryUsed()); + sprintf(temp, "Test did not clean memory properly, leaking %zu bytes", BASEIMPLEMENTATION::gballoc_getCurrentMemoryUsed()); BASEIMPLEMENTATION::gballoc_deinit(); ASSERT_FAIL(temp); } diff --git a/testtools/iothub_test/src/iothubtest.c b/testtools/iothub_test/src/iothubtest.c index bca884176..0041dfd19 100644 --- a/testtools/iothub_test/src/iothubtest.c +++ b/testtools/iothub_test/src/iothubtest.c @@ -1319,7 +1319,7 @@ IOTHUB_TEST_CLIENT_RESULT IoTHubTest_SendMessage(IOTHUB_TEST_HANDLE devhubHandle ((len == 0) && (data != NULL)) || ((data != NULL) && (len == 0))) { - LogError("Invalid arguments for IoTHubTest_SendMessage, devhubHandle = %p, len = %zu, data = %p.", devhubHandle, (unsigned long)len, data); + LogError("Invalid arguments for IoTHubTest_SendMessage, devhubHandle = %p, len = %zu, data = %p.", devhubHandle, len, data); result = IOTHUB_TEST_CLIENT_ERROR; } else