Converted C style casts to C++ style casts