From 0c21a89a3f50b20e85651fa8c7a4c4e07ef8b7b5 Mon Sep 17 00:00:00 2001 From: Juha Niskanen Date: Mon, 29 Nov 2021 17:00:43 +0200 Subject: [PATCH] testing/ostest: remove spurious redefinitions of NULL Signed-off-by: Juha Niskanen --- testing/ostest/cond.c | 16 ++++++++++++---- testing/ostest/fpu.c | 4 ---- testing/ostest/mutex.c | 4 ---- testing/ostest/nsem.c | 4 ---- testing/ostest/posixtimer.c | 4 ---- testing/ostest/sem.c | 4 ---- testing/ostest/semtimed.c | 4 ---- testing/ostest/sigev_thread.c | 4 ---- testing/ostest/sighand.c | 4 ---- testing/ostest/signest.c | 4 ---- testing/ostest/specific.c | 4 ---- testing/ostest/timedmutex.c | 8 -------- 12 files changed, 12 insertions(+), 52 deletions(-) diff --git a/testing/ostest/cond.c b/testing/ostest/cond.c index 8fc3432cc..f04f6db64 100644 --- a/testing/ostest/cond.c +++ b/testing/ostest/cond.c @@ -31,9 +31,9 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef NULL -# define NULL (void*)0 -#endif +/**************************************************************************** + * Private Types + ****************************************************************************/ static volatile enum { @@ -42,6 +42,10 @@ static volatile enum COND_WAIT } waiter_state; +/**************************************************************************** + * Private Data + ****************************************************************************/ + static pthread_mutex_t mutex; static pthread_cond_t cond; static volatile int data_available = 0; @@ -54,7 +58,7 @@ static int signaler_state = 0; static int signaler_nerrors = 0; /**************************************************************************** - * Public Functions + * Private Functions ****************************************************************************/ static void *thread_waiter(void *parameter) @@ -215,6 +219,10 @@ static void *thread_signaler(void *parameter) return NULL; /* Non-reachable -- needed for some compilers */ } +/**************************************************************************** + * Public Functions + ****************************************************************************/ + void cond_test(void) { pthread_t waiter; diff --git a/testing/ostest/fpu.c b/testing/ostest/fpu.c index 2daecc815..b7d1946ff 100644 --- a/testing/ostest/fpu.c +++ b/testing/ostest/fpu.c @@ -86,10 +86,6 @@ #define FPU_WORDSIZE ((CONFIG_TESTING_OSTEST_FPUSIZE+3)>>2) #define FPU_NTHREADS 2 -#ifndef NULL -# define NULL (void*)0 -#endif - /**************************************************************************** * External Dependencies ****************************************************************************/ diff --git a/testing/ostest/mutex.c b/testing/ostest/mutex.c index f4e983c30..68b7808b8 100644 --- a/testing/ostest/mutex.c +++ b/testing/ostest/mutex.c @@ -30,10 +30,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef NULL -# define NULL (void*)0 -#endif - #define NLOOPS 32 /**************************************************************************** diff --git a/testing/ostest/nsem.c b/testing/ostest/nsem.c index bc933be32..faa92e55b 100644 --- a/testing/ostest/nsem.c +++ b/testing/ostest/nsem.c @@ -40,10 +40,6 @@ #define SEM1_NAME "foo" #define SEM2_NAME "bar" -#ifndef NULL -# define NULL (void*)0 -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/testing/ostest/posixtimer.c b/testing/ostest/posixtimer.c index c9ca504aa..eb5cbed34 100644 --- a/testing/ostest/posixtimer.c +++ b/testing/ostest/posixtimer.c @@ -34,10 +34,6 @@ * Private Definitions ****************************************************************************/ -#ifndef NULL -# define NULL (void*)0 -#endif - #define MY_TIMER_SIGNAL 17 #define SIGVALUE_INT 42 diff --git a/testing/ostest/sem.c b/testing/ostest/sem.c index 91bbd1361..f4ef058a9 100644 --- a/testing/ostest/sem.c +++ b/testing/ostest/sem.c @@ -32,10 +32,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef NULL -# define NULL (void*)0 -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/testing/ostest/semtimed.c b/testing/ostest/semtimed.c index ad45013da..8e36c97e9 100644 --- a/testing/ostest/semtimed.c +++ b/testing/ostest/semtimed.c @@ -35,10 +35,6 @@ * Preprocessor Definitions ****************************************************************************/ -#ifndef NULL -# error Broken toolchain does not have NULL -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/testing/ostest/sigev_thread.c b/testing/ostest/sigev_thread.c index 1e95d777b..c35b8178c 100644 --- a/testing/ostest/sigev_thread.c +++ b/testing/ostest/sigev_thread.c @@ -35,10 +35,6 @@ * Private Definitions ****************************************************************************/ -#ifndef NULL -# define NULL (void*)0 -#endif - #define MY_TIMER_SIGNAL 17 #define SIGVALUE_INT 42 diff --git a/testing/ostest/sighand.c b/testing/ostest/sighand.c index d4e0310a1..134c9b5f2 100644 --- a/testing/ostest/sighand.c +++ b/testing/ostest/sighand.c @@ -36,10 +36,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef NULL -# define NULL (void*)0 -#endif - #define WAKEUP_SIGNAL 17 #define SIGVALUE_INT 42 diff --git a/testing/ostest/signest.c b/testing/ostest/signest.c index 751d60cb4..5f6f81945 100644 --- a/testing/ostest/signest.c +++ b/testing/ostest/signest.c @@ -37,10 +37,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef NULL -# define NULL (void*)0 -#endif - #define WAKEUP_SIGNAL 17 #define SIGVALUE_INT 42 diff --git a/testing/ostest/specific.c b/testing/ostest/specific.c index 5807bb52a..eca1695f9 100644 --- a/testing/ostest/specific.c +++ b/testing/ostest/specific.c @@ -30,10 +30,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef NULL -# define NULL (void*)0 -#endif - #define NLOOPS 32 /**************************************************************************** diff --git a/testing/ostest/timedmutex.c b/testing/ostest/timedmutex.c index ed995954a..44526a8f2 100644 --- a/testing/ostest/timedmutex.c +++ b/testing/ostest/timedmutex.c @@ -34,14 +34,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef NULL -# define NULL (void*)0 -#endif - -#ifndef OK -# define OK 0 -#endif - /**************************************************************************** * Private Data ****************************************************************************/