You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/07/31 19:13:03 UTC

[incubator-nuttx] branch master updated: Remove the private NULL, TRUE and FALSE macros

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

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


The following commit(s) were added to refs/heads/master by this push:
     new c26bb35843 Remove the private NULL, TRUE and FALSE macros
c26bb35843 is described below

commit c26bb358432d8137a733ddab702e78046faedabf
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Jul 31 21:53:52 2022 +0800

    Remove the private NULL, TRUE and FALSE macros
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 arch/arm/src/lc823450/lc823450_sddrv_type.h            |  4 ----
 arch/arm/src/lpc43xx/spifi/src/spifilib_dev_common.c   |  4 ----
 arch/arm/src/phy62xx/types.h                           | 12 ------------
 arch/arm/src/sama5/sam_usbhost.c                       |  4 ----
 arch/arm/src/samd5e5/sam_usbhost.c                     |  4 ----
 arch/arm/src/stm32/stm32_usbhost.c                     |  4 ----
 arch/arm/src/stm32l4/stm32l4_usbhost_trace.c           |  4 ----
 arch/renesas/src/rx65n/rx65n_macrodriver.h             | 16 ----------------
 boards/arm/kinetis/freedom-k28f/src/k28_automount.c    | 12 ------------
 boards/arm/kinetis/freedom-k64f/src/k64_automount.c    | 12 ------------
 boards/arm/kinetis/freedom-k66f/src/k66_automount.c    | 12 ------------
 boards/arm/sama5/sama5d4-ek/src/sam_automount.c        | 12 ------------
 boards/arm/samd5e5/metro-m4/include/board.h            |  8 --------
 boards/arm/samd5e5/metro-m4/src/sam_automount.c        | 12 ------------
 boards/arm/samd5e5/same54-xplained-pro/include/board.h |  8 --------
 mm/iob/iob_add_queue.c                                 |  8 --------
 mm/iob/iob_free_queue.c                                |  8 --------
 mm/iob/iob_free_queue_qentry.c                         |  8 --------
 mm/iob/iob_initialize.c                                |  8 --------
 mm/iob/iob_peek_queue.c                                |  8 --------
 mm/iob/iob_remove_queue.c                              |  8 --------
 mm/iob/iob_trimhead.c                                  |  8 --------
 mm/iob/iob_trimhead_queue.c                            |  8 --------
 mm/mm_heap/mm_malloc.c                                 |  8 --------
 24 files changed, 200 deletions(-)

diff --git a/arch/arm/src/lc823450/lc823450_sddrv_type.h b/arch/arm/src/lc823450/lc823450_sddrv_type.h
index a2820bd2b3..7b49033d8b 100644
--- a/arch/arm/src/lc823450/lc823450_sddrv_type.h
+++ b/arch/arm/src/lc823450/lc823450_sddrv_type.h
@@ -41,10 +41,6 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#ifndef NULL
-#  define NULL        ((void * ) 0)
-#endif
-
 #define TRUE_T        (1)       /* true */
 #define FALSE_T       (0)       /* false */
 
diff --git a/arch/arm/src/lpc43xx/spifi/src/spifilib_dev_common.c b/arch/arm/src/lpc43xx/spifi/src/spifilib_dev_common.c
index be45d5a223..91827e28bf 100644
--- a/arch/arm/src/lpc43xx/spifi/src/spifilib_dev_common.c
+++ b/arch/arm/src/lpc43xx/spifi/src/spifilib_dev_common.c
@@ -39,10 +39,6 @@
  * Private types
  ****************************************************************************/
 
-#ifndef NULL
-#define NULL 0L
-#endif
-
 /* Declare the version numbers */
 
 #define LIBRARY_VERSION_MAJOR (1)
diff --git a/arch/arm/src/phy62xx/types.h b/arch/arm/src/phy62xx/types.h
index 9f4c828282..f1290aa182 100644
--- a/arch/arm/src/phy62xx/types.h
+++ b/arch/arm/src/phy62xx/types.h
@@ -128,18 +128,6 @@ typedef uint8           halDataAlign_t; /* !< Used for byte alignment */
  *   ------------------------------------------------------------------------
  */
 
