fix compiler warnings - add casts between pointer and int