Endianness and comparing IP's

Keith Clayton clay-ton at pacbell.net
Sun Jan 7 13:54:00 EST 2001


Good catch!


On Sat, Jan 06, 2001 at 11:37:24PM +0000, Iain Sandoe wrote:
>
>
> > /* 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.
>
>

--
<><><><><><><><><><><><>
Keith Clayton
clay-ton at pacbell.net

"If you don't trust me with your source code,
            why should I trust you with my computer?"

GPG key: http://www.jps.net/kclayton/keith_public_key.html
         http://www.keyserver.net

GPG fingerprint: 0C47 F1A1 0434 588C 9457  D53F D86A 5449 43F6 09A0


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list