mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0024489: Avoid type casts in call to Standard::Free()
Method Standard::Free() is converted to template, so that pointer is nullified using its proper type. Unnecessary type cases in calls to Standard::Free(), Standard::Reallocate(), and NCollection_BaseAllocator::Free() eliminated throughout OCCT code.
This commit is contained in:
@@ -70,7 +70,7 @@ typedef NCollection_DataMap <TCollection_AsciiString,
|
||||
//
|
||||
Storage_Bucket::~Storage_Bucket()
|
||||
{
|
||||
Standard::Free((Standard_Address&)mySpace);
|
||||
Standard::Free (mySpace);
|
||||
mySpace = 0L;
|
||||
mySpaceSize = 0;
|
||||
Clear();
|
||||
@@ -150,7 +150,7 @@ Storage_BucketOfPersistent::~Storage_BucketOfPersistent()
|
||||
{
|
||||
Clear();
|
||||
delete myBuckets[0];
|
||||
Standard::Free((Standard_Address&)myBuckets);
|
||||
Standard::Free (myBuckets);
|
||||
myBuckets = 0L;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ void Storage_BucketOfPersistent::Append(const Handle(Standard_Persistent)& sp)
|
||||
|
||||
if (myNumberOfBucket > myNumberOfBucketAllocated) {
|
||||
Standard_Size e = sizeof(Storage_Bucket*) * myNumberOfBucketAllocated;
|
||||
myBuckets = (Storage_Bucket**)Standard::Reallocate((Standard_Address&)myBuckets, e * 2);
|
||||
myBuckets = (Storage_Bucket**)Standard::Reallocate(myBuckets, e * 2);
|
||||
myNumberOfBucketAllocated *= 2;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user