-#ifndef TRUE
-    #define TRUE 1
-#endif
-
-#ifndef FALSE
-    #define FALSE 0
-#endif
-
-#ifndef NULL
-    #define NULL 0
-#endif
-
 #define HAL_WAIT_CONDITION(condition)  {while(!(condition)){}}
 
 #define HAL_WAIT_CONDITION_TIMEOUT(condition, timeout)  {\
diff --git a/arch/arm/src/sama5/sam_usbhost.c b/arch/arm/src/sama5/sam_usbhost.c
index e82fb17b65..629aab676d 100644
--- a/arch/arm/src/sama5/sam_usbhost.c
+++ b/arch/arm/src/sama5/sam_usbhost.c
@@ -46,10 +46,6 @@
 
 #define TRENTRY(id,ehci,fmt1,string) {string}
 
-#ifndef NULL
-#  define NULL ((void *)0)
-#endif
-
 /****************************************************************************
  * Private Types
  ****************************************************************************/
diff --git a/arch/arm/src/samd5e5/sam_usbhost.c b/arch/arm/src/samd5e5/sam_usbhost.c
index dc5ceade65..6a926ddd77 100644
--- a/arch/arm/src/samd5e5/sam_usbhost.c
+++ b/arch/arm/src/samd5e5/sam_usbhost.c
@@ -42,10 +42,6 @@
 
 #define TRENTRY(id,fmt1,string) {string}
 
-#ifndef NULL
-#  define NULL ((void *)0)
-#endif
-
 /****************************************************************************
  * Private Types
  ****************************************************************************/
diff --git a/arch/arm/src/stm32/stm32_usbhost.c b/arch/arm/src/stm32/stm32_usbhost.c
index 002968aa66..91e24dbd3a 100644
--- a/arch/arm/src/stm32/stm32_usbhost.c
+++ b/arch/arm/src/stm32/stm32_usbhost.c
@@ -41,10 +41,6 @@
 
 #define TRENTRY(id,fmt1,string) {string}
 
-#ifndef NULL
-#  define NULL ((void *)0)
-#endif
-
 /****************************************************************************
  * Private Types
  ****************************************************************************/
diff --git a/arch/arm/src/stm32l4/stm32l4_usbhost_trace.c b/arch/arm/src/stm32l4/stm32l4_usbhost_trace.c
index f3f8a6bc8b..e2d802426e 100644
--- a/arch/arm/src/stm32l4/stm32l4_usbhost_trace.c
+++ b/arch/arm/src/stm32l4/stm32l4_usbhost_trace.c
@@ -41,10 +41,6 @@
 
 #define TRENTRY(id,fmt1,string) {string}
 
-#ifndef NULL
-#  define NULL ((void *)0)
-#endif
-
 /****************************************************************************
  * Private Types
  ****************************************************************************/
diff --git a/arch/renesas/src/rx65n/rx65n_macrodriver.h b/arch/renesas/src/rx65n/rx65n_macrodriver.h
index fbfac12094..b3e2ed5998 100644
--- a/arch/renesas/src/rx65n/rx65n_macrodriver.h
+++ b/arch/renesas/src/rx65n/rx65n_macrodriver.h
@@ -27,22 +27,6 @@
 
 #include "arch/rx65n/iodefine.h"
 
-#ifndef TRUE
-#define TRUE (1)
-#else
-#if (1 != TRUE)
-#error "TRUE is not defined by 1."
-#endif
-#endif
-
-#ifndef FALSE
-#define FALSE (0)
-#else
-#if (0 != FALSE)
-#error "FALSE is not defined by 0."
-#endif
-#endif
-
 #ifndef __TYPEDEF__
 
 /* Status list definition */
