aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Murray <markm@FreeBSD.org>2004-03-05 08:10:19 +0000
committerMark Murray <markm@FreeBSD.org>2004-03-05 08:10:19 +0000
commit16fc3635f7aec3852abfc6dd77f89baef91f22fa (patch)
tree524ae0ef30bcdfacb05b3c2b01e1c48e80d93e3b /sys
parent5af2e7de06321c8f6aaa876fa79bf08870e8911c (diff)
downloadsrc-16fc3635f7aec3852abfc6dd77f89baef91f22fa.tar.gz
src-16fc3635f7aec3852abfc6dd77f89baef91f22fa.zip
Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)
that this provokes. "Wherever possible" means "In the kernel OR NOT C++" (implying C). There are places where (void *) pointers are not valid, such as for function pointers, but in the special case of (void *)0, agreement settles on it being OK. Most of the fixes were NULL where an integer zero was needed; many of the fixes were NULL where ascii <nul> ('\0') was needed, and a few were just "other". Tested on: i386 sparc64
Notes
Notes: svn path=/head/; revision=126643
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/_null.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/sys/_null.h b/sys/sys/_null.h
index a0ba677abaac..72e7f85bf1a9 100644
--- a/sys/sys/_null.h
+++ b/sys/sys/_null.h
@@ -28,14 +28,14 @@
#ifndef NULL
-#ifdef _KERNEL
-#define NULL (void *)0
+#if defined(_KERNEL) || !defined(__cplusplus)
+#define NULL ((void *)0)
#else
#if defined(__LP64__)
-#define NULL 0L
+#define NULL (0L)
#else
#define NULL 0
-#endif
-#endif /* _KERNEL */
+#endif /* __LP64__ */
+#endif /* _KERNEL || !__cplusplus */
#endif