From owner-freebsd-arch Wed Apr 3 14:39:52 2002 Delivered-To: freebsd-arch@freebsd.org Received: from dragon.nuxi.com (trang.nuxi.com [66.92.13.169]) by hub.freebsd.org (Postfix) with ESMTP id 02A2737B400 for ; Wed, 3 Apr 2002 14:39:49 -0800 (PST) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.2/8.12.2) with ESMTP id g33MdlYm092161; Wed, 3 Apr 2002 14:39:47 -0800 (PST) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.2/8.12.2/Submit) id g33McVqN092155; Wed, 3 Apr 2002 14:38:31 -0800 (PST) Date: Wed, 3 Apr 2002 14:38:31 -0800 From: "David O'Brien" To: Marcel Moolenaar Cc: arch@FreeBSD.org Subject: Re: Please review: endian invariant kernel dump headers Message-ID: <20020403143831.A92066@dragon.nuxi.com> Reply-To: obrien@FreeBSD.org References: <20020403034208.GA929@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020403034208.GA929@dhcp01.pn.xcllnt.net>; from marcel@xcllnt.net on Tue, Apr 02, 2002 at 07:42:08PM -0800 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Apr 02, 2002 at 07:42:08PM -0800, Marcel Moolenaar wrote: > +#include > + > +#if BYTE_ORDER == LITTLE_ENDIAN > +#define dtoh32(x) __bswap32(x) > +#define dtoh64(x) __bswap64(x) > +#define htod32(x) __bswap32(x) > +#define htod64(x) __bswap64(x) > +#else > +#define dtoh32(x) x > +#define dtoh64(x) x > +#define htod32(x) x > +#define htod64(x) x > +#endif Why can't you just use __bswap64 directly, or some other wrappers. I am seeing this part in more and more source files with the macros taking on serveral spellings. Lets please standardize this. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message