Adding typecasting with intptr_t to remove warnings.
Cleanup warnings found when building v1.7

cmr:v1.7