64-bit: fix a whole load of "error: cast from x to 'int' loses precision"

One step closer to compiling on 64bit Linux (Arch Linux). This error stopped my build process, now I get to the linking process, where SDL2 fails.

```
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../lib/libSDL2.so: undefined reference to `SDL_TLSCreate'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../lib/libSDL2.so: undefined reference to `SDL_TLSGet'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../lib/libSDL2.so: undefined reference to `SDL_TLSSet'
```