[mw-devel] MW3 r878 - in branches: . portable/src

Peter Berry pwb at sucs.org
Fri Apr 28 02:33:54 BST 2006


On Thu, 27 Apr 2006, Justin Mitchell wrote:

> On Wed, Apr 26, 2006 at 10:12:20PM +0100, pwb at sucs.org wrote:
>> Author: pwb
>> Date: 2006-04-26 22:12:15 +0100 (Wed, 26 Apr 2006)
>> New Revision: 878
>>
>> Added:
>>    branches/portable/
>> Log:
>> Using portable integer types like int32_t for binary files.
>
> its not going to help much, those are packed structs,
> on a 64 system the packing system will be different,
> so the vars will be the right size (didnt matter if they got bigger anyway)
> but in the wrong places (totally fatal when reading old saved data).

I don't see any packing declarations in bb.h, which is where said structs 
are all defined. In any case I've tested the old folder files with a 64 
bit build and they (seem to) work fine.

You can still argue about endianness or differences between compilers / 
wildly different architectures, but this is really just a kludge to avoid 
having to convert the old files :)

Of course the proper solution to get some decent abstraction in the file 
I/O, then change to using a non-binary format (like UTF-8 encoded XML 
which would also solve the endian issue), but that would take more effort 
than I can be bothered with.

-- 
Peter Berry, SUCS Ex-Treasurer
<pwb at sucs.org>



More information about the mw-devel mailing list