From owner-svn-src-all@FreeBSD.ORG Fri Jun 12 09:05:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 273ED106566C; Fri, 12 Jun 2009 09:05:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 147B58FC22; Fri, 12 Jun 2009 09:05:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5C95Nlx075807; Fri, 12 Jun 2009 09:05:23 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5C95NUp075806; Fri, 12 Jun 2009 09:05:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906120905.n5C95NUp075806@svn.freebsd.org> From: Andriy Gapon Date: Fri, 12 Jun 2009 09:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194049 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 09:05:24 -0000 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 /* *