change c to c++ style casting