cast from 'void*' to 'int' loses precision

Didn't compile on 64-bit systems.

See: http://stackoverflow.com/questions/1640423/error-cast-from-void-to-int-loses-precision