View Full Version : File saving and endianness

07-19-2011, 04:19 PM

I was wondering, if I were to save a VariantDB to disk on Windows, then have it stored with the game files to be loaded on an ARM platform, would I run into issues with byte order differences? Looking through the code, it looks like it's just using fread and fwrite, so I'd imagine that it's not taking the byte order into account. Are there some utility functions to deal with this? If not, I was thinking of adding something to rtpack, like a launch parameter -arm_build, that will take files with a certain file extension and swap bytes around before writing them to the bin directory.

Let me know if I'm on the right track or if I've completely missed something. :)



To answer my question, yes, I did miss something painfully obvious: both x86 and mobile ARM devices are little endian. I guess I was thinking of PowerPC, which is not really worth supporting anymore. I'll just leave this thread here for future devs who are worrying about byte order on other devices.

That makes things significantly easier.

07-20-2011, 03:55 AM
Yep exactly right - as far as I know there are no "important" (for lack of a better word) platforms that are big endian right now. If someone else knows differently, chime in!