IntersectionOfSets( const NCollection_List<Standard_Integer>& theSet1,
const NCollection_List<Standard_Integer>& theSet2)
{
- const Standard_Integer anIntMax = IntegerLast();
+ constexpr Standard_Integer anIntMax = IntegerLast();
Standard_Integer aRetVal = anIntMax;
for(NCollection_List<Standard_Integer>::Iterator
anIt1 = theSet1.begin().Iterator();
Standard_Real xs1,Standard_Real ys1,
Standard_Real xs2,Standard_Real ys2)
{
- Standard_Real eps = RealSmall();
+ constexpr Standard_Real eps = RealSmall();
Standard_Real xsmin = Min (xs1, xs2);
Standard_Real xsmax = Max (xs1, xs2);
Standard_Real ysmin = Min (ys1, ys2);
if (IsWhole()) return Standard_False;
else if (IsVoid()) return Standard_True;
- Standard_Real eps = RealSmall();
+ constexpr Standard_Real eps = RealSmall();
Standard_Real myXmin, myYmin, myZmin, myXmax, myYmax, myZmax;
Get (myXmin, myYmin, myZmin, myXmax, myYmax, myZmax);
{
// Get 3 coordinate axes of the plane.
const gp_Dir &aNorm = aPlane.Axis().Direction();
- const Standard_Real anAngularTol = RealEpsilon();
+ constexpr Standard_Real anAngularTol = RealEpsilon();
// Get location of the plane as its barycenter
gp_Pnt aLocation = BaryCenter(aPlane, aUMin, aUMax, aVMin, aVMax);
IntAna2d_AnaIntersection Intp(linsol(1),TheCircle);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
- Standard_Real maxdist = RealLast();
+ constexpr Standard_Real maxdist = RealLast();
for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
if (Intp.Point(i).Value().Distance(ThePnt) < maxdist) {
pntint2sol(1) = Intp.Point(i).Value();
IntAna2d_AnaIntersection Intp(linsol(NbrSol),TheCircle);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
- Standard_Real maxdist = RealLast();
+ constexpr Standard_Real maxdist = RealLast();
for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
if (Intp.Point(i).Value().Distance(pnttg1sol(NbrSol)) < maxdist) {
pntint2sol(NbrSol) = Intp.Point(i).Value();
aResult.Update (aBox.CornerMin().x(), aBox.CornerMin().y(), aBox.CornerMin().z(),
aBox.CornerMax().x(), aBox.CornerMax().y(), aBox.CornerMax().z());
- Standard_Real aLimMin = ShortRealFirst() + 1.0;
- Standard_Real aLimMax = ShortRealLast() - 1.0;
+ constexpr Standard_Real aLimMin = ShortRealFirst() + 1.0;
+ constexpr Standard_Real aLimMax = ShortRealLast() - 1.0;
gp_Pnt aMin = aResult.CornerMin();
gp_Pnt aMax = aResult.CornerMax();
if (aMin.X() < aLimMin && aMin.Y() < aLimMin && aMin.Z() < aLimMin
const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ,
Standard_Real& theNewX, Standard_Real& theNewY, Standard_Real& theNewZ)
{
- const Standard_Real aRL = RealLast();
- const Standard_Real aRF = RealFirst();
+ constexpr Standard_Real aRL = RealLast();
+ constexpr Standard_Real aRF = RealFirst();
theNewX = theX;
theNewY = theY;
theNewZ = theZ;
fprm=aSeqFprm(i);
lprm=aSeqLprm(i);
//
- Standard_Real aRealEpsilon=RealEpsilon();
+ constexpr Standard_Real aRealEpsilon=RealEpsilon();
if (Abs(fprm) > aRealEpsilon || Abs(lprm-2.*M_PI) > aRealEpsilon) {
//==============================================
////
myPoints =
(LocOpe_SequenceOfPntFace *) new LocOpe_SequenceOfPntFace[myNbelem];
- Standard_Real binf = RealFirst();
- Standard_Real bsup = RealLast();
+ constexpr Standard_Real binf = RealFirst();
+ constexpr Standard_Real bsup = RealLast();
TopExp_Explorer exp(myShape,TopAbs_FACE);
for (; exp.More(); exp.Next()) {
const TopoDS_Face& theface = TopoDS::Face(exp.Current());
static inline Standard_Integer getNearestPow2( Standard_Integer theValue )
{
// Precaution against overflow
- Standard_Integer aHalfMax = IntegerLast() >> 1, aRes = 1;
+ constexpr Standard_Integer aHalfMax = IntegerLast() >> 1;
+ Standard_Integer aRes = 1;
if ( theValue > aHalfMax ) theValue = aHalfMax;
while ( aRes < theValue ) aRes <<= 1;
return aRes;
di << "(Integer) Overflow...";
//std::cout.flush();
di << "\n";
- Standard_Integer res, i=IntegerLast();
- res = i + 1;
- //++++ std::cout << " -- "<<res<<"="<<i<<"+1 Does not Caught... KO"<< std::endl;
- //++++ Succes = Standard_False;
+#if defined(__clang__)
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Winteger-overflow"
+#elif defined(__GNUC__)
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Woverflow"
+#endif
+ constexpr Standard_Integer i=IntegerLast();
+ Standard_Integer res = i + 1;
+#if defined(__clang__)
+ #pragma clang diagnostic pop
+#elif defined(__GNUC__)
+ #pragma GCC diagnostic pop
+#endif
di << "Not caught: " << i << " + 1 = " << res << ", still OK\n";
}
catch(Standard_Overflow const&) {
di << "(Real) Overflow...";
//std::cout.flush();
di << "\n";
- Standard_Real res, r=RealLast();
- res = r * r;
+ constexpr Standard_Real r = RealLast();
+ Standard_Real res = r * r;
(void)sin(1.); //this function tests FPU flags and raises signal (tested on LINUX).
di << "(Real) Underflow";
//std::cout.flush();
di << "\n";
- Standard_Real res, r = RealSmall();
- res = r * r;
+ constexpr Standard_Real r = RealSmall();
+ Standard_Real res = r * r;
//res = res + 1.;
//++++ std::cout<<"-- "<<res<<"="<<r<<"*"<<r<<" Does not Caught... KO"<<std::endl;
//++++ Succes = Standard_False;
gp_Dir dir(X_Dir, Y_Dir, Z_Dir);
gp_Lin ray(origin, dir);
- Standard_Real PSup = RealLast();
+ constexpr Standard_Real PSup = RealLast();
intersector.PerformNearest(ray, PInf, PSup);
if (intersector.NbPnt() != 0)
{
//-------------------------------------------------------------------
// ShortRealFirst : Returns the minimum negative value of a ShortReal
//-------------------------------------------------------------------
-inline Standard_ShortReal ShortRealFirst()
-{ Standard_ShortReal MaxFloatTmp = -FLT_MAX;
- return MaxFloatTmp; }
+constexpr Standard_ShortReal ShortRealFirst()
+{ return -FLT_MAX; }
//-------------------------------------------------------------------
// ShortRealFirst10Exp : Returns the minimum value of exponent(base 10) of
C = BL.Curvature();
// xpu150399 cto900R4
- Standard_Real tol1 = Epsilon(0.), tol2 = RealLast();
+ const Standard_Real tol1 = Epsilon(0.);
+ constexpr Standard_Real tol2 = RealLast();
Standard_Real tolm = Max(tol,Max(tol1,tol2));
if ( Abs(C) > tolm ) BL.Normal(N);
return;
}
// Modified by Sergey KHROMOV - Wed Jan 22 12:06:45 2003 Begin
- Standard_Real aFTol = RealEpsilon();
+ constexpr Standard_Real aFTol = RealEpsilon();
// if(fl * fh >= 0.0) {
if(fl * fh > aFTol*aFTol) {