From c299895763778a5baa252278a298d9501e04f252 Mon Sep 17 00:00:00 2001 From: ChungHsuanChen Date: Sat, 20 Apr 2024 20:43:31 +0800 Subject: [PATCH] Fix build error caused by unused variable in OSX Remove unused local variable in fvtest which will cause build error in OSX Signed-off-by: ChungHsuanChen --- fvtest/porttest/omrtimeTest.cpp | 4 ++-- fvtest/porttest/si.cpp | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/fvtest/porttest/omrtimeTest.cpp b/fvtest/porttest/omrtimeTest.cpp index fdd3153612d..6bf7f19fc46 100644 --- a/fvtest/porttest/omrtimeTest.cpp +++ b/fvtest/porttest/omrtimeTest.cpp @@ -299,7 +299,7 @@ TEST(PortTimeTest, time_test3) uint64_t hiresTimeStart, hiresTimeStop; uint64_t hiresDeltaAsMillis, hiresDeltaAsMicros; uint64_t ntimeDeltaAsMillis; - uint32_t i, j; + uint32_t i; int32_t millires; reportTestEntry(OMRPORTLIB, testName); @@ -314,7 +314,7 @@ TEST(PortTimeTest, time_test3) /*change of millis*/ time = omrtime_current_time_millis(); oldTime = time; - for (j = 0; oldTime == time; j++) { + while (oldTime == time) { oldTime = omrtime_current_time_millis(); } millires = (int32_t)(oldTime - time); diff --git a/fvtest/porttest/si.cpp b/fvtest/porttest/si.cpp index f7ccfe83c99..3ef499b2eba 100644 --- a/fvtest/porttest/si.cpp +++ b/fvtest/porttest/si.cpp @@ -500,7 +500,6 @@ TEST(PortSysinfoTest, sysinfo_test_sysinfo_env_iterator) J9SysinfoEnvElement element; void *buffer = NULL; uint32_t bufferSizeBytes = 0; - int l = 0; #undef SI_DEBUG reportTestEntry(OMRPORTLIB, testName); @@ -546,13 +545,11 @@ TEST(PortSysinfoTest, sysinfo_test_sysinfo_env_iterator) portTestEnv->log("Environment:\n\n"); - l = 0; while (omrsysinfo_env_iterator_hasNext(&state)) { rc = omrsysinfo_env_iterator_next(&state, &element); if (0 == rc) { portTestEnv->log("%s\n", element.nameAndValue); - l++; } else { outputErrorMessage(PORTTEST_ERROR_ARGS, "\tomrsysinfo_env_iterator_next returned: %i when 0 was expected\n", rc); goto done; @@ -586,7 +583,6 @@ TEST(PortSysinfoTest, sysinfo_test_sysinfo_env_iterator) #endif } - l = 0; while (omrsysinfo_env_iterator_hasNext(&state)) { rc = omrsysinfo_env_iterator_next(&state, &element); @@ -596,7 +592,6 @@ TEST(PortSysinfoTest, sysinfo_test_sysinfo_env_iterator) #endif if (0 == rc) { - l++; } else { outputErrorMessage(PORTTEST_ERROR_ARGS, "\tomrsysinfo_env_iterator_next returned: %i when 0 was expected\n", rc); goto done; @@ -629,7 +624,6 @@ TEST(PortSysinfoTest, sysinfo_test_sysinfo_env_iterator) #endif } - l = 0; while (omrsysinfo_env_iterator_hasNext(&state)) { rc = omrsysinfo_env_iterator_next(&state, &element); @@ -639,7 +633,6 @@ TEST(PortSysinfoTest, sysinfo_test_sysinfo_env_iterator) #endif if (0 == rc) { - l++; } else { outputErrorMessage(PORTTEST_ERROR_ARGS, "\tomrsysinfo_env_iterator_next returned: %i when 0 was expected\n", rc); goto done;