1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 03:09:13 +00:00

Get rid of NEW(), TRACKED_NEW, and ZERO().

This commit is contained in:
Darryl Pogue
2012-01-21 01:09:48 -08:00
committed by Adam Johnson
parent 30430d3024
commit 5013a978eb
423 changed files with 2500 additions and 2503 deletions

View File

@ -70,7 +70,7 @@ hsBool plZlibCompress::ICopyBuffers(uint8_t** bufIn, uint32_t* bufLenIn, char* b
if (ok)
{
*bufLenIn = bufLenOut+offset;
uint8_t* newBuf = TRACKED_NEW uint8_t[*bufLenIn]; // alloc new buffer
uint8_t* newBuf = new uint8_t[*bufLenIn]; // alloc new buffer
HSMemory::BlockMove(*bufIn, newBuf, offset); // copy offset (uncompressed) part
delete [] *bufIn; // delete original buffer
@ -94,7 +94,7 @@ hsBool plZlibCompress::Compress(uint8_t** bufIn, uint32_t* bufLenIn, int offset)
// according to compress doc, the bufOut buffer should be at least .1% larger than source buffer, plus 12 bytes.
uint32_t bufLenOut = (int)(adjBufLenIn*1.1+12);
char* bufOut = TRACKED_NEW char[bufLenOut];
char* bufOut = new char[bufLenOut];
bool ok=(Compress((uint8_t*)bufOut, &bufLenOut, (uint8_t*)adjBufIn, adjBufLenIn) &&
bufLenOut < adjBufLenIn);
@ -109,7 +109,7 @@ hsBool plZlibCompress::Uncompress(uint8_t** bufIn, uint32_t* bufLenIn, uint32_t
uint32_t adjBufLenIn = *bufLenIn - offset;
uint8_t* adjBufIn = *bufIn + offset;
char* bufOut = TRACKED_NEW char[bufLenOut];
char* bufOut = new char[bufLenOut];
bool ok=Uncompress((uint8_t*)bufOut, &bufLenOut, (uint8_t*)adjBufIn, adjBufLenIn) ? true : false;
return ICopyBuffers(bufIn, bufLenIn, bufOut, bufLenOut, offset, ok);

View File

@ -76,7 +76,7 @@ hsBool plZlibStream::Open(const wchar_t* filename, const wchar_t* mode)
fFilename = filename;
fMode = mode;
fOutput = NEW(hsUNIXStream);
fOutput = new hsUNIXStream;
return fOutput->Open(filename, L"wb");
}
@ -251,7 +251,7 @@ int plZlibStream::IValidateGzHeader(uint32_t byteCount, const void* buffer)
uint32_t clipBuffer = headerSize - initCacheSize;
// Initialize the zlib stream
z_streamp zstream = NEW(z_stream_s);
z_streamp zstream = new z_stream_s;
memset(zstream, 0, sizeof(z_stream_s));
zstream->zalloc = ZlibAlloc;
zstream->zfree = ZlibFree;