From 4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 20 Jan 2015 04:36:08 +0100 Subject: Minor fixes and tweaks suggested by cppcheck - Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru --- src/test/test_spinlock.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/test') diff --git a/src/test/test_spinlock.c b/src/test/test_spinlock.c index 1b31e9b46..19ae9aee7 100644 --- a/src/test/test_spinlock.c +++ b/src/test/test_spinlock.c @@ -20,7 +20,7 @@ static SPIN_LOCK lock; -static int val = 0; +static unsigned int val = 0; static volatile int32 done_threads = 0; static void *worker(void *p){ @@ -72,10 +72,10 @@ int do_init(int argc, char **argv){ FinalizeSpinLock(&lock); // Everything fine? - if(val != (THRC*PERINC) ){ - printf("FAILED! (Result: %u, Expected: %u)\n", val, (THRC*PERINC) ); - }else{ - printf("OK! (Result: %u, Expected: %u)\n", val, (THRC*PERINC) ); + if (val != (THRC*PERINC)) { + printf("FAILED! (Result: %u, Expected: %u)\n", val, (THRC*PERINC)); + } else { + printf("OK! (Result: %u, Expected: %u)\n", val, (THRC*PERINC)); ok++; } -- cgit v1.2.3-60-g2f50