From owner-cvs-src@FreeBSD.ORG Fri Apr 4 15:09:39 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 1060F37B401; Fri, 4 Apr 2003 15:09:39 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id E7A5643FA3; Fri, 4 Apr 2003 15:09:36 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.8/8.12.3) with ESMTP id h34N9MA7068407; Fri, 4 Apr 2003 16:09:22 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 04 Apr 2003 16:08:23 -0700 (MST) Message-Id: <20030404.160823.91026001.imp@bsdimp.com> To: ru@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20030404085200.GA1765@sunbay.com> References: <20030403184229.D18209@espresso.bsdmike.org> <20030404085200.GA1765@sunbay.com> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: Fri, 04 Apr 2003 23:09:39 -0000 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))) 0xffull or 0xffULL might be better than the casts here. This does assume that 0ull == (uint64_t)0, which does hold for all our architectures... Warner