Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jun 2009 17:21:14 +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: r194028 - head/sys/sys
Message-ID:  <200906111721.n5BHLEv8054927@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906111721.n5BHLEv8054927>