diff --git a/boards/arm/kinetis/freedom-k28f/src/k28_automount.c b/boards/arm/kinetis/freedom-k28f/src/k28_automount.c
index 6b0f831b5d..aa713ee503 100644
--- a/boards/arm/kinetis/freedom-k28f/src/k28_automount.c
+++ b/boards/arm/kinetis/freedom-k28f/src/k28_automount.c
@@ -39,18 +39,6 @@
 
 #ifdef HAVE_SDHC_AUTOMOUNTER
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL (void *)0
-#endif
-
-#ifndef OK
-#  define OK 0
-#endif
-
 /****************************************************************************
  * Private Types
  ****************************************************************************/
diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_automount.c b/boards/arm/kinetis/freedom-k64f/src/k64_automount.c
index 38aa93bf63..35efbe2519 100644
--- a/boards/arm/kinetis/freedom-k64f/src/k64_automount.c
+++ b/boards/arm/kinetis/freedom-k64f/src/k64_automount.c
@@ -39,18 +39,6 @@
 
 #ifdef HAVE_AUTOMOUNTER
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL (void *)0
-#endif
-
-#ifndef OK
-#  define OK 0
-#endif
-
 /****************************************************************************
  * Private Types
  ****************************************************************************/
diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_automount.c b/boards/arm/kinetis/freedom-k66f/src/k66_automount.c
index 447d2cc223..397fcd4e0e 100644
--- a/boards/arm/kinetis/freedom-k66f/src/k66_automount.c
+++ b/boards/arm/kinetis/freedom-k66f/src/k66_automount.c
@@ -39,18 +39,6 @@
 
 #ifdef HAVE_AUTOMOUNTER
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL (void *)0
-#endif
-
-#ifndef OK
-#  define OK 0
-#endif
-
 /****************************************************************************
  * Private Types
  ****************************************************************************/
diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_automount.c b/boards/arm/sama5/sama5d4-ek/src/sam_automount.c
index 9601c457ac..737c632473 100644
--- a/boards/arm/sama5/sama5d4-ek/src/sam_automount.c
+++ b/boards/arm/sama5/sama5d4-ek/src/sam_automount.c
@@ -39,18 +39,6 @@
 
 #ifdef HAVE_AUTOMOUNTER
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL (void *)0
-#endif
-
-#ifndef OK
-#  define OK 0
-#endif
-
 /****************************************************************************
  * Private Types
  ****************************************************************************/
diff --git a/boards/arm/samd5e5/metro-m4/include/board.h b/boards/arm/samd5e5/metro-m4/include/board.h
index fa9fb07b81..a239c9a860 100644
--- a/boards/arm/samd5e5/metro-m4/include/board.h
+++ b/boards/arm/samd5e5/metro-m4/include/board.h
@@ -31,14 +31,6 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#ifndef TRUE
-#  define TRUE  1
-#endif
-
-#ifndef FALSE
-#  define FALSE 0
-#endif
-
 /* Clocking *****************************************************************/
 
 /* Overview
diff --git a/boards/arm/samd5e5/metro-m4/src/sam_automount.c b/boards/arm/samd5e5/metro-m4/src/sam_automount.c
index ff81bdf579..d20cf39a60 100644
--- a/boards/arm/samd5e5/metro-m4/src/sam_automount.c
+++ b/boards/arm/samd5e5/metro-m4/src/sam_automount.c
@@ -39,18 +39,6 @@
 
 #ifdef CONFIG_FS_AUTOMOUNTER
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL (void *)0
-#endif
-
-#ifndef OK
-#  define OK 0
-#endif
-
 /****************************************************************************
  * Private Types
  ****************************************************************************/
