fix readability-avoid-const-params-in-decls

This commit is contained in:
wmayer
2023-11-14 20:24:51 +01:00
parent 73a1e90e45
commit 767647a05f
5 changed files with 31 additions and 31 deletions

View File

@@ -219,8 +219,7 @@ public:
/// setter methods for including debug information
/// intended to use via macro for autofilling of debugging information
inline void
setDebugInformation(const std::string& file, const int line, const std::string& function);
inline void setDebugInformation(const std::string& file, int line, const std::string& function);
inline void setTranslatable(bool translatable);
@@ -844,7 +843,7 @@ inline bool Exception::getTranslatable() const
}
inline void
Exception::setDebugInformation(const std::string& file, const int line, const std::string& function)
Exception::setDebugInformation(const std::string& file, int line, const std::string& function)
{
_file = file;
_line = line;

View File

@@ -69,7 +69,7 @@ Rotation::Rotation(const double q[4])
* q0 = x, q1 = y, q2 = z and q3 = w,
* 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::Rotation(double q0, double q1, double q2, double q3)
: Rotation()
{
this->setValue(q0, q1, q2, q3);
@@ -146,7 +146,7 @@ void Rotation::evaluateVector()
}
}
void Rotation::setValue(const double q0, const double q1, const double q2, const double q3)
void Rotation::setValue(double q0, double q1, double q2, double q3)
{
this->quat[0] = q0;
this->quat[1] = q1;
@@ -258,7 +258,7 @@ void Rotation::setValue(const Matrix4D& m)
this->evaluateVector();
}
void Rotation::setValue(const Vector3d& axis, const double fAngle)
void Rotation::setValue(const Vector3d& axis, double fAngle)
{
// Taken from <http://de.wikipedia.org/wiki/Quaternionen>
//

View File

@@ -41,10 +41,10 @@ public:
/** Construction. */
//@{
Rotation();
Rotation(const Vector3d& axis, const double fAngle);
Rotation(const Vector3d& axis, double fAngle);
Rotation(const Matrix4D& matrix);
Rotation(const double q[4]);
Rotation(const double q0, const double q1, const double q2, const double q3);
Rotation(double q0, double q1, double q2, double q3);
Rotation(const Vector3d& rotateFrom, const Vector3d& rotateTo);
Rotation(const Rotation& rot);
//@}
@@ -53,7 +53,7 @@ public:
//@{
const double* getValue() const;
void getValue(double& q0, double& q1, double& q2, double& q3) const;
void setValue(const double q0, const double q1, const double q2, const double q3);
void setValue(double q0, double q1, double q2, double q3);
/// If not a null quaternion then \a axis will be normalized
void getValue(Vector3d& axis, double& rfAngle) const;
/// Does the same as the method above unless normalizing the axis.
@@ -61,7 +61,7 @@ public:
void getValue(Matrix4D& matrix) const;
void setValue(const double q[4]);
void setValue(const Matrix4D& matrix);
void setValue(const Vector3d& axis, const double fAngle);
void setValue(const Vector3d& axis, double fAngle);
void setValue(const Vector3d& rotateFrom, const Vector3d& rotateTo);
/// Euler angles in yaw,pitch,roll notation
void setYawPitchRoll(double y, double p, double r);
@@ -150,7 +150,7 @@ public:
Vector3d multVec(const Vector3d& src) const;
void multVec(const Vector3f& src, Vector3f& dst) const;
Vector3f multVec(const Vector3f& src) const;
void scaleAngle(const double scaleFactor);
void scaleAngle(double scaleFactor);
//@}
/** Specialty constructors */

View File

@@ -119,7 +119,7 @@ Type Type::badType()
}
const Type Type::createType(const Type parent, const char* name, instantiationMethod method)
const Type Type::createType(const Type& parent, const char* name, instantiationMethod method)
{
Type newType;
newType.index = static_cast<unsigned int>(Type::typedata.size());
@@ -185,7 +185,7 @@ const Type Type::getParent() const
return typedata[index]->parent;
}
bool Type::isDerivedFrom(const Type type) const
bool Type::isDerivedFrom(const Type& type) const
{
Type temp(*this);
@@ -199,7 +199,7 @@ bool Type::isDerivedFrom(const Type type) const
return false;
}
int Type::getAllDerivedFrom(const Type type, std::vector<Type>& List)
int Type::getAllDerivedFrom(const Type& type, std::vector<Type>& List)
{
int cnt = 0;
@@ -217,7 +217,7 @@ int Type::getNumTypes()
return static_cast<int>(typedata.size());
}
Type Type::getTypeIfDerivedFrom(const char* name, const Type parent, bool bLoadModule)
Type Type::getTypeIfDerivedFrom(const char* name, const Type& parent, bool bLoadModule)
{
if (bLoadModule) {
importModule(name);

View File

@@ -99,29 +99,30 @@ public:
static Type fromKey(unsigned int key);
const char* getName() const;
const Type getParent() const;
bool isDerivedFrom(const Type type) const;
bool isDerivedFrom(const Type& type) const;
static int getAllDerivedFrom(const Type type, std::vector<Type>& List);
static int getAllDerivedFrom(const Type& type, std::vector<Type>& List);
/// Returns the given named type if is derived from parent type, otherwise return bad type
static Type getTypeIfDerivedFrom(const char* name, const Type parent, bool bLoadModule = false);
static Type
getTypeIfDerivedFrom(const char* name, const Type& parent, bool bLoadModule = false);
static int getNumTypes();
static const Type
createType(const Type parent, const char* name, instantiationMethod method = nullptr);
createType(const Type& parent, const char* name, instantiationMethod method = nullptr);
unsigned int getKey() const;
bool isBad() const;
Type& operator=(const Type& type) = default;
Type& operator=(Type&& type) = default;
bool operator==(const Type type) const;
bool operator!=(const Type type) const;
bool operator==(const Type& type) const;
bool operator!=(const Type& type) const;
bool operator<(const Type type) const;
bool operator<=(const Type type) const;
bool operator>=(const Type type) const;
bool operator>(const Type type) const;
bool operator<(const Type& type) const;
bool operator<=(const Type& type) const;
bool operator>=(const Type& type) const;
bool operator>(const Type& type) const;
static Type badType();
static void init();
@@ -145,32 +146,32 @@ inline unsigned int Type::getKey() const
return this->index;
}
inline bool Type::operator!=(const Type type) const
inline bool Type::operator!=(const Type& type) const
{
return (this->getKey() != type.getKey());
}
inline bool Type::operator==(const Type type) const
inline bool Type::operator==(const Type& type) const
{
return (this->getKey() == type.getKey());
}
inline bool Type::operator<(const Type type) const
inline bool Type::operator<(const Type& type) const
{
return (this->getKey() < type.getKey());
}
inline bool Type::operator<=(const Type type) const
inline bool Type::operator<=(const Type& type) const
{
return (this->getKey() <= type.getKey());
}
inline bool Type::operator>=(const Type type) const
inline bool Type::operator>=(const Type& type) const
{
return (this->getKey() >= type.getKey());
}
inline bool Type::operator>(const Type type) const
inline bool Type::operator>(const Type& type) const
{
return (this->getKey() > type.getKey());
}