svn commit: r194028 - head/sys/sys
Andriy Gapon
avg at FreeBSD.org
Thu Jun 11 17:21:15 UTC 2009
Author: avg
Date: Thu Jun 11 17:21:14 2009
New Revision: 194028
URL: http://svn.freebsd.org/changeset/base/194028
Log:
KOBJMETHOD: use better construct in the checking version of the macro
Big thanks to Christoph Mallon for the idea/code!
This construct has benefit of sticking much stricter to C standard and thus
keeping more compilers happy as Clang doesn't like the current construct
because it doesn't treat FUNC != NULL as a compile-time constant.
The checking version is still under 'notyet'.
Pointed out by: ed
Submitted by: Christoph Mallon <christoph.mallon at gmx.de>
Clang help by: rdivacky
Reviewed by: imp
Approved by: jhb
Modified:
head/sys/sys/kobj.h
Modified: head/sys/sys/kobj.h
==============================================================================
--- head/sys/sys/kobj.h Thu Jun 11 17:16:04 2009 (r194027)
+++ head/sys/sys/kobj.h Thu Jun 11 17:21:14 2009 (r194028)
@@ -96,7 +96,7 @@ struct kobjop_desc {
#define KOBJMETHOD(NAME, FUNC) { &NAME##_desc, (kobjop_t) FUNC }
#else /* notyet */
#define KOBJMETHOD(NAME, FUNC) \
-{ &NAME##_desc, (kobjop_t) (FUNC != (NAME##_t *)NULL ? FUNC : NULL) }
+ { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) }
#endif
/*
More information about the svn-src-head
mailing list