Cast through intptr_t to appease GCC

Thanks to Matt Aimonetti