[PATCH 2/5] Use correct swap{l,s} (or none at all for CARD8)
walter harms
wharms at bfs.de
Fri Aug 5 07:54:57 PDT 2011
Am 05.08.2011 16:34, schrieb Daniel Stone:
> Hi,
>
> On Fri, Aug 05, 2011 at 04:07:13PM +0200, walter harms wrote:
>> I am not sure if i understand the purpose of swap() really.
>
> To account for different byte ordering (rather than bit ordering) on
> machines of different endianness. The bit ordering is already taken
> care of for us by everyone swapping to network bit ordering when putting
> stuff on the wire, and to host bit ordering when pulling stuff off the
> wire. This is why you can access a web server running on x86_64 from
> the SPARC workstation that everyone totally has, without each side
> needing to know about the other's endianness preferences.
>
thx for the explanation.
But is this a common problem in network programming ?
there are the htonl() etc. what do automatic the right thing.
re,
wh
More information about the xorg-devel
mailing list