mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-08-15 15:00:30 +08:00
Coding - Refactor switch-case statements and improve memory management #569
- Added missing break statements in switch-case blocks in LDOMBasicString, LDOM_BasicElement, PCDM_ReadWriter, and IntCurve_IntConicConic_1 to prevent fall-through behavior. - Enhanced Standard_Macro.hxx to support fallthrough attributes across different compilers. - Corrected the use of std::forward in Standard_MemoryUtils.hxx for better type deduction. - Replaced raw arrays with NCollection_Array1 in AdvApp2Var_SysBase for improved memory safety. - Updated Extrema_ExtCC2d to utilize smart pointers for better memory management and avoid potential leaks. - Refactored Units_UnitsDictionary to use NCollection_Array2 for matrix representation, improving readability and maintainability. - Initialized TranFirst and TranLast in TopTrans_CurveTransition constructor for better default state management. - Set myStatus in ShapeConstruct_ProjectCurveOnSurface constructor to ensure proper initialization. - Changed matrix access in Units_UnitsDictionary to use NCollection_Array2 syntax for consistency.
This commit is contained in:
@@ -2068,6 +2068,7 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1,
|
||||
ParamEnd2 = ParamEnd - Org2SurL1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: //~~~ Segment Infini a droite
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -486,6 +486,7 @@ void Recadre(const Standard_Boolean,
|
||||
U1 += M_PI + M_PI;
|
||||
while (U1 > (U1p + 1.5 * M_PI))
|
||||
U1 -= M_PI + M_PI;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -504,6 +505,7 @@ void Recadre(const Standard_Boolean,
|
||||
U2 += M_PI + M_PI;
|
||||
while (U2 > (U2p + 1.5 * M_PI))
|
||||
U2 -= M_PI + M_PI;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ TopTrans_CurveTransition::TopTrans_CurveTransition()
|
||||
CurvFirst(0.0),
|
||||
CurvLast(0.0)
|
||||
{
|
||||
TranFirst = TopAbs_FORWARD;
|
||||
TranLast = TopAbs_FORWARD;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
||||
+1
@@ -108,6 +108,7 @@ ShapeConstruct_ProjectCurveOnSurface::ShapeConstruct_ProjectCurveOnSurface()
|
||||
myBuild = Standard_False;
|
||||
myAdjustOverDegen = 1; //: c0 //szv#4:S4163:12Mar99 was boolean
|
||||
myNbCashe = 0; //: q9
|
||||
myStatus = ShapeExtend::EncodeStatus(ShapeExtend_OK);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Reference in New Issue
Block a user