1
0
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:
abv
2014-01-09 11:56:20 +04:00
committed by bugmaster
parent b24ac89262
commit 547702a15d
28 changed files with 105 additions and 123 deletions

View File

@@ -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;
}