diff --git a/boards/arm/samd5e5/same54-xplained-pro/include/board.h b/boards/arm/samd5e5/same54-xplained-pro/include/board.h
index d9eebdccac..94571684a8 100644
--- a/boards/arm/samd5e5/same54-xplained-pro/include/board.h
+++ b/boards/arm/samd5e5/same54-xplained-pro/include/board.h
@@ -31,14 +31,6 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#ifndef TRUE
-#  define TRUE  1
-#endif
-
-#ifndef FALSE
-#  define FALSE 0
-#endif
-
 /* Clocking *****************************************************************/
 
 /* Overview
diff --git a/mm/iob/iob_add_queue.c b/mm/iob/iob_add_queue.c
index da8ca00936..4a5ffea2d0 100644
--- a/mm/iob/iob_add_queue.c
+++ b/mm/iob/iob_add_queue.c
@@ -36,14 +36,6 @@
 
 #if CONFIG_IOB_NCHAINS > 0
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL ((FAR void *)0)
-#endif
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/mm/iob/iob_free_queue.c b/mm/iob/iob_free_queue.c
index 81362604d1..526be445db 100644
--- a/mm/iob/iob_free_queue.c
+++ b/mm/iob/iob_free_queue.c
@@ -32,14 +32,6 @@
 
 #if CONFIG_IOB_NCHAINS > 0
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL ((FAR void *)0)
-#endif
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
diff --git a/mm/iob/iob_free_queue_qentry.c b/mm/iob/iob_free_queue_qentry.c
index 07f0ebbe53..1597418f5b 100644
--- a/mm/iob/iob_free_queue_qentry.c
+++ b/mm/iob/iob_free_queue_qentry.c
@@ -33,14 +33,6 @@
 
 #if CONFIG_IOB_NCHAINS > 0
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL ((FAR void *)0)
-#endif
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
diff --git a/mm/iob/iob_initialize.c b/mm/iob/iob_initialize.c
index ea54a13a12..af76cdc226 100644
--- a/mm/iob/iob_initialize.c
+++ b/mm/iob/iob_initialize.c
@@ -30,14 +30,6 @@
 
 #include "iob.h"
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL ((FAR void *)0)
-#endif
-
 /****************************************************************************
  * Private Data
  ****************************************************************************/
diff --git a/mm/iob/iob_peek_queue.c b/mm/iob/iob_peek_queue.c
index 4912cd22d0..ca6468ef73 100644
--- a/mm/iob/iob_peek_queue.c
+++ b/mm/iob/iob_peek_queue.c
@@ -32,14 +32,6 @@
 
 #if CONFIG_IOB_NCHAINS > 0
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL ((FAR void *)0)
-#endif
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
diff --git a/mm/iob/iob_remove_queue.c b/mm/iob/iob_remove_queue.c
index 7931d362f0..04953867c1 100644
--- a/mm/iob/iob_remove_queue.c
+++ b/mm/iob/iob_remove_queue.c
@@ -34,14 +34,6 @@
 
 #if CONFIG_IOB_NCHAINS > 0
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL ((FAR void *)0)
-#endif
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
diff --git a/mm/iob/iob_trimhead.c b/mm/iob/iob_trimhead.c
index db72bc69ab..2b176a08ce 100644
--- a/mm/iob/iob_trimhead.c
+++ b/mm/iob/iob_trimhead.c
@@ -31,14 +31,6 @@
 
 #include "iob.h"
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL ((FAR void *)0)
-#endif
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
diff --git a/mm/iob/iob_trimhead_queue.c b/mm/iob/iob_trimhead_queue.c
index 85fc59c6fc..906d0fc484 100644
--- a/mm/iob/iob_trimhead_queue.c
+++ b/mm/iob/iob_trimhead_queue.c
@@ -33,14 +33,6 @@
 
 #if CONFIG_IOB_NCHAINS > 0
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL ((FAR void *)0)
-#endif
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
diff --git a/mm/mm_heap/mm_malloc.c b/mm/mm_heap/mm_malloc.c
index 34e64d7041..72b40c9b8b 100644
--- a/mm/mm_heap/mm_malloc.c
+++ b/mm/mm_heap/mm_malloc.c
@@ -36,14 +36,6 @@
 #include "mm_heap/mm.h"
 #include "kasan/kasan.h"
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifndef NULL
-#  define NULL ((void *)0)
-#endif
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/