From owner-cvs-src@FreeBSD.ORG Fri Apr 4 21:16:37 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F61137B401; Fri, 4 Apr 2003 21:16:37 -0800 (PST) Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id A6D8043FA3; Fri, 4 Apr 2003 21:16:33 -0800 (PST) (envelope-from ru@whale.sunbay.crimea.ua) Received: from whale.sunbay.crimea.ua (ru@localhost [127.0.0.1]) h355GLgg041100 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 5 Apr 2003 08:16:22 +0300 (EEST) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.12.9/8.12.8/Submit) id h355GHxw041091; Sat, 5 Apr 2003 08:16:17 +0300 (EEST) (envelope-from ru) Date: Sat, 5 Apr 2003 08:16:17 +0300 From: Ruslan Ermilov To: "M. Warner Losh" Message-ID: <20030405051617.GB38538@sunbay.com> References: <20030403184229.D18209@espresso.bsdmike.org> <20030404085200.GA1765@sunbay.com> <20030404.160823.91026001.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8w3uRX/HFJGApMzv" Content-Disposition: inline In-Reply-To: <20030404.160823.91026001.imp@bsdimp.com> User-Agent: Mutt/1.5.4i cc: obrien@FreeBSD.org cc: phk@FreeBSD.org cc: src-committers@FreeBSD.org cc: nate@root.org cc: cvs-src@FreeBSD.org cc: cvs-all@FreeBSD.org cc: mike@FreeBSD.org Subject: Re: cvs commit: src/sys/sys endian.h src/share/man/man9 byteorder.9 X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2003 05:16:37 -0000 --8w3uRX/HFJGApMzv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 04, 2003 at 04:08:23PM -0700, M. Warner Losh wrote: > In message: <20030404085200.GA1765@sunbay.com> > Ruslan Ermilov writes: > : +#define BSWAP64(x) (uint64_t) \ > : + (((x) >> 56) | (((x) >> 40) & 0xff00) | (((x) >> 24) & 0xff0000) | \ > : + (((x) >> 8) & 0xff000000) | (((x) << 8) & ((uint64_t)0xff << 32)) | \ > : + (((x) << 24) & ((uint64_t)0xff << 40)) | \ > : + (((x) << 40) & ((uint64_t)0xff << 48)) | (((x) << 56))) >=20 > 0xffull or 0xffULL might be better than the casts here. This does > assume that 0ull =3D=3D (uint64_t)0, which does hold for all our > architectures... >=20 Why make assumptions where uint64_t gives us precisely what we need? Note that these are evaluated at compile time, so it cannot affect the run-time performance. Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --8w3uRX/HFJGApMzv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+jmahUkv4P6juNwoRAuJ3AJ9Rc8UbtMvJo6/88fmsuxWuC+Sj2ACfccgo Dlr3EVZdp3l5jgC6R2c9LXU= =vfBQ -----END PGP SIGNATURE----- --8w3uRX/HFJGApMzv--