From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 25 00:39:27 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C7FFE16A4CE for ; Tue, 25 Nov 2003 00:39:27 -0800 (PST) Received: from milla.ask33.net (milla.ask33.net [217.197.166.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3895B43F3F for ; Tue, 25 Nov 2003 00:39:25 -0800 (PST) (envelope-from nick@milla.ask33.net) Received: by milla.ask33.net (Postfix, from userid 1001) id 2ECA13ABB2D; Tue, 25 Nov 2003 09:38:26 +0100 (CET) Date: Tue, 25 Nov 2003 09:38:26 +0100 From: Pawel Jakub Dawidek To: freebsd-hackers@FreeBSD.ORG Message-ID: <20031125083825.GB511@garage.freebsd.pl> References: <20031124095852.GZ511@garage.freebsd.pl> <20031125011308.GA98148@VARK.homeunix.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="mMdCh5/a0q2ATNCM" Content-Disposition: inline In-Reply-To: <20031125011308.GA98148@VARK.homeunix.com> X-PGP-Key-URL: http://garage.freebsd.pl/jules.asc X-OS: FreeBSD 4.8-RELEASE-p13 i386 X-URL: http://garage.freebsd.pl User-Agent: Mutt/1.5.1i Subject: Re: Size-independent byte order swapping functions. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2003 08:39:27 -0000 --mMdCh5/a0q2ATNCM Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 24, 2003 at 05:13:08PM -0800, David Schultz wrote: +> On Mon, Nov 24, 2003, Pawel Jakub Dawidek wrote: +> > If one is using strictly defined types as uint8_t, uint16_t, int32_t, = etc. +> > those macros are helpful IMHO, because futher value size changes does = not +> > affects code for byte order managing. This also does not hit perfroman= ce, +> > because this should be resolved at compile-time. +>=20 +> Cool, looks useful. +>=20 +> > I'm not sure if dedicated epanic() is the best way to implement out-of= -range +> > errors prevention - the more handy solution should cause compile error. +>=20 +> See CTASSERT. I've tried, but you can't use CTASSERT() inside (?:). --=20 Pawel Jakub Dawidek pawel@dawidek.net UNIX Systems Programmer/Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am! http://cerber.sourceforge.net --mMdCh5/a0q2ATNCM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iQCVAwUBP8MVAT/PhmMH/Mf1AQH7nAQAhgM1xRoWwwrno8RtcHwI0tANzHWW8vGE hKf63pMutVAyQ70q4URSMcB49WeMxXvw5q7xdCsdGVaNTP8WNhB7H6VKG0F0Z67g zdpTn3JZ+hR/89h1vsG7HpofoarrdXVrFvTHNSjaqK7zkUpkUf/vdZxSEqy4YhbK sGEnssVeRcw= =xTUS -----END PGP SIGNATURE----- --mMdCh5/a0q2ATNCM--