From 11f3eaaceb1b6ac18c0fb9d7494b6be69a5f115b Mon Sep 17 00:00:00 2001 From: Stuart Brady Date: Fri, 4 Sep 2020 11:25:52 +0100 Subject: [PATCH] [MinGW] Fix if statements with stray semicolons after condition (#934) In two places, a stray semicolon between an if statement and its body would cause the body to be executed unconditionally. Fix this. Signed-off-by: Stuart Brady --- test_common/harness/ThreadPool.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test_common/harness/ThreadPool.cpp b/test_common/harness/ThreadPool.cpp index c329452d..6d64681a 100644 --- a/test_common/harness/ThreadPool.cpp +++ b/test_common/harness/ThreadPool.cpp @@ -371,8 +371,7 @@ void *ThreadPool_WorkerFunc( void *p ) { #if (__MINGW32__) EnterCriticalSection(&gAtomicLock); - if( jobError == CL_SUCCESS ); - jobError = err; + if (jobError == CL_SUCCESS) jobError = err; gRunCount = 0; LeaveCriticalSection(&gAtomicLock); #elif defined( __GNUC__ ) @@ -393,8 +392,7 @@ void *ThreadPool_WorkerFunc( void *p ) #else if( pthread_mutex_lock(&gAtomicLock) ) log_error( "Atomic operation failed. pthread_mutex_lock(&gAtomicLock) returned an error\n"); - if( jobError == CL_SUCCESS ); - jobError = err; + if (jobError == CL_SUCCESS) jobError = err; gRunCount = 0; if( pthread_mutex_unlock(&gAtomicLock) ) log_error( "Failed to release gAtomicLock. Further atomic operations may deadlock\n");