Size-independent byte order swapping functions.

David Schultz das at FreeBSD.ORG
Mon Nov 24 17:15:22 PST 2003


On Mon, Nov 24, 2003, Pawel Jakub Dawidek wrote:
> If one is using strictly defined types as uint8_t, uint16_t, int32_t, etc.
> those macros are helpful IMHO, because futher value size changes does not
> affects code for byte order managing. This also does not hit perfromance,
> because this should be resolved at compile-time.

Cool, looks useful.

> I'm not sure if dedicated epanic() is the best way to implement out-of-range
> errors prevention - the more handy solution should cause compile error.

See CTASSERT.


More information about the freebsd-hackers mailing list