From: azv Date: Tue, 22 Oct 2013 05:40:28 +0000 (+0400) Subject: 0024238: Small changes related to review request of CR24238 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=50a4276b8184020ded85b7dd60fe6ff4678e839c;p=occt-copy.git 0024238: Small changes related to review request of CR24238 --- diff --git a/src/BSplSLib/BSplSLib.cxx b/src/BSplSLib/BSplSLib.cxx index 1f13f3e1da..d09a156fe5 100755 --- a/src/BSplSLib/BSplSLib.cxx +++ b/src/BSplSLib/BSplSLib.cxx @@ -2081,9 +2081,9 @@ void BSplSLib::CacheD0( // 0 and 1 Standard_Integer dimension, min_degree, max_degree; Standard_Real new_parameter[2], inverse; - MEMALIGN(Standard_Real *PArray) = (Standard_Real *) &(PolesWeightsArray(PolesWeightsArray.LowerCol(), PolesWeightsArray.LowerRow())); + MEMALIGN(Standard_Real, *PArray) = (Standard_Real *) &(PolesWeightsArray(PolesWeightsArray.LowerCol(), PolesWeightsArray.LowerRow())); Standard_Real *myPoint = (Standard_Real *) &aPoint; - MEMALIGN(Standard_Real local_pole_and_weight[4]); + MEMALIGN(Standard_Real, local_pole_and_weight[4]); if (UDegree <= VDegree) { @@ -2164,9 +2164,9 @@ void BSplSLib::CacheD1( // 0 and 1 Standard_Integer dimension, min_degree, max_degree, ii; Standard_Real inverse_min, inverse_max, new_parameter[2]; - MEMALIGN(Standard_Real *PArray) = (Standard_Real *) &(PolesWeightsArray(PolesWeightsArray.LowerCol(), PolesWeightsArray.LowerRow())); - MEMALIGN(Standard_Real local_poles_array[4][3]); - MEMALIGN(Standard_Real local_poles_and_weights_array[4][4]); + MEMALIGN(Standard_Real, *PArray) = (Standard_Real *) &(PolesWeightsArray(PolesWeightsArray.LowerCol(), PolesWeightsArray.LowerRow())); + MEMALIGN(Standard_Real, local_poles_array[4][3]); + MEMALIGN(Standard_Real, local_poles_and_weights_array[4][4]); Standard_Real *my_vec_min, *my_vec_max, *my_point; my_point = (Standard_Real *) &aPoint; @@ -2287,9 +2287,9 @@ void BSplSLib::CacheD2( // 0 and 1 Standard_Integer ii, kk, index, dimension, min_degree, max_degree; Standard_Real inverse_min, inverse_max, new_parameter[2]; - MEMALIGN(Standard_Real *PArray) = (Standard_Real *) &(PolesWeightsArray(PolesWeightsArray.LowerCol(), PolesWeightsArray.LowerRow())); - MEMALIGN(Standard_Real local_poles_array[9][3]); - MEMALIGN(Standard_Real local_poles_and_weights_array[9][4]); + MEMALIGN(Standard_Real, *PArray) = (Standard_Real *) &(PolesWeightsArray(PolesWeightsArray.LowerCol(), PolesWeightsArray.LowerRow())); + MEMALIGN(Standard_Real, local_poles_array[9][3]); + MEMALIGN(Standard_Real, local_poles_and_weights_array[9][4]); Standard_Real *my_vec_min, *my_vec_max, *my_vec_min_min, *my_vec_max_max, *my_vec_min_max, *my_point; my_point = (Standard_Real *) &aPoint ; diff --git a/src/Geom/FILES b/src/Geom/FILES index cbef93b001..5540986b72 100755 --- a/src/Geom/FILES +++ b/src/Geom/FILES @@ -1,7 +1,6 @@ Geom_BSplineCurve_1.cxx Geom_BSplineSurface_1.cxx Geom_BSplineCache.lxx -Handle_Geom_BSplineCache.hxx diff --git a/src/Geom/Geom_BSplineCache.lxx b/src/Geom/Geom_BSplineCache.lxx index f93f2a89a2..cd15dfe49a 100644 --- a/src/Geom/Geom_BSplineCache.lxx +++ b/src/Geom/Geom_BSplineCache.lxx @@ -3,22 +3,6 @@ #endif -Geom_BSplineCache::Geom_BSplineCache(const Standard_Integer theRowLower, const Standard_Integer theRowUpper, - const Standard_Integer theColumnLower, const Standard_Integer theColumnUpper) - : myCacheArray( - *(Standard_Real*)NCollection_AlignAllocator::Allocate( - (theRowUpper-theRowLower+1)*(theColumnUpper-theColumnLower+1)*sizeof(Standard_Real), - DATA_ALIGNMENT), - theRowLower, theRowUpper, theColumnLower, theColumnUpper) - {} - -void Geom_BSplineCache::Destroy() -{ - Standard_Real* aPtr = (Standard_Real*) &(myCacheArray(myCacheArray.LowerCol(), myCacheArray.LowerRow())); - if (aPtr) - NCollection_AlignAllocator::Free(aPtr); -} - inline const TColStd_Array2OfReal& Geom_BSplineCache::Array2() const { return myCacheArray; diff --git a/src/Geom/Handle_Geom_BSplineCache.hxx b/src/Geom/Handle_Geom_BSplineCache.hxx deleted file mode 100644 index 7f68e02676..0000000000 --- a/src/Geom/Handle_Geom_BSplineCache.hxx +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _Handle_Geom_BSplineCache_HeaderFile -#define _Handle_Geom_BSplineCache_HeaderFile - -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Standard_DefineHandle_HeaderFile -#include -#endif -#ifndef _Handle_MMgt_TShared_HeaderFile -#include -#endif - -class Standard_Transient; -class Handle(Standard_Type); -class Handle(MMgt_TShared); -class Geom_BSplineCache; - -DEFINE_STANDARD_HANDLE(Geom_BSplineCache,MMgt_TShared) - -#endif // _Handle_Geom_BSplineCache_HeaderFile diff --git a/src/NCollection/NCollection_AlignAllocator.hxx b/src/NCollection/NCollection_AlignAllocator.hxx index 2cdff7f4cd..0747b6fda4 100644 --- a/src/NCollection/NCollection_AlignAllocator.hxx +++ b/src/NCollection/NCollection_AlignAllocator.hxx @@ -41,12 +41,15 @@ // The macro for array (pointer) alignment according DATA_ALIGNMENT #ifdef NEED_DATA_ALIGN # ifdef _MSC_VER -# define MEMALIGN(thePtrDef) __declspec(align(DATA_ALIGNMENT)) thePtrDef + // MEMALIGN macro should be used for declaration of alignment of pointer or array + // is an array type (example: Standard_Real) + // is a pointer or array variable definition (example: *aPtr or anArray[2]) +# define MEMALIGN(theType, thePtrDef) __declspec(align(DATA_ALIGNMENT)) theType thePtrDef # else -# define MEMALIGN(thePtrDef) thePtrDef__attribute__((aligned(DATA_ALIGNMENT))) +# define MEMALIGN(theType, thePtrDef) theType thePtrDef __attribute__((aligned(DATA_ALIGNMENT))) # endif #else -# define MEMALIGN(thePtrDef) thePtrDef +# define MEMALIGN(theType, thePtrDef) theType thePtrDef #endif //======================================================