mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Get rid of NEW(), TRACKED_NEW, and ZERO().
This commit is contained in:
@ -178,7 +178,7 @@ CLockWaitSet * CLockWaitSetAllocator::Alloc () {
|
||||
if (!s_allocator || !s_allocator->m_spareList.Head()) {
|
||||
if (!s_allocator)
|
||||
atexit(Shutdown);
|
||||
s_allocator = NEW(CLockWaitSetAllocator)(s_allocator);
|
||||
s_allocator = new CLockWaitSetAllocator(s_allocator);
|
||||
}
|
||||
|
||||
// Get an available wait set from the active allocator
|
||||
|
@ -122,7 +122,7 @@ int BigNum::Compare (uint32_t a) const {
|
||||
//===========================================================================
|
||||
void BigNum::FromData_LE (unsigned bytes, const void * data)
|
||||
{
|
||||
unsigned char * buffer = TRACKED_NEW unsigned char[bytes];
|
||||
unsigned char * buffer = new unsigned char[bytes];
|
||||
memcpy(buffer, data, bytes);
|
||||
byteswap(bytes, buffer);
|
||||
BN_bin2bn(buffer, bytes, &m_number);
|
||||
@ -133,7 +133,7 @@ void BigNum::FromData_LE (unsigned bytes, const void * data)
|
||||
unsigned char * BigNum::GetData_BE (unsigned * bytes) const
|
||||
{
|
||||
*bytes = BN_num_bytes(&m_number);
|
||||
unsigned char * data = TRACKED_NEW unsigned char[*bytes];
|
||||
unsigned char * data = new unsigned char[*bytes];
|
||||
BN_bn2bin(&m_number, data);
|
||||
return data;
|
||||
}
|
||||
@ -142,7 +142,7 @@ unsigned char * BigNum::GetData_BE (unsigned * bytes) const
|
||||
unsigned char * BigNum::GetData_LE (unsigned * bytes) const
|
||||
{
|
||||
*bytes = BN_num_bytes(&m_number);
|
||||
unsigned char * data = TRACKED_NEW unsigned char[*bytes];
|
||||
unsigned char * data = new unsigned char[*bytes];
|
||||
BN_bn2bin(&m_number, data);
|
||||
byteswap(*bytes, data);
|
||||
return data;
|
||||
|
@ -594,7 +594,7 @@ unsigned CCmdParser::GetUnsigned (const wchar_t name[]) const {
|
||||
|
||||
//===========================================================================
|
||||
void CCmdParser::Initialize (const CmdArgDef def[], unsigned defCount) {
|
||||
fParser = NEW(CICmdParser)(def, defCount);
|
||||
fParser = new CICmdParser(def, defCount);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -232,9 +232,9 @@ CryptKey * CryptKeyCreate (
|
||||
CryptKey * key = nil;
|
||||
switch (algorithm) {
|
||||
case kCryptRc4: {
|
||||
RC4_KEY * rc4 = NEW(RC4_KEY);
|
||||
RC4_KEY * rc4 = new RC4_KEY;
|
||||
RC4_set_key(rc4, bytes, (const unsigned char *)data);
|
||||
key = NEW(CryptKey);
|
||||
key = new CryptKey;
|
||||
key->algorithm = kCryptRc4;
|
||||
key->handle = rc4;
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
* BSEARCH
|
||||
*
|
||||
* This macro binary searches a sorted array to find an existing entry or
|
||||
* the position where a TRACKED_NEW entry should be placed. It returns the index of
|
||||
* the position where a new entry should be placed. It returns the index of
|
||||
* the first entry for which the expression is false (zero or negative), or
|
||||
* count if the expression is true (positive) for all entries.
|
||||
*
|
||||
|
@ -147,7 +147,7 @@ bool IParseForSubst (
|
||||
// We've found a variable, copy the current data to a new object
|
||||
if (current != src) {
|
||||
int strLen = (current - src) - 1;
|
||||
SUBST_BLOCK * block = NEW(SUBST_BLOCK);
|
||||
SUBST_BLOCK * block = new SUBST_BLOCK;
|
||||
block->isVar = false;
|
||||
block->strLen = strLen;
|
||||
block->data = (chartype*)ALLOCZERO((strLen + 1) * sizeof(chartype));
|
||||
@ -166,7 +166,7 @@ bool IParseForSubst (
|
||||
|
||||
// Copy variable name excluding trailing '%'
|
||||
int strLen = (varEnd - varStart);
|
||||
SUBST_BLOCK * block = NEW(SUBST_BLOCK);
|
||||
SUBST_BLOCK * block = new SUBST_BLOCK;
|
||||
block->isVar = true;
|
||||
block->strLen = strLen;
|
||||
block->data = (chartype*)ALLOCZERO((strLen + 1) * sizeof(chartype));
|
||||
@ -180,7 +180,7 @@ bool IParseForSubst (
|
||||
// Check and see if there's any data remaining
|
||||
if (current != src) {
|
||||
int strLen = (current - src);
|
||||
SUBST_BLOCK * block = NEW(SUBST_BLOCK);
|
||||
SUBST_BLOCK * block = new SUBST_BLOCK;
|
||||
block->isVar = false;
|
||||
block->strLen = strLen;
|
||||
block->data = (chartype*)ALLOCZERO((strLen + 1) * sizeof(chartype));
|
||||
|
Reference in New Issue
Block a user