fabiensanglard/Another-World-Bytecode-Interpreter — pull request #4 by tycho (2012-03-03 02:15:12+00:00)
Title: Multiple bugfixes

- replaced resTypeToString array with function, for bounds checking reasons (I encountered game data with type ID '6' which is out-of-bounds)
- switch to using unsigned 8-bit PCM audio instead of signed, which works around bugs with PulseAudio in most currently available SDL releases (maybe the most recent SDL release contains the fix, I'm not sure). Fixes issue #2
- LP64 platform compatibility. Long-Pointer 64-bit platforms use a 64-bit 'long', which breaks endian.h (which assumes that 'long' is 32-bit, and typedefs 'uint32' as 'unsigned long'). This causes the game engine to crash at startup.
- A better fix for LP64 (and more universal compatibility) which switches the 'uint8', 'int8', et. al. to use the types defined in stdint.h (uint8_t, int8_t), which are guaranteed to be the correct sizes, so no preprocessor magic or configure scripts are needed to ensure that the data types are the size we expect.
- Replace '-O' with '-Os' to optimize for code size. Sort of in the spirit of the original game, and also generally GCC emits better code with this flag.
- Drop some warning flags which are meaningless for C++ code (-Wstrict-prototypes, -Wimplicit)
- A bit of whitespace cleanup, particularly in terms of indentation and comma placement on line continuations in resource.cpp.
- Switched a binary OR to a logical OR (the binary OR made no sense given the context and generated an irritating compiler warning)
- Clean up an unused variable, initialize an uninitialized variable used in a comparison, etc.