From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sat, 06 Jan 2001 23:37:24 +0000 Subject: Re: Endianness and comparing IP's From: "Iain Sandoe" To: drscholl Cc: drscholl , "Clayton,Keith - Programmer" , "'alex@cosmo.allay.net'" , linuxppc-dev@lists.linuxppc.org Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Message-Id: <20010106234445.44216E690@apollo.valhalla.net> Sender: owner-linuxppc-dev@lists.linuxppc.org List-Id: > /* convert the bytes of a 32-bit integer to little endian */ > #define BSWAP32(c) > ((c>>24)&0xff)|((c>>8)&0xff00)|((c<<8)&0xff0000)|(c<<24) #define BSWAP32(c) \ (((c>>24)&0xff)|((c>>8)&0xff00)|((c<<8)&0xff0000)|(c<<24)) will work as you expect it too... ;-) precedence is a funny thing... Iain. ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/