Cast to intptr_t to fix compiler warning