]> OCCT Git - occt.git/commit
Coding - Refactor switch-case statements and improve memory management #569
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Fri, 30 May 2025 13:31:26 +0000 (14:31 +0100)
committerGitHub <noreply@github.com>
Fri, 30 May 2025 13:31:26 +0000 (14:31 +0100)
commit4629ee0ca357d852a49fefc9b82db07aecf655c3
tree21a15c85b5954fd4001392aaf65923c11b88ffd5
parent3b62a5eb2994cd2d5df798cd66c2addd950a3a40
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.
13 files changed:
src/ApplicationFramework/TKCDF/LDOM/LDOMBasicString.cxx
src/ApplicationFramework/TKCDF/LDOM/LDOM_BasicElement.cxx
src/ApplicationFramework/TKCDF/PCDM/PCDM_ReadWriter.cxx
src/FoundationClasses/TKernel/Standard/Standard_Macro.hxx
src/FoundationClasses/TKernel/Standard/Standard_MemoryUtils.hxx
src/FoundationClasses/TKernel/Units/Units_UnitsDictionary.cxx
src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_1.cxx
src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpPrmIntersection.cxx
src/ModelingAlgorithms/TKGeomAlgo/TopTrans/TopTrans_CurveTransition.cxx
src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx
src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cxx
src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_SysBase.cxx
src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCC2d.cxx