From C++ best practices

Uses static_cast<> instead of C casting.