[PATCH 2/5] Use correct swap{l,s} (or none at all for CARD8)

Jonathan Morton jonathan.morton at movial.com
Fri Aug 5 08:06:04 PDT 2011


On Fri, 2011-08-05 at 16:54 +0200, walter harms wrote:
> there are the htonl() etc. what do automatic the right thing.

That works just fine when the wire protocol is defined in "network
order", ie. big-endian, which is very common for proper, grown-up
Internet protocols.  You still need to use the correct form of the call
for the size of data for the same reasons.

As I understand it though, the X protocol can run either big- or
little-endian on the wire.  This is supposedly to avoid the overhead of
byte-swapping back and forth if both client and server are little-endian
(as is the common case on an x86 desktop PC).  Instead we must take the
overhead of deciding whether to swap or not...

-- 
------
From: Jonathan Morton
      jonathan.morton at movial.com




More information about the xorg-devel mailing list