mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-07-19 22:03:40 +08:00
0030448: Coding - add typo detection to derivation creation methods using Standard_NODISCARD attribute
Added macro Standard_NODISCARD equivalent to C++17 attribute [[nodiscard]] for compilers that support this. Using Standard_NODISCARD macro for methods that create new object in gp, math, Geom, Bnd packages. Marked equivalent operators with Standard_NODISCARD, if they are defined close to relevant methods. Corrected code where warnings on unused result of calls to methods creating new objects are generated. In most cases it looks like spelling errors (e.g. Normalised() instead of Normalise())
This commit is contained in:
@@ -132,15 +132,15 @@ public:
|
||||
}
|
||||
|
||||
//! returns the product of an IntegerVector by an integer value.
|
||||
Standard_EXPORT math_IntegerVector Multiplied(const Standard_Integer theRight) const;
|
||||
Standard_EXPORT Standard_NODISCARD math_IntegerVector Multiplied(const Standard_Integer theRight) const;
|
||||
|
||||
math_IntegerVector operator*(const Standard_Integer theRight) const
|
||||
Standard_NODISCARD math_IntegerVector operator*(const Standard_Integer theRight) const
|
||||
{
|
||||
return Multiplied(theRight);
|
||||
}
|
||||
|
||||
//! returns the product of a vector and a real value.
|
||||
Standard_EXPORT math_IntegerVector TMultiplied(const Standard_Integer theRight) const;
|
||||
Standard_EXPORT Standard_NODISCARD math_IntegerVector TMultiplied(const Standard_Integer theRight) const;
|
||||
|
||||
friend inline math_IntegerVector operator* (const Standard_Integer theLeft, const math_IntegerVector& theRight)
|
||||
{
|
||||
@@ -160,9 +160,9 @@ public:
|
||||
//! adds the IntegerVector "theRight" to an IntegerVector.
|
||||
//! An exception is raised if the IntegerVectors have not the same length.
|
||||
//! An exception is raised if the lengths are not equal.
|
||||
Standard_EXPORT math_IntegerVector Added(const math_IntegerVector& theRight) const;
|
||||
Standard_EXPORT Standard_NODISCARD math_IntegerVector Added(const math_IntegerVector& theRight) const;
|
||||
|
||||
math_IntegerVector operator+(const math_IntegerVector& theRight) const
|
||||
Standard_NODISCARD math_IntegerVector operator+(const math_IntegerVector& theRight) const
|
||||
{
|
||||
return Added(theRight);
|
||||
}
|
||||
@@ -199,9 +199,9 @@ public:
|
||||
|
||||
//! returns the inner product of 2 IntegerVectors.
|
||||
//! An exception is raised if the lengths are not equal.
|
||||
Standard_EXPORT Standard_Integer Multiplied(const math_IntegerVector& theRight) const;
|
||||
Standard_EXPORT Standard_NODISCARD Standard_Integer Multiplied(const math_IntegerVector& theRight) const;
|
||||
|
||||
Standard_Integer operator*(const math_IntegerVector& theRight) const
|
||||
Standard_NODISCARD Standard_Integer operator*(const math_IntegerVector& theRight) const
|
||||
{
|
||||
return Multiplied(theRight);
|
||||
}
|
||||
@@ -225,9 +225,9 @@ public:
|
||||
|
||||
//! returns the subtraction of "theRight" from "me".
|
||||
//! An exception is raised if the IntegerVectors have not the same length.
|
||||
Standard_EXPORT math_IntegerVector Subtracted(const math_IntegerVector& theRight) const;
|
||||
Standard_EXPORT Standard_NODISCARD math_IntegerVector Subtracted(const math_IntegerVector& theRight) const;
|
||||
|
||||
math_IntegerVector operator-(const math_IntegerVector& theRight) const
|
||||
Standard_NODISCARD math_IntegerVector operator-(const math_IntegerVector& theRight) const
|
||||
{
|
||||
return Subtracted(theRight);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user