]> OCCT Git - occt-copy.git/commitdiff
0024238: Small changes related to review request of CR24238
authorazv <artem.zhidkov@opencascade.com>
Tue, 22 Oct 2013 05:40:28 +0000 (09:40 +0400)
committerazv <artem.zhidkov@opencascade.com>
Tue, 22 Oct 2013 05:40:28 +0000 (09:40 +0400)
src/BSplSLib/BSplSLib.cxx
src/Geom/FILES
src/Geom/Geom_BSplineCache.lxx
src/Geom/Handle_Geom_BSplineCache.hxx [deleted file]
src/NCollection/NCollection_AlignAllocator.hxx

index 1f13f3e1dac9d92af5836ac13dc3dc3bc58f6b5b..d09a156fe5d5c58b9339b91aa76172873f813dbc 100755 (executable)
@@ -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  ;
 
index cbef93b001a06844d5829da62ac7e12347bab1e1..5540986b72146ccb4abf9fe03c48961fad8d4a57 100755 (executable)
@@ -1,7 +1,6 @@
 Geom_BSplineCurve_1.cxx                
 Geom_BSplineSurface_1.cxx
 Geom_BSplineCache.lxx
-Handle_Geom_BSplineCache.hxx
 
 
 
index f93f2a89a243cbaf8436dcb580d194e1d407249f..cd15dfe49aad41984c641d6cf7ff7d2264f38605 100644 (file)
@@ -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 (file)
index 7f68e02..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef _Handle_Geom_BSplineCache_HeaderFile
-#define _Handle_Geom_BSplineCache_HeaderFile
-
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-#ifndef _Standard_DefineHandle_HeaderFile
-#include <Standard_DefineHandle.hxx>
-#endif
-#ifndef _Handle_MMgt_TShared_HeaderFile
-#include <Handle_MMgt_TShared.hxx>
-#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
index 2cdff7f4cd7eae765a5547c1da3bfd52072bf2ec..0747b6fda4ac3cf320b5ce6ff2fbaaaf8dd81086 100644 (file)
 // 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
+  // <theType> is an array type (example: Standard_Real)
+  // <thePtrDef> 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
 //======================================================