Closed dpogue closed 11 months ago
This is now sufficient for the plFilePatcher
command-line to work on Mac OS X 10.5 Leopard PowerPC (big endian) and download files.
I think I am coming around to your sense of malaise around all of the manual endianness work in the file messages. I'm especially unhappy with the temporary copy of certain messages from the file server being used solely for byte swapping, which could probably be done in-place (assuming the buffer is not
const
). It's basically a wasted copy on LE machines.
yeah, I don't like the extra copy, particularly since it's not needed for almost all cases... I thought about putting it behind some sort of HS_BIG_ENDIAN
ifdef but that also seemed ugly.
Hypothetically there should be no issue making the messages non-const and modifying the data directly...
Updated to do the byte swapping directly on the buffer data, and confirmed that it's still working on both LE and BE architectures.
There are 3 special cases that are not handled here:
UUIDs are handled as "data", but those should already be stored in the weird mixed endian mode that Windows uses (we had to fix this for macOS a while back)
SHA digests are handled as "raw data", and I'm not sure of the endianness on these. I think this might have been fixed in my first batch of PowerPC fixes? This might need further tweaking.
Plasma Net Messages are "variable pointers" but those should have all their data stored in little endian by the
Read()
/Write()
methods on the classes, so we should be okay here.