Quote:
|
Originally Posted by Scorpions4ever
Maybe make it a function instead of a macro? At least, that will avoid any fun side-effects with macros (for instance, y = BToL(x++) will cause very interesting issues).
|
Hmmm. Ok, you convinced me. I won't add more brackets or magic, I'll make a function of it

If speed becomes an issue I can still switch to asm.
int btol(int x) {
return ((x & 0xFF000000) >> 24) + ((x & 0xFF0000) >> 8) + ((x & 0xFF00) << 8) + ((x & 0xFF) << 24);
} The function will be used to convert files of several 100MB, maybe even gigs...
Should I use a register here maybe? But then, I'll get the code done first, optimize later.
M.