Date: Fri, 12 Jun 2009 09:05:23 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r194049 - head/sys/sys Message-ID: <200906120905.n5C95NUp075806@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 /* *
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906120905.n5C95NUp075806>