Replace NULL macro defs with null.h include

This commit is contained in:
Arun Thomas 2010-07-22 10:03:31 +00:00
parent 62d44dc9ef
commit dbde088d98
12 changed files with 15 additions and 19 deletions

View file

@ -15,9 +15,7 @@
#include "config.h" #include "config.h"
#include "vi.h" #include "vi.h"
#include "ctype.h" #include "ctype.h"
#ifndef NULL #include <sys/null.h>
#define NULL (char *)0
#endif
extern char *getenv(); extern char *getenv();
/* maximum width to permit for strings, including ="" */ /* maximum width to permit for strings, including ="" */

View file

@ -45,7 +45,6 @@
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#undef NULL
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>

View file

@ -9,11 +9,10 @@ by VirtualPC 2007
Created: 09/01/2009 Nicolas Tittley (first.last @ gmail DOT com) Created: 09/01/2009 Nicolas Tittley (first.last @ gmail DOT com)
*/ */
#include <sys/null.h>
#define DE_FKEY 8 /* Shitf+ this value will dump info on console */ #define DE_FKEY 8 /* Shitf+ this value will dump info on console */
#undef NULL
#define NULL ((void *)0)
#define NOT(x) (~(x)) #define NOT(x) (~(x))
#if debug == 1 #if debug == 1

View file

@ -31,6 +31,8 @@
** Initial revision for Minix 3.0.6 ** Initial revision for Minix 3.0.6
*/ */
#include <sys/null.h>
#undef ENABLE_3C501 #undef ENABLE_3C501
#undef ENABLE_3C503 #undef ENABLE_3C503
#undef ENABLE_3C509 #undef ENABLE_3C509
@ -47,8 +49,6 @@
#define ENABLE_DP8390 (ENABLE_3C503|ENABLE_WDETH|ENABLE_NE2000) #define ENABLE_DP8390 (ENABLE_3C503|ENABLE_WDETH|ENABLE_NE2000)
#define HAVE_BUFFERS (ENABLE_3C501|ENABLE_3C509) #define HAVE_BUFFERS (ENABLE_3C501|ENABLE_3C509)
#undef NULL
#define NULL ((void *)0)
#define NOT(x) (~(x)) #define NOT(x) (~(x))
#if debug == 1 #if debug == 1

View file

@ -31,7 +31,7 @@ struct lconv {
char n_sign_posn; /* CHAR_MAX */ char n_sign_posn; /* CHAR_MAX */
}; };
#define NULL ((void *)0) #include <sys/null.h>
#define LC_ALL 1 #define LC_ALL 1
#define LC_COLLATE 2 #define LC_COLLATE 2

View file

@ -44,7 +44,8 @@
#define SUPER_USER ((uid_t) 0) /* uid_t of superuser */ #define SUPER_USER ((uid_t) 0) /* uid_t of superuser */
#define NULL ((void *)0) /* null pointer */ #include <sys/null.h> /* NULL Pointer */
#define SCPVEC_NR 64 /* max # of entries in a SYS_VSAFECOPY* request */ #define SCPVEC_NR 64 /* max # of entries in a SYS_VSAFECOPY* request */
#define NR_IOREQS 64 #define NR_IOREQS 64
/* maximum number of entries in an iorequest */ /* maximum number of entries in an iorequest */

View file

@ -3,7 +3,7 @@
#ifndef _STDDEF_H #ifndef _STDDEF_H
#define _STDDEF_H #define _STDDEF_H
#define NULL ((void *)0) #include <sys/null.h>
/* The following is not portable, but the compiler accepts it. */ /* The following is not portable, but the compiler accepts it. */
#define offsetof(type, ident) ((size_t) (unsigned long) &((type *)0)->ident) #define offsetof(type, ident) ((size_t) (unsigned long) &((type *)0)->ident)

View file

@ -13,6 +13,8 @@
#include <ansi.h> #include <ansi.h>
#endif #endif
#include <sys/null.h> /* For NULL */
/* /*
* Focus point of all stdio activity. * Focus point of all stdio activity.
*/ */
@ -50,7 +52,6 @@ typedef struct __iobuf {
#define stderr (&__stderr) #define stderr (&__stderr)
#define BUFSIZ 4096 #define BUFSIZ 4096
#define NULL ((void *)0)
#define EOF (-1) #define EOF (-1)
#define FOPEN_MAX 20 #define FOPEN_MAX 20

View file

@ -7,8 +7,7 @@
#include <ansi.h> #include <ansi.h>
#endif #endif
/* The macros are NULL, EXIT_FAILURE, EXIT_SUCCESS, RAND_MAX, and MB_CUR_MAX.*/ #include <sys/null.h>
#define NULL ((void *)0)
#define EXIT_FAILURE 1 /* standard error return using exit() */ #define EXIT_FAILURE 1 /* standard error return using exit() */
#define EXIT_SUCCESS 0 /* successful return using exit() */ #define EXIT_SUCCESS 0 /* successful return using exit() */

View file

@ -9,14 +9,14 @@
#ifndef _TIME_H #ifndef _TIME_H
#define _TIME_H #define _TIME_H
#include <sys/null.h>
#define CLOCKS_PER_SEC 60 #define CLOCKS_PER_SEC 60
#ifdef _POSIX_SOURCE #ifdef _POSIX_SOURCE
#define CLK_TCK CLOCKS_PER_SEC /* obsolescent mame for CLOCKS_PER_SEC */ #define CLK_TCK CLOCKS_PER_SEC /* obsolescent mame for CLOCKS_PER_SEC */
#endif #endif
#define NULL ((void *)0)
#ifndef _SIZE_T #ifndef _SIZE_T
#define _SIZE_T #define _SIZE_T
typedef unsigned int size_t; typedef unsigned int size_t;

View file

@ -55,7 +55,7 @@
#define SI_PROCPUB_TAB 11 /* copy of public entries of process table */ #define SI_PROCPUB_TAB 11 /* copy of public entries of process table */
/* NULL must be defined in <unistd.h> according to POSIX Sec. 2.7.1. */ /* NULL must be defined in <unistd.h> according to POSIX Sec. 2.7.1. */
#define NULL ((void *)0) #include <sys/null.h>
/* The following relate to configurable system variables. POSIX Table 4-2. */ /* The following relate to configurable system variables. POSIX Table 4-2. */
#define _SC_ARG_MAX 1 #define _SC_ARG_MAX 1

View file

@ -3,5 +3,4 @@
*/ */
#include <timers.h> /* definitions and function prototypes */ #include <timers.h> /* definitions and function prototypes */
#define NULL (void *) 0 /* null-pointer definition */ #include <sys/null.h>