PVS issues:

consistently define copy constructor and assignment operator
remove superfluous casts
initialize member variables in constructor
avoid double assignment
This commit is contained in:
wmayer
2019-03-04 11:53:49 +01:00
parent 00a5a49416
commit 6b37fdc1a8
16 changed files with 63 additions and 22 deletions

View File

@@ -90,6 +90,19 @@ Rotation::Rotation(const Rotation& rot)
this->_angle = rot._angle;
}
void Rotation::operator = (const Rotation& rot)
{
this->quat[0] = rot.quat[0];
this->quat[1] = rot.quat[1];
this->quat[2] = rot.quat[2];
this->quat[3] = rot.quat[3];
this->_axis[0] = rot._axis[0];
this->_axis[1] = rot._axis[1];
this->_axis[2] = rot._axis[2];
this->_angle = rot._angle;
}
const double * Rotation::getValue(void) const
{
return &this->quat[0];