fixed 64 bit warnings by casting integers to intptr_t before casting to int