htole32() and friends

From: Alan Barrett <apb@dont-contact.us>
Date: Mon, 28 Jul 2003 18:53:00 +0200

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.

--apb (Alan Barrett)
Received on Mon Jul 28 2003 - 10:53:45 MDT

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