From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:21:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C81B0106564A; Thu, 11 Jun 2009 17:21:14 +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 B6A328FC1A; Thu, 11 Jun 2009 17:21:14 +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 n5BHLEUj054928; Thu, 11 Jun 2009 17:21:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BHLEv8054927; Thu, 11 Jun 2009 17:21:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111721.n5BHLEv8054927@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 17:21:14 +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: r194028 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:21:15 -0000 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 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 /*