Re: htole32() and friends

From: Robert Collins <robertc@dont-contact.us>
Date: 29 Jul 2003 06:19:31 +1000

On Tue, 2003-07-29 at 02:53, Alan Barrett wrote:
> Wouldn't it be better to use htole{16,32}() and le{16,32}toh() in
> ntlmauth.h, instead of SSWAP() and WSWAP()?
>
> The *SWAP macros have the disadvantage that their name does not match
> their purpose: their name implies that they swap stuff, but actually
> they might or might not swap stuff depending on whether it's a big- or
> little-endian host.
>
> The htole* and le*toh functions/macros have the advantage that their
> name describes exactly what they do: convert from host-byte-order to
> little-endian, or vice versa. They also have the advantage that they
> are already included in FreeBSD/NetBSD/OpenBSD.
>
> If you like, I'll work up a patch that does as I suggest.

Sounds good to me.

Rob

-- 
GPG key available at: <http://members.aardvark.net.au/lifeless/keys.txt>.

Received on Mon Jul 28 2003 - 14:20:06 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:20:18 MST