fixed warning of casting pointer to int