From dbde088d98a470b2c417e27f70b8b92f2b02c822 Mon Sep 17 00:00:00 2001 From: Arun Thomas Date: Thu, 22 Jul 2010 10:03:31 +0000 Subject: [PATCH] Replace NULL macro defs with null.h include --- commands/elvis/opts.c | 4 +--- commands/postmort/postmort.c | 1 - drivers/dec21140A/dec21140A.h | 3 +-- drivers/dpeth/dp.h | 4 ++-- include/locale.h | 2 +- include/minix/const.h | 3 ++- include/stddef.h | 2 +- include/stdio.h | 3 ++- include/stdlib.h | 3 +-- include/time.h | 4 ++-- include/unistd.h | 2 +- lib/libtimers/timers.h | 3 +-- 12 files changed, 15 insertions(+), 19 deletions(-) diff --git a/commands/elvis/opts.c b/commands/elvis/opts.c index 0d72ba58d..7552ac6fb 100644 --- a/commands/elvis/opts.c +++ b/commands/elvis/opts.c @@ -15,9 +15,7 @@ #include "config.h" #include "vi.h" #include "ctype.h" -#ifndef NULL -#define NULL (char *)0 -#endif +#include extern char *getenv(); /* maximum width to permit for strings, including ="" */ diff --git a/commands/postmort/postmort.c b/commands/postmort/postmort.c index 5246afaad..96a3fefda 100644 --- a/commands/postmort/postmort.c +++ b/commands/postmort/postmort.c @@ -45,7 +45,6 @@ #include #include #include -#undef NULL #include #include diff --git a/drivers/dec21140A/dec21140A.h b/drivers/dec21140A/dec21140A.h index cf7ff895f..9b6778132 100644 --- a/drivers/dec21140A/dec21140A.h +++ b/drivers/dec21140A/dec21140A.h @@ -9,11 +9,10 @@ by VirtualPC 2007 Created: 09/01/2009 Nicolas Tittley (first.last @ gmail DOT com) */ +#include #define DE_FKEY 8 /* Shitf+ this value will dump info on console */ -#undef NULL -#define NULL ((void *)0) #define NOT(x) (~(x)) #if debug == 1 diff --git a/drivers/dpeth/dp.h b/drivers/dpeth/dp.h index a13c96ce0..41c1cf074 100644 --- a/drivers/dpeth/dp.h +++ b/drivers/dpeth/dp.h @@ -31,6 +31,8 @@ ** Initial revision for Minix 3.0.6 */ +#include + #undef ENABLE_3C501 #undef ENABLE_3C503 #undef ENABLE_3C509 @@ -47,8 +49,6 @@ #define ENABLE_DP8390 (ENABLE_3C503|ENABLE_WDETH|ENABLE_NE2000) #define HAVE_BUFFERS (ENABLE_3C501|ENABLE_3C509) -#undef NULL -#define NULL ((void *)0) #define NOT(x) (~(x)) #if debug == 1 diff --git a/include/locale.h b/include/locale.h index ed1d042bd..d06a2def0 100644 --- a/include/locale.h +++ b/include/locale.h @@ -31,7 +31,7 @@ struct lconv { char n_sign_posn; /* CHAR_MAX */ }; -#define NULL ((void *)0) +#include #define LC_ALL 1 #define LC_COLLATE 2 diff --git a/include/minix/const.h b/include/minix/const.h index ce4159e30..393f4b4be 100644 --- a/include/minix/const.h +++ b/include/minix/const.h @@ -44,7 +44,8 @@ #define SUPER_USER ((uid_t) 0) /* uid_t of superuser */ -#define NULL ((void *)0) /* null pointer */ +#include /* NULL Pointer */ + #define SCPVEC_NR 64 /* max # of entries in a SYS_VSAFECOPY* request */ #define NR_IOREQS 64 /* maximum number of entries in an iorequest */ diff --git a/include/stddef.h b/include/stddef.h index b6ab471d1..bfd6e2cee 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -3,7 +3,7 @@ #ifndef _STDDEF_H #define _STDDEF_H -#define NULL ((void *)0) +#include /* The following is not portable, but the compiler accepts it. */ #define offsetof(type, ident) ((size_t) (unsigned long) &((type *)0)->ident) diff --git a/include/stdio.h b/include/stdio.h index de6dc7dcd..cb2f5c3a6 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -13,6 +13,8 @@ #include #endif +#include /* For NULL */ + /* * Focus point of all stdio activity. */ @@ -50,7 +52,6 @@ typedef struct __iobuf { #define stderr (&__stderr) #define BUFSIZ 4096 -#define NULL ((void *)0) #define EOF (-1) #define FOPEN_MAX 20 diff --git a/include/stdlib.h b/include/stdlib.h index c6f677afc..3d74ee6a0 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -7,8 +7,7 @@ #include #endif -/* The macros are NULL, EXIT_FAILURE, EXIT_SUCCESS, RAND_MAX, and MB_CUR_MAX.*/ -#define NULL ((void *)0) +#include #define EXIT_FAILURE 1 /* standard error return using exit() */ #define EXIT_SUCCESS 0 /* successful return using exit() */ diff --git a/include/time.h b/include/time.h index bf9ce68a3..75fa93b0c 100644 --- a/include/time.h +++ b/include/time.h @@ -9,14 +9,14 @@ #ifndef _TIME_H #define _TIME_H +#include + #define CLOCKS_PER_SEC 60 #ifdef _POSIX_SOURCE #define CLK_TCK CLOCKS_PER_SEC /* obsolescent mame for CLOCKS_PER_SEC */ #endif -#define NULL ((void *)0) - #ifndef _SIZE_T #define _SIZE_T typedef unsigned int size_t; diff --git a/include/unistd.h b/include/unistd.h index 422e6d300..230df6e5c 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -55,7 +55,7 @@ #define SI_PROCPUB_TAB 11 /* copy of public entries of process table */ /* NULL must be defined in according to POSIX Sec. 2.7.1. */ -#define NULL ((void *)0) +#include /* The following relate to configurable system variables. POSIX Table 4-2. */ #define _SC_ARG_MAX 1 diff --git a/lib/libtimers/timers.h b/lib/libtimers/timers.h index c9a38cd05..78a8833a4 100644 --- a/lib/libtimers/timers.h +++ b/lib/libtimers/timers.h @@ -3,5 +3,4 @@ */ #include /* definitions and function prototypes */ -#define NULL (void *) 0 /* null-pointer definition */ - +#include -- 2.44.0