c++ style: use reinterpret_cast rather than c style casts