Date: Fri, 09 Mar 2012 13:58:59 +0100 From: Dimitry Andric <dim@FreeBSD.org> To: Tijl Coosemans <tijl@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232721 - head/sys/x86/include Message-ID: <4F59FE93.2040401@FreeBSD.org> In-Reply-To: <201203091148.q29BmuIp005151@svn.freebsd.org> References: <201203091148.q29BmuIp005151@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2012-03-09 12:48, Tijl Coosemans wrote: > Author: tijl > Date: Fri Mar 9 11:48:56 2012 > New Revision: 232721 > URL: http://svn.freebsd.org/changeset/base/232721 > > Log: > Clean up x86 endian.h: > - Remove extern "C". There are no functions with external linkage here. [1] > - Rename bswapNN_const(x) to bswapNN_gen(x) to indicate that these macros > are generic implementations that can take non-constant arguments. [1] > - Split up __GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P and deal with > each separately. > - Replace _LP64 with __amd64__ because asm instructions are machine > dependent, not ABI dependent. ... > +#ifdef __GNUCLIKE_BUILTIN_CONSTANT_P > +#define __bswap16(x) \ > + (__builtin_constant_p(x) ? \ > + __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)) Shall we now add a cast to __uint16_t to this ternary expression? That should solve the problems with clang warnings about ntohs() etc once and for all.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F59FE93.2040401>