Pointer casts on LLP64 platforms lose precision
|Reported by:||dhewg||Owned by:|
With mingw-w64 (gcc version 4.4.0 20090308 (experimental) (GCC)) a few of these errors occur:
backends/platform/sdl/graphics.cpp:1000: error: cast from ‘const byte*’ to ‘long int’ loses precision
64bit MS platforms use the LLP64 data model, so a "long" is only 32bit wide. There're a few instances where pointers get casted to long (to check for alignment), and that results in the above mentioned error.
While that can be worked around with -fpermissive, it's not really a nice solution, so I'll attach a patch that changes those casts from long to size_t. It compiled just fine afterwards (all engines enabled). Maybe it would be better idea to provide an common inline function to check for the alignment of a pointer.
Btw: It's working too ;) I don't have a win64 box, but Hkz just played BS/PSX on Vista64 with that binary.
Ticket imported from: #2685623. Ticket imported from: patches/1090.