1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-18 14:27:39 +03: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:
Benjamin Bihler
2019-02-25 12:52:01 +03:00
committed by apn
parent 1c8fc6bee2
commit 0be7dbe183
70 changed files with 454 additions and 431 deletions

View File

@@ -165,7 +165,7 @@ public:
//! Performs the symmetrical transformation of a parabola
//! with respect to the point P which is the center of the
//! symmetry.
Standard_EXPORT gp_Parab Mirrored (const gp_Pnt& P) const;
Standard_EXPORT Standard_NODISCARD gp_Parab Mirrored (const gp_Pnt& P) const;
Standard_EXPORT void Mirror (const gp_Ax1& A1);
@@ -173,7 +173,7 @@ public:
//! Performs the symmetrical transformation of a parabola
//! with respect to an axis placement which is the axis of
//! the symmetry.
Standard_EXPORT gp_Parab Mirrored (const gp_Ax1& A1) const;
Standard_EXPORT Standard_NODISCARD gp_Parab Mirrored (const gp_Ax1& A1) const;
Standard_EXPORT void Mirror (const gp_Ax2& A2);
@@ -181,14 +181,14 @@ public:
//! Performs the symmetrical transformation of a parabola
//! with respect to a plane. The axis placement A2 locates
//! the plane of the symmetry (Location, XDirection, YDirection).
Standard_EXPORT gp_Parab Mirrored (const gp_Ax2& A2) const;
Standard_EXPORT Standard_NODISCARD gp_Parab Mirrored (const gp_Ax2& A2) const;
void Rotate (const gp_Ax1& A1, const Standard_Real Ang);
//! Rotates a parabola. A1 is the axis of the rotation.
//! Ang is the angular value of the rotation in radians.
gp_Parab Rotated (const gp_Ax1& A1, const Standard_Real Ang) const;
Standard_NODISCARD gp_Parab Rotated (const gp_Ax1& A1, const Standard_Real Ang) const;
void Scale (const gp_Pnt& P, const Standard_Real S);
@@ -196,26 +196,26 @@ public:
//! Scales a parabola. S is the scaling value.
//! If S is negative the direction of the symmetry axis
//! XAxis is reversed and the direction of the YAxis too.
gp_Parab Scaled (const gp_Pnt& P, const Standard_Real S) const;
Standard_NODISCARD gp_Parab Scaled (const gp_Pnt& P, const Standard_Real S) const;
void Transform (const gp_Trsf& T);
//! Transforms a parabola with the transformation T from class Trsf.
gp_Parab Transformed (const gp_Trsf& T) const;
Standard_NODISCARD gp_Parab Transformed (const gp_Trsf& T) const;
void Translate (const gp_Vec& V);
//! Translates a parabola in the direction of the vector V.
//! The magnitude of the translation is the vector's magnitude.
gp_Parab Translated (const gp_Vec& V) const;
Standard_NODISCARD gp_Parab Translated (const gp_Vec& V) const;
void Translate (const gp_Pnt& P1, const gp_Pnt& P2);
//! Translates a parabola from the point P1 to the point P2.
gp_Parab Translated (const gp_Pnt& P1, const gp_Pnt& P2) const;
Standard_NODISCARD gp_Parab Translated (const gp_Pnt& P1, const gp_Pnt& P2) const;