Consistent use of size_t for casting pointers to integer type. 

This was to be only the first two commits, but turns out it took more to make Travis CI happy.

When 64bit_01 and 64bit_02 are applied, the code will compile cleanly with GCC 4.8.1 64 bit (MinGW). It also compiles with 32 bit and Travis CI. On 64 bit, I still need to ignore  10 or so test cases, because they crash. All others pass.