Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Feb 2016 01:34:13 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r295833 - head/sys/sys
Message-ID:  <201602200134.u1K1YDOD016555@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Sat Feb 20 01:34:13 2016
New Revision: 295833
URL: https://svnweb.freebsd.org/changeset/base/295833

Log:
  Fix the definition of RM_MAX_END.
  
  Even though casting from signed to unsigned is well-defined in C, it's better to
  first cast to the larger unsigned type, then negate.

Modified:
  head/sys/sys/rman.h

Modified: head/sys/sys/rman.h
==============================================================================
--- head/sys/sys/rman.h	Sat Feb 20 01:32:58 2016	(r295832)
+++ head/sys/sys/rman.h	Sat Feb 20 01:34:13 2016	(r295833)
@@ -61,7 +61,7 @@ enum	rman_type { RMAN_UNINIT = 0, RMAN_G
  */
 #define RM_TEXTLEN	32
 
-#define	RM_MAX_END	((rman_res_t)~0)
+#define	RM_MAX_END	(~(rman_res_t)0)
 
 #define	RMAN_IS_DEFAULT_RANGE(s,e)	((s) == 0 && (e) == RM_MAX_END)
 



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