graphitemaster/gmqcc — pull request #141 by CurrentResident (2014-02-02 07:58:12+00:00)
Title: Big endian swap fix

Hey, I might have put too much into a commit here, just let me know what you think. I'm kind of a git noob still and trying to get a feel for how fine-grained commits should be. Thanks for looking at this!

-----

Commit message:
Big-endian: Byteswap only the field contents when writing progs.dat

The previous code swapped not just the fields' contents themselves, but
also field positions within several of the structs, resulting in a
non-working progs.dat when compiled on big endian (ppc in my case).
Swapping on a field-by-field basis now.

Also:
* Addresses weird swap size requests (30+ bytes in one case)

* Take a guess at the right way to log a weird swap request before dying

* Fix swap array length scaling

* Rename the main swap function to reflect its native->little-endian
purpose. Figued that was okay because progs.dat is required to be
always little-endian...

* Add a non-array version of the swap function for convenience