U*_AT macros
Christophe Massiot
massiot at via.ecp.fr
Sun Jun 2 23:46:19 CEST 2002
Hello,
I'd like to get rid of the U16_AT and U32_AT macros (which are
wrappers to ntohs and ntohl). The reason I don't like that is that
they suppose the source address is aligned, which is often not the
case. The problem is every time some one uses U32_AT, it breaks the
ports on SPARC and ARM, which can't read unaligned addresses (bus
error !).
So we have two solutions :
* Make U*_AT macros alignment-safe, basically :
#define U16_AT(titi) ((titi[0] << 8) | titi[1])
This has no interest, compared to hand-coding the conversion.
* Remove the U*_AT macros, and replace them everywhere with explicit
parsing and shifts.
What do you think ?
--
Christophe Massiot.
--
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>
More information about the vlc-devel
mailing list