From: Sascha Wildner Date: Thu, 5 Jun 2008 18:01:49 +0000 (+0000) Subject: Remove some unneeded definitions of NULL. X-Git-Url: https://gitweb.dragonflybsd.org/~syl/dragonfly.git/commitdiff_plain/598554d928d5a42d199d655664731153b8e2acc9 Remove some unneeded definitions of NULL. --- diff --git a/games/hack/hack.mon.c b/games/hack/hack.mon.c index 024e22dddf..79a491838e 100644 --- a/games/hack/hack.mon.c +++ b/games/hack/hack.mon.c @@ -1,15 +1,11 @@ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.mon.c - version 1.0.3 */ /* $FreeBSD: src/games/hack/hack.mon.c,v 1.5 1999/11/16 10:26:37 marcel Exp $ */ -/* $DragonFly: src/games/hack/hack.mon.c,v 1.5 2006/08/21 19:45:32 pavalos Exp $ */ +/* $DragonFly: src/games/hack/hack.mon.c,v 1.6 2008/06/05 18:01:49 swildner Exp $ */ #include "hack.h" #include "hack.mfndpos.h" -#ifndef NULL -#define NULL (char *) 0 -#endif - int warnlevel; /* used by movemon and dochugw */ long lastwarntime; int lastwarnlev; diff --git a/gnu/lib/libregex/regex.c b/gnu/lib/libregex/regex.c index 335e5d3fca..dc25cb31de 100644 --- a/gnu/lib/libregex/regex.c +++ b/gnu/lib/libregex/regex.c @@ -20,6 +20,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* AIX requires this to be the first thing in the file. */ + +/* $DragonFly: src/gnu/lib/libregex/regex.c,v 1.2 2008/06/05 18:01:49 swildner Exp $ */ + #if defined (_AIX) && !defined (REGEX_MALLOC) #pragma alloca #endif @@ -168,10 +171,6 @@ init_syntax_once () #define ISUPPER(c) (isascii (c) && isupper (c)) #define ISXDIGIT(c) (isascii (c) && isxdigit (c)) -#ifndef NULL -#define NULL 0 -#endif - /* We remove any previous definition of `SIGN_EXTEND_CHAR', since ours (we hope) works properly with all combinations of machines, compilers, `char' and `unsigned char' argument types. diff --git a/gnu/lib/libregex/test/alloca.c b/gnu/lib/libregex/test/alloca.c index 92347a9f2f..1fcca5f65b 100644 --- a/gnu/lib/libregex/test/alloca.c +++ b/gnu/lib/libregex/test/alloca.c @@ -30,6 +30,8 @@ * @(#)alloca.c 1.1 */ +/* $DragonFly: src/gnu/lib/libregex/test/alloca.c,v 1.3 2008/06/05 18:01:49 swildner Exp $ */ + #ifdef emacs #include "config.h" #ifdef static @@ -53,8 +55,6 @@ typedef void *pointer; /* generic pointer type */ typedef char *pointer; /* generic pointer type */ #endif -#define NULL 0 /* null pointer constant */ - extern void free(); extern pointer xmalloc(); diff --git a/gnu/lib/libregex/test/malloc-test.c b/gnu/lib/libregex/test/malloc-test.c index 7e27a15a89..3d51e463d7 100644 --- a/gnu/lib/libregex/test/malloc-test.c +++ b/gnu/lib/libregex/test/malloc-test.c @@ -1,4 +1,4 @@ - +/* $DragonFly: src/gnu/lib/libregex/test/malloc-test.c,v 1.2 2008/06/05 18:01:49 swildner Exp $ */ typedef struct { unsigned *bits; @@ -6,7 +6,6 @@ typedef struct { } bits_list_type; #define BYTEWIDTH 8 -#define NULL 0 #define BITS_BLOCK_SIZE (sizeof (unsigned) * BYTEWIDTH) #define BITS_BLOCK(position) ((position) / BITS_BLOCK_SIZE) diff --git a/gnu/lib/libregex/test/xmalloc.c b/gnu/lib/libregex/test/xmalloc.c index aa1c6c44f7..d135bc4e87 100644 --- a/gnu/lib/libregex/test/xmalloc.c +++ b/gnu/lib/libregex/test/xmalloc.c @@ -1,10 +1,8 @@ +/* $DragonFly: src/gnu/lib/libregex/test/xmalloc.c,v 1.2 2008/06/05 18:01:49 swildner Exp $ */ + #include extern char *malloc (); -#ifndef NULL -#define NULL 0 -#endif - void * xmalloc (size) unsigned size; diff --git a/gnu/usr.bin/grep/getopt1.c b/gnu/usr.bin/grep/getopt1.c index 9c8256567c..3cfd8f72ff 100644 --- a/gnu/usr.bin/grep/getopt1.c +++ b/gnu/usr.bin/grep/getopt1.c @@ -1,3 +1,5 @@ +/* $DragonFly: src/gnu/usr.bin/grep/getopt1.c,v 1.2 2008/06/05 18:01:49 swildner Exp $ */ + /* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. @@ -59,10 +61,6 @@ #include #endif -#ifndef NULL -#define NULL 0 -#endif - int getopt_long (argc, argv, options, long_options, opt_index) int argc; diff --git a/gnu/usr.bin/sort/getopt1.c b/gnu/usr.bin/sort/getopt1.c index 4580211cfa..6a8914a9d3 100644 --- a/gnu/usr.bin/sort/getopt1.c +++ b/gnu/usr.bin/sort/getopt1.c @@ -1,3 +1,5 @@ +/* $DragonFly: src/gnu/usr.bin/sort/getopt1.c,v 1.2 2008/06/05 18:01:49 swildner Exp $ */ + /* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994 Free Software Foundation, Inc. @@ -51,10 +53,6 @@ char *getenv (); #endif -#ifndef NULL -#define NULL 0 -#endif - int getopt_long (argc, argv, options, long_options, opt_index) int argc; diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h index ea80e60e78..1594d8b736 100644 --- a/lib/libstand/stand.h +++ b/lib/libstand/stand.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libstand/stand.h,v 1.18.2.8 2002/06/17 11:22:39 sobomax Exp $ - * $DragonFly: src/lib/libstand/stand.h,v 1.9 2007/06/18 05:13:37 dillon Exp $ + * $DragonFly: src/lib/libstand/stand.h,v 1.10 2008/06/05 18:01:49 swildner Exp $ * From $NetBSD: stand.h,v 1.22 1997/06/26 19:17:40 drochner Exp $ */ @@ -75,10 +75,6 @@ #define CHK(fmt, args...) printf("%s(%d): " fmt "\n", __func__, __LINE__ , ##args) #define PCHK(fmt, args...) {printf("%s(%d): " fmt "\n", __func__, __LINE__ , ##args); getchar();} -#ifndef NULL -#define NULL 0 -#endif - /* Avoid unwanted userlandish components */ #define _KERNEL #include diff --git a/lib/libstand/zalloc_defs.h b/lib/libstand/zalloc_defs.h index 0a185b9fa2..82fe2ac785 100644 --- a/lib/libstand/zalloc_defs.h +++ b/lib/libstand/zalloc_defs.h @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libstand/zalloc_defs.h,v 1.6 1999/08/28 00:05:35 peter Exp $ - * $DragonFly: src/lib/libstand/zalloc_defs.h,v 1.3 2005/03/13 15:10:03 swildner Exp $ + * $DragonFly: src/lib/libstand/zalloc_defs.h,v 1.4 2008/06/05 18:01:49 swildner Exp $ */ /* @@ -52,10 +52,6 @@ typedef int saddr_t; /* signed int same size as pointer */ #define Prototype extern #define Library extern -#ifndef NULL -#define NULL ((void *)0) -#endif - /* * block extension for sbrk() */ diff --git a/libexec/bootpd/getether.c b/libexec/bootpd/getether.c index 650014d3f6..f77735678b 100644 --- a/libexec/bootpd/getether.c +++ b/libexec/bootpd/getether.c @@ -8,7 +8,7 @@ * please let me know. * * $FreeBSD: src/libexec/bootpd/getether.c,v 1.9.2.3 2003/02/15 05:36:01 kris Exp $ - * $DragonFly: src/libexec/bootpd/getether.c,v 1.3 2004/02/13 03:49:47 dillon Exp $ + * $DragonFly: src/libexec/bootpd/getether.c,v 1.4 2008/06/05 18:01:49 swildner Exp $ */ #include @@ -181,9 +181,6 @@ getether(ifname, eap) #include #include #include -#ifndef NULL -#define NULL 0 -#endif int getether(ifname, eap) diff --git a/libexec/bootpd/hash.c b/libexec/bootpd/hash.c index aab203579c..dd8a852ac6 100644 --- a/libexec/bootpd/hash.c +++ b/libexec/bootpd/hash.c @@ -20,7 +20,7 @@ ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. $FreeBSD: src/libexec/bootpd/hash.c,v 1.5 1999/08/28 00:09:18 peter Exp $ - $DragonFly: src/libexec/bootpd/hash.c,v 1.2 2003/06/17 04:27:07 dillon Exp $ + $DragonFly: src/libexec/bootpd/hash.c,v 1.3 2008/06/05 18:01:49 swildner Exp $ ************************************************************************/ @@ -51,9 +51,6 @@ SOFTWARE. #define TRUE 1 #define FALSE 0 -#ifndef NULL -#define NULL 0 -#endif /* * This can be changed to make internal routines visible to debuggers, etc. diff --git a/libexec/rtld-elf/malloc.c b/libexec/rtld-elf/malloc.c index 04a4c5efea..04566f5c84 100644 --- a/libexec/rtld-elf/malloc.c +++ b/libexec/rtld-elf/malloc.c @@ -32,7 +32,7 @@ * * @(#)malloc.c 5.11 (Berkeley) 2/23/91 * $FreeBSD: src/libexec/rtld-elf/malloc.c,v 1.3.2.3 2003/02/20 20:42:46 kan Exp $ - * $DragonFly: src/libexec/rtld-elf/malloc.c,v 1.2 2003/06/17 04:27:08 dillon Exp $ + * $DragonFly: src/libexec/rtld-elf/malloc.c,v 1.3 2008/06/05 18:01:49 swildner Exp $ */ /* @@ -66,8 +66,6 @@ #define NEED_DEV_ZERO 1 #endif -#define NULL 0 - static void morecore(); static int findbucket(); diff --git a/sbin/rcorder/sprite.h b/sbin/rcorder/sprite.h index 3ef429db88..ed0df62fcd 100644 --- a/sbin/rcorder/sprite.h +++ b/sbin/rcorder/sprite.h @@ -37,7 +37,7 @@ * * from: @(#)sprite.h 8.1 (Berkeley) 6/6/93 * $NetBSD: sprite.h,v 1.1 1999/11/23 05:28:22 mrg Exp $ - * $DragonFly: src/sbin/rcorder/sprite.h,v 1.1 2003/07/24 06:35:38 dillon Exp $ + * $DragonFly: src/sbin/rcorder/sprite.h,v 1.2 2008/06/05 18:01:49 swildner Exp $ */ /* @@ -90,9 +90,6 @@ typedef int ReturnStatus; #define NIL ~0 #define USER_NIL 0 -#ifndef NULL -#define NULL 0 -#endif /* NULL */ /* * An address is just a pointer in C. It is defined as a character pointer diff --git a/sys/boot/efi/include/efidef.h b/sys/boot/efi/include/efidef.h index 3c75bc9f2b..f1f54bd16b 100644 --- a/sys/boot/efi/include/efidef.h +++ b/sys/boot/efi/include/efidef.h @@ -1,6 +1,6 @@ /* * $FreeBSD: src/sys/boot/efi/include/efidef.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ - * $DragonFly: src/sys/boot/efi/include/efidef.h,v 1.1 2003/11/10 06:08:32 dillon Exp $ + * $DragonFly: src/sys/boot/efi/include/efidef.h,v 1.2 2008/06/05 18:01:49 swildner Exp $ */ #ifndef _EFI_DEF_H #define _EFI_DEF_H @@ -33,10 +33,6 @@ typedef UINT8 BOOLEAN; #define FALSE ((BOOLEAN) 0) #endif -#ifndef NULL - #define NULL ((VOID *) 0) -#endif - typedef UINTN EFI_STATUS; typedef UINT64 EFI_LBA; typedef UINTN EFI_TPL; diff --git a/sys/boot/ficl/i386/sysdep.h b/sys/boot/ficl/i386/sysdep.h index 86a7d01cd8..ddd2e36acc 100644 --- a/sys/boot/ficl/i386/sysdep.h +++ b/sys/boot/ficl/i386/sysdep.h @@ -48,7 +48,7 @@ /* * $FreeBSD: src/sys/boot/ficl/i386/sysdep.h,v 1.8 2002/05/16 21:21:52 trhodes Exp $ - * $DragonFly: src/sys/boot/ficl/i386/sysdep.h,v 1.3 2003/11/10 06:08:33 dillon Exp $ + * $DragonFly: src/sys/boot/ficl/i386/sysdep.h,v 1.4 2008/06/05 18:01:49 swildner Exp $ */ #if !defined (__SYSDEP_H__) @@ -95,10 +95,6 @@ #define UNS8 unsigned char #endif -#if !defined NULL -#define NULL ((void *)0) -#endif - /* ** FICL_UNS and FICL_INT must have the same size as a void* on ** the target system. A CELL is a union of void*, FICL_UNS, and diff --git a/sys/dev/raid/asr/osd_util.h b/sys/dev/raid/asr/osd_util.h index 0eab36ff25..7d2e6d3e20 100644 --- a/sys/dev/raid/asr/osd_util.h +++ b/sys/dev/raid/asr/osd_util.h @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/asr/osd_util.h,v 1.1.2.2 2001/08/23 05:21:29 scottl Exp $ */ -/* $DragonFly: src/sys/dev/raid/asr/osd_util.h,v 1.5 2004/02/12 00:00:19 dillon Exp $ */ +/* $DragonFly: src/sys/dev/raid/asr/osd_util.h,v 1.6 2008/06/05 18:01:49 swildner Exp $ */ /* * Copyright (c) 1996-1999 Distributed Processing Technology Corporation * All rights reserved. @@ -202,10 +202,6 @@ } access_U; #endif -#if !defined (NULL) - #define NULL 0 -#endif - /*Prototypes - function ----------------------------------------------------- */