You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/11/29 17:14:51 UTC

[incubator-nuttx-apps] branch master updated: testing/ostest: remove spurious redefinitions of NULL

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 0c21a89  testing/ostest: remove spurious redefinitions of NULL
0c21a89 is described below

commit 0c21a89a3f50b20e85651fa8c7a4c4e07ef8b7b5
Author: Juha Niskanen <ju...@haltian.com>
AuthorDate: Mon Nov 29 17:00:43 2021 +0200

    testing/ostest: remove spurious redefinitions of NULL
    
    Signed-off-by: Juha Niskanen <ju...@haltian.com>
---
 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 8fc3432..f04f6db 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 2daecc8..b7d1946 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 f4e983c..68b7808 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 bc933be..faa92e5 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 c9ca504..eb5cbed 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 91bbd13..f4ef058 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 ad45013..8e36c97 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 1e95d77..c35b817 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 d4e0310..134c9b5 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 751d60c..5f6f819 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 5807bb5..eca1695 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 ed99595..44526a8 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
  ****************************************************************************/