svn commit: r194049 - head/sys/sys
Andriy Gapon
avg at FreeBSD.org
Fri Jun 12 09:05:24 UTC 2009
Author: avg
Date: Fri Jun 12 09:05:23 2009
New Revision: 194049
URL: http://svn.freebsd.org/changeset/base/194049
Log:
KOBJMETHOD: throw the switch on kobj method signature checking
It seems that current code should pass the check.
This commit should not lead to any changes in compiled code.
From now on a warning shall be produced if kobj method implementation
function has a mismatching signature.
Verified by: md5
Reviewed by: imp
Approved by: jhb (mentor)
Modified:
head/sys/sys/kobj.h
Modified: head/sys/sys/kobj.h
==============================================================================
--- head/sys/sys/kobj.h Fri Jun 12 07:48:35 2009 (r194048)
+++ head/sys/sys/kobj.h Fri Jun 12 09:05:23 2009 (r194049)
@@ -91,13 +91,11 @@ struct kobjop_desc {
/*
* Shorthand for constructing method tables.
+ * The ternary operator is (ab)used to provoke a warning when FUNC
+ * has a signature that is not compatible with kobj method signature.
*/
-#if 1
-#define KOBJMETHOD(NAME, FUNC) { &NAME##_desc, (kobjop_t) FUNC }
-#else /* notyet */
#define KOBJMETHOD(NAME, FUNC) \
{ &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) }
-#endif
/*
*
More information about the svn-src-all
mailing list