Size-independent byte order swapping functions.
From: Pawel Jakub Dawidek (nick_at_garage.freebsd.pl)
Date: 11/24/03
- Previous message: Marc Hufschmitt: "can't fsck_ext2fs on a non sliced disk on 5.1"
- Next in thread: David Schultz: "Re: Size-independent byte order swapping functions."
- Reply: David Schultz: "Re: Size-independent byte order swapping functions."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 24 Nov 2003 10:58:52 +0100 To: freebsd-hackers@freebsd.org
Hello hackers...
Macros in attached patch are designed for doing life a little easier.
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.
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.
-- Pawel Jakub Dawidek pawel@dawidek.net UNIX Systems Programmer/Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am! http://cerber.sourceforge.net
- text/plain attachment: endian.h.patch
- application/pgp-signature attachment: stored
- Previous message: Marc Hufschmitt: "can't fsck_ext2fs on a non sliced disk on 5.1"
- Next in thread: David Schultz: "Re: Size-independent byte order swapping functions."
- Reply: David Schultz: "Re: Size-independent byte order swapping functions."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|