replace all C-style type cast by C++ casting