diff options
author | Haru <haru@dotalux.com> | 2015-01-20 04:36:08 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-01-20 04:41:33 +0100 |
commit | 4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 (patch) | |
tree | dab9d12a6a4b95a37598e27e6e86d6047360d61b /src/test/test_spinlock.c | |
parent | 03709c136ad300be631adfd38dc36c2433bda718 (diff) | |
download | hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.gz hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.bz2 hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.xz hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.zip |
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 <haru@dotalux.com>
Diffstat (limited to 'src/test/test_spinlock.c')
-rw-r--r-- | src/test/test_spinlock.c | 10 |
1 files changed, 5 insertions, 5 deletions
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++; } |