Rick Peralta wrote:
There is code to byte swap in the network stack. ntoh() and friends should do the job.
Unfortunately that isn't the best solution for us, for a few reasons:
* There is no 64-bit variant, which we need.
* The system platform definitions of ntohl() etc. can vary between
macros and function calls depending on compiler's -O settings, which
complicates debugging (at least for me).
* ntohl() forces big endian. Given the current landscape of commodity
hardware, I intentionally chose little endian over big endian. That
will completely eliminate byte-swapping for the primary platforms' byte
order.
We use the GLib byte order facilities, which provide little endian
variants and are portable (along with the rest of GLib) across modern
platforms. But GUINT*_{FROM,TO}_LE macros come with the minor
disadvantages of all macros, namely a lack of type safety, problems with
multiple evaluation, etc.
Regards,
Jeff
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html