Core: fix minor issues:

+ fix issues found by clang's clazy tool
+ fix cppcoreguidelines-pro-type-member-init
  * Make sure that all class members are initialized in the constructor
This commit is contained in:
wmayer
2022-06-30 16:31:16 +02:00
parent 67ddf95f89
commit 97f9320bb3
3 changed files with 12 additions and 7 deletions

View File

@@ -193,14 +193,14 @@ void PropertyQuantityConstraint::setPyObject(PyObject *value)
quant.setValue(temp);
if (unit.isEmpty()){
PropertyFloat::setValue(quant.getValue());
PropertyFloat::setValue(quant.getValue()); // clazy:exclude=skipped-base-method
return;
}
if (unit != _Unit)
throw Base::UnitsMismatchError("Not matching Unit!");
PropertyFloat::setValue(quant.getValue());
PropertyFloat::setValue(quant.getValue()); // clazy:exclude=skipped-base-method
}
//**************************************************************************

View File

@@ -33,15 +33,15 @@
using namespace Base;
Rotation::Rotation()
: quat{0.0,0.0,0.0,1.0}
, _axis{0.0,0.0,1.0}
, _angle{0.0}
{
quat[0]=quat[1]=quat[2]=0.0;quat[3]=1.0;
_axis.Set(0.0, 0.0, 1.0);
_angle = 0.0;
}
/** Construct a rotation by rotation axis and angle */
Rotation::Rotation(const Vector3d& axis, const double fAngle)
: Rotation()
{
// set to (0,0,1) as fallback in case the passed axis is the null vector
_axis.Set(0.0, 0.0, 1.0);
@@ -49,6 +49,7 @@ Rotation::Rotation(const Vector3d& axis, const double fAngle)
}
Rotation::Rotation(const Matrix4D& matrix)
: Rotation()
{
this->setValue(matrix);
}
@@ -58,6 +59,7 @@ Rotation::Rotation(const Matrix4D& matrix)
* where the quaternion is specified by q=w+xi+yj+zk.
*/
Rotation::Rotation(const double q[4])
: Rotation()
{
this->setValue(q);
}
@@ -67,16 +69,19 @@ Rotation::Rotation(const double q[4])
* where the quaternion is specified by q=w+xi+yj+zk.
*/
Rotation::Rotation(const double q0, const double q1, const double q2, const double q3)
: Rotation()
{
this->setValue(q0, q1, q2, q3);
}
Rotation::Rotation(const Vector3d & rotateFrom, const Vector3d & rotateTo)
: Rotation()
{
this->setValue(rotateFrom, rotateTo);
}
Rotation::Rotation(const Rotation& rot)
: Rotation()
{
this->quat[0] = rot.quat[0];
this->quat[1] = rot.quat[1];

View File

@@ -157,7 +157,7 @@ public:
QString label;
QString fileName;
QString tooltip;
Status status;
Status status = Unknown;
};
Ui_DocumentRecovery ui;
bool recovered;