Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Mar 2012 16:39:34 +0000 (UTC)
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232730 - head/sys/x86/include
Message-ID:  <201203091639.q29GdYIl015757@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tijl
Date: Fri Mar  9 16:39:34 2012
New Revision: 232730
URL: http://svn.freebsd.org/changeset/base/232730

Log:
  Cast the expression in __bswap16(x) to __uint16_t because it is promoted
  to int.
  
  Reviewed by:	dim

Modified:
  head/sys/x86/include/endian.h

Modified: head/sys/x86/include/endian.h
==============================================================================
--- head/sys/x86/include/endian.h	Fri Mar  9 16:21:40 2012	(r232729)
+++ head/sys/x86/include/endian.h	Fri Mar  9 16:39:34 2012	(r232730)
@@ -70,8 +70,8 @@
 	(((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32))
 
 #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P
-#define	__bswap16(x)			\
-	(__builtin_constant_p(x) ?	\
+#define	__bswap16(x)				\
+	(__uint16_t)(__builtin_constant_p(x) ?	\
 	    __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x))
 #define	__bswap32(x)			\
 	(__builtin_constant_p(x) ?	\



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