Re: Endianness and comparing IP's

From: Iain Sandoe <hidden>
Date: 2001-01-06 23:05:05

Sat, Jan 6, 2001, drscholl wrote...
[...]
quoted
probably (but it wouldn't be difficult to check that anyway).
Yes, I did verify that they are all unsigned int, not just relying on
that.  :-)
hmmm. I suppose that the literals in the macro are int by definition?
/* 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)
quoted
(or are you convinced it is OK?)
Seems to work fine under Solaris, otherwise nobody would be able to
download anything because the IP address would be reversed.
works OK for me too under linuxppc (with default compiler options - got
anything weird specified?).

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help