From efef9da8e5c588b8662f4c474a5a7880af2ea611 Mon Sep 17 00:00:00 2001 From: Roman Lygin Date: Tue, 16 Jul 2013 21:33:29 +0400 Subject: [PATCH] 0024072: VC 2009 64-bit compiler crashes while compiling IntPoly_ShapeSection.cxx --- src/IntPoly/IntPoly_ShapeSection.cxx | 2 +- src/TCollection/TCollection_Array1.cdl | 1 - src/TCollection/TCollection_Array1.gxx | 13 +++++ src/TCollection/TCollection_Array1.lxx | 15 ------ src/TCollection/TCollection_Array2.cdl | 5 -- src/TCollection/TCollection_Array2.gxx | 67 +++++++++++++++++++++++++ src/TCollection/TCollection_Array2.lxx | 68 -------------------------- 7 files changed, 81 insertions(+), 90 deletions(-) diff --git a/src/IntPoly/IntPoly_ShapeSection.cxx b/src/IntPoly/IntPoly_ShapeSection.cxx index 39b968c7d1..ea0b13f828 100755 --- a/src/IntPoly/IntPoly_ShapeSection.cxx +++ b/src/IntPoly/IntPoly_ShapeSection.cxx @@ -375,7 +375,7 @@ void IntPoly_ShapeSection::Explore() const gp_Pnt& A1 = TA1.Value(i); const gp_Pnt& A2 = TA2.Value(i); const gp_Pnt& A3 = TA3.Value(i); - gp_Vec OA1(A1.XYZ()); + gp_Vec OA1(A1.X(), A1.Y(), A1.Z()); gp_Vec VA0 = gp_Vec(A1,A2); gp_Vec VA = gp_Vec(A1,A3); VA0.Cross(VA); diff --git a/src/TCollection/TCollection_Array1.cdl b/src/TCollection/TCollection_Array1.cdl index bf1501414f..7739b8895d 100755 --- a/src/TCollection/TCollection_Array1.cdl +++ b/src/TCollection/TCollection_Array1.cdl @@ -85,7 +85,6 @@ is Init (me: in out; V: Array1Item); ---Purpose: Initializes the array with a given value. - ---C++: inline Destroy (me: in out); ---Purpose: Frees the allocated area corresponding to the diff --git a/src/TCollection/TCollection_Array1.gxx b/src/TCollection/TCollection_Array1.gxx index a1dfdde06d..974a53c3c6 100755 --- a/src/TCollection/TCollection_Array1.gxx +++ b/src/TCollection/TCollection_Array1.gxx @@ -19,6 +19,19 @@ #include +//======================================================================= +//function : Init +//purpose : +//======================================================================= + +void TCollection_Array1::Init (const Array1Item& V) { + Array1Item* p = &ChangeValue(myLowerBound); + const Standard_Integer n = Length(); + for(Standard_Integer i = 0; i < n; i++) { + p[i] = V; + } +} + //======================================================================= //function : Assign //purpose : diff --git a/src/TCollection/TCollection_Array1.lxx b/src/TCollection/TCollection_Array1.lxx index 5e43c5a63b..cdbd629247 100755 --- a/src/TCollection/TCollection_Array1.lxx +++ b/src/TCollection/TCollection_Array1.lxx @@ -17,7 +17,6 @@ // and conditions governing the rights and limitations under the License. #include -#include #include #include @@ -39,7 +38,6 @@ inline TCollection_Array1::TCollection_Array1 (const Standard_Integer Low, Array1Item* p = new Array1Item[Up-Low+1]; - if (!p) Standard_OutOfMemory::Raise("Array1 : Allocation failed"); myStart = (void*)(p - myLowerBound); } @@ -59,19 +57,6 @@ inline TCollection_Array1::TCollection_Array1(const Array1Item& AnItem, myStart = (void*)( &AnItem - Low ); } -//======================================================================= -//function : Init -//purpose : -//======================================================================= - -inline void TCollection_Array1::Init (const Array1Item& V) { - Array1Item* p = &ChangeValue(myLowerBound); - const Standard_Integer n = Length(); - for(Standard_Integer i = 0; i < n; i++) { - p[i] = V; - } -} - //======================================================================= //function : Destroy //purpose : diff --git a/src/TCollection/TCollection_Array2.cdl b/src/TCollection/TCollection_Array2.cdl index 4a3fe6ca42..03522871b1 100755 --- a/src/TCollection/TCollection_Array2.cdl +++ b/src/TCollection/TCollection_Array2.cdl @@ -50,13 +50,11 @@ is raises RangeError from Standard, OutOfMemory from Standard; - ---C++: inline Create (AnArray : Array2) returns Array2 from TCollection ---Purpose: creates an Array2 by copy of an Array2. raises OutOfMemory from Standard is private ; - ---C++: inline Create (Item : Array2Item; R1, R2, C1, C2: Integer from Standard) returns Array2 from TCollection @@ -75,11 +73,9 @@ is raises RangeError from Standard, OutOfMemory from Standard; - ---C++: inline Init(me : in out; V : Array2Item); ---Purpose: Initializes this array with the value . - ---C++: inline Destroy (me : in out ); ---Level: Advanced @@ -88,7 +84,6 @@ is -- DoubleArray the Destroy doesn't delete the area. -- ---C++: alias ~ - ---C++: inline Assign (me: in out; Other: Array2) returns Array2 from TCollection diff --git a/src/TCollection/TCollection_Array2.gxx b/src/TCollection/TCollection_Array2.gxx index 059391311a..e6de9ab803 100755 --- a/src/TCollection/TCollection_Array2.gxx +++ b/src/TCollection/TCollection_Array2.gxx @@ -59,6 +59,73 @@ void TCollection_Array2::Allocate () myData = (void*) (q - myLowerRow); } +//======================================================================= +//function : TCollection_Array2 +//purpose : +//======================================================================= + +TCollection_Array2::TCollection_Array2 (const Standard_Integer R1, + const Standard_Integer R2, + const Standard_Integer C1, + const Standard_Integer C2) : + myLowerRow(R1), + myLowerColumn(C1), + myUpperRow(R2), + myUpperColumn(C2), + myDeletable(Standard_True) +{ + Allocate (); +} + +//======================================================================= +//function : TCollection_Array2 +//purpose : User allocated data +//======================================================================= + +TCollection_Array2::TCollection_Array2 (const Array2Item& Item, + const Standard_Integer R1, + const Standard_Integer R2, + const Standard_Integer C1, + const Standard_Integer C2) : + myLowerRow(R1), + myLowerColumn(C1), + myUpperRow(R2), + myUpperColumn(C2), + myDeletable(Standard_False), + myData((void*)&Item) +{ + Allocate (); +} + +//======================================================================= +//function : Init +//purpose : +//======================================================================= + +void TCollection_Array2::Init (const Array2Item& V) +{ + Standard_Integer Size = RowLength() * ColLength(); + Array2Item* p = &(ChangeValue(myLowerRow,myLowerColumn)); + for (Standard_Integer I = 0; I < Size ; I++) p[I] = V; +} + +//======================================================================= +//function : Destroy +//purpose : +//======================================================================= + +void TCollection_Array2::Destroy () +{ + Array2Item** anItemPtr = ((Array2Item**)myData + myLowerRow); + + // delete the data + // + if (myDeletable) + delete [] &ChangeValue(myLowerRow,myLowerColumn); + + // delete the indirection table + Standard::Free((void*&)anItemPtr); +} //======================================================================= //function : Assign diff --git a/src/TCollection/TCollection_Array2.lxx b/src/TCollection/TCollection_Array2.lxx index 405a2711d3..7211c98a6f 100755 --- a/src/TCollection/TCollection_Array2.lxx +++ b/src/TCollection/TCollection_Array2.lxx @@ -21,74 +21,6 @@ #include Array2Item_hxx -//======================================================================= -//function : TCollection_Array2 -//purpose : -//======================================================================= - -inline TCollection_Array2::TCollection_Array2 (const Standard_Integer R1, - const Standard_Integer R2, - const Standard_Integer C1, - const Standard_Integer C2) : - myLowerRow(R1), - myLowerColumn(C1), - myUpperRow(R2), - myUpperColumn(C2), - myDeletable(Standard_True) -{ - Allocate (); -} - -//======================================================================= -//function : TCollection_Array2 -//purpose : User allocated data -//======================================================================= - -inline TCollection_Array2::TCollection_Array2 (const Array2Item& Item, - const Standard_Integer R1, - const Standard_Integer R2, - const Standard_Integer C1, - const Standard_Integer C2) : - myLowerRow(R1), - myLowerColumn(C1), - myUpperRow(R2), - myUpperColumn(C2), - myDeletable(Standard_False), - myData((void*)&Item) -{ - Allocate (); -} - -//======================================================================= -//function : Init -//purpose : -//======================================================================= - -inline void TCollection_Array2::Init (const Array2Item& V) -{ - Standard_Integer Size = RowLength() * ColLength(); - Array2Item* p = &(ChangeValue(myLowerRow,myLowerColumn)); - for (Standard_Integer I = 0; I < Size ; I++) p[I] = V; -} - -//======================================================================= -//function : Destroy -//purpose : -//======================================================================= - -inline void TCollection_Array2::Destroy () -{ - Array2Item** anItemPtr = ((Array2Item**)myData + myLowerRow); - - // delete the data - // - if (myDeletable) - delete [] &ChangeValue(myLowerRow,myLowerColumn); - - // delete the indirection table - Standard::Free((void*&)anItemPtr); -} - //======================================================================= //function : ColLength //purpose :