]> git.xonotic.org Git - xonotic/gmqcc.git/commit
Big-endian: Byteswap only the field contents when writing progs.dat
authorJim Thoenen <the.resident@gmail.com>
Sun, 2 Feb 2014 06:57:02 +0000 (00:57 -0600)
committerJim Thoenen <the.resident@gmail.com>
Sun, 2 Feb 2014 06:57:02 +0000 (00:57 -0600)
commit1bf9ebabcce7731b83c302e8416bba41c3cdf5da
tree55315840d1fbcc987a1bc6b5b31853cca29a6ddd
parent9cc4fe1ed246e3c37af7cbd7245b0b413372f3b9
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
code.c
gmqcc.h
pak.c
util.c