From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 12:58:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E0351106566B; Fri, 9 Mar 2012 12:58:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9AB718FC0A; Fri, 9 Mar 2012 12:58:55 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:21e7:1ad:882:b366] (unknown [IPv6:2001:7b8:3a7:0:21e7:1ad:882:b366]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id DF2355C37; Fri, 9 Mar 2012 13:58:54 +0100 (CET) Message-ID: <4F59FE93.2040401@FreeBSD.org> Date: Fri, 09 Mar 2012 13:58:59 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120229 Thunderbird/11.0 MIME-Version: 1.0 To: Tijl Coosemans References: <201203091148.q29BmuIp005151@svn.freebsd.org> In-Reply-To: <201203091148.q29BmuIp005151@svn.freebsd.org> X-Enigmail-Version: 1.4a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232721 - head/sys/x86/include 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: Fri, 09 Mar 2012 12:58:56 -0000 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.