1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 19:29:09 +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

@ -183,7 +183,7 @@ int plSDLMgr::Read(hsStream* s, plSDL::DescriptorList* dl)
int i;
for(i=0;i<num;i++)
{
plStateDescriptor* sd=TRACKED_NEW plStateDescriptor;
plStateDescriptor* sd=new plStateDescriptor;
if (sd->Read(s))
dl->push_back(sd);
}

View File

@ -90,7 +90,7 @@ bool plSDLParser::IParseStateDesc(const char* fileName, hsStream* stream, char t
// curDesc=plSDLMgr::GetInstance()->FindDescriptor(token, plSDL::kLatestVersion);
// if (!curDesc)
{
curDesc = TRACKED_NEW plStateDescriptor;
curDesc = new plStateDescriptor;
curDesc->SetName(token);
DebugMsg("SDL: DESC name=%s", token);
@ -182,10 +182,10 @@ bool plSDLParser::IParseVarDesc(const char* fileName, hsStream* stream, char tok
plStateDescriptor* stateDesc = plSDLMgr::GetInstance()->FindDescriptor(sdlName, plSDL::kLatestVersion);
hsAssert(stateDesc, xtl::format("can't find nested state desc reference %s, fileName=%s",
sdlName, fileName).c_str());
curVar = TRACKED_NEW plSDVarDescriptor(stateDesc);
curVar = new plSDVarDescriptor(stateDesc);
}
else
curVar = TRACKED_NEW plSimpleVarDescriptor;
curVar = new plSimpleVarDescriptor;
curDesc->AddVar(curVar);
bool ok=curVar->SetType(token);

View File

@ -123,7 +123,7 @@ bool plStateChangeNotifier::operator==(const plStateChangeNotifier &other) const
void plStateChangeNotifier::SendNotificationMsg(const plSimpleStateVariable* srcVar, const plSimpleStateVariable* dstVar,
const char* sdlName)
{
plSDLNotificationMsg* m = TRACKED_NEW plSDLNotificationMsg;
plSDLNotificationMsg* m = new plSDLNotificationMsg;
// add receivers
KeyList::iterator kit=fKeys.begin();

View File

@ -155,12 +155,12 @@ void plStateDataRecord::IInitDescriptor(const plStateDescriptor* sd)
{
if (vd->GetAsSDVarDescriptor())
{ // it's a var which references another state descriptor.
fSDVarsList.push_back(TRACKED_NEW plSDStateVariable(vd->GetAsSDVarDescriptor()));
fSDVarsList.push_back(new plSDStateVariable(vd->GetAsSDVarDescriptor()));
}
else
{
hsAssert(vd->GetAsSimpleVarDescriptor(), "var class problem");
fVarsList.push_back(TRACKED_NEW plSimpleStateVariable(vd->GetAsSimpleVarDescriptor()));
fVarsList.push_back(new plSimpleStateVariable(vd->GetAsSimpleVarDescriptor()));
}
}
}
@ -453,9 +453,9 @@ plNetMsgSDLState* plStateDataRecord::PrepNetMsg(float timeConvert, uint32_t writ
// fill in net msg
plNetMsgSDLState* msg;
if (writeOptions & plSDL::kBroadcast)
msg = TRACKED_NEW plNetMsgSDLStateBCast;
msg = new plNetMsgSDLStateBCast;
else
msg = TRACKED_NEW plNetMsgSDLState;
msg = new plNetMsgSDLState;
msg->StreamInfo()->CopyStream(&stream);
return msg;

View File

@ -110,9 +110,9 @@ bool plStateDescriptor::Read(hsStream* s)
uint8_t SDVar=s->ReadByte();
plVarDescriptor* var = nil;
if (SDVar)
var = TRACKED_NEW plSDVarDescriptor;
var = new plSDVarDescriptor;
else
var = TRACKED_NEW plSimpleVarDescriptor;
var = new plSimpleVarDescriptor;
if (var->Read(s))
fVarsList.push_back(var);
else

View File

@ -225,7 +225,7 @@ void plSimpleStateVariable::IDeAlloc()
#define SDLALLOC(typeName, type, var) \
case typeName: \
var = TRACKED_NEW type[cnt]; \
var = new type[cnt]; \
break;
void plSimpleStateVariable::Alloc(int listSize)
@ -251,13 +251,13 @@ void plSimpleStateVariable::Alloc(int listSize)
SDLALLOC(plVarDescriptor::kBool, bool, fB)
SDLALLOC(plVarDescriptor::kCreatable, plCreatable*, fC)
case plVarDescriptor::kTime:
fT = TRACKED_NEW plClientUnifiedTime[cnt];
fT = new plClientUnifiedTime[cnt];
break;
case plVarDescriptor::kKey:
fU = TRACKED_NEW plUoid[cnt];
fU = new plUoid[cnt];
break;
case plVarDescriptor::kString32:
fS32 = TRACKED_NEW plVarDescriptor::String32[cnt];
fS32 = new plVarDescriptor::String32[cnt];
break;
default:
hsAssert(false, "undefined atomic type");
@ -538,7 +538,7 @@ bool plSimpleStateVariable::IConvertFromRGB(plVarDescriptor::Type newType)
{
// rgb to rgba
int i,j;
float* newF = TRACKED_NEW float[fVar.GetCount()*4]; // make more space
float* newF = new float[fVar.GetCount()*4]; // make more space
for(j=0;j<fVar.GetCount(); j++)
{
// recopy with alpha=0 by default
@ -554,7 +554,7 @@ bool plSimpleStateVariable::IConvertFromRGB(plVarDescriptor::Type newType)
{
// rgb to rgba8
int i,j;
uint8_t * newB = TRACKED_NEW uint8_t [fVar.GetCount()*4]; // make more space
uint8_t * newB = new uint8_t [fVar.GetCount()*4]; // make more space
for(j=0;j<fVar.GetCount(); j++)
{
// recopy with alpha=0 by default
@ -570,7 +570,7 @@ bool plSimpleStateVariable::IConvertFromRGB(plVarDescriptor::Type newType)
{
// rgb to rgb8
int i,j;
uint8_t * newB = TRACKED_NEW uint8_t [fVar.GetCount()*3]; // make space
uint8_t * newB = new uint8_t [fVar.GetCount()*3]; // make space
for(j=0;j<fVar.GetCount(); j++)
{
// recopy with alpha=0 by default
@ -595,7 +595,7 @@ bool plSimpleStateVariable::IConvertFromRGB8(plVarDescriptor::Type newType)
{
// rgb8 to rgba
int i,j;
float* newF = TRACKED_NEW float[fVar.GetCount()*4]; // make more space
float* newF = new float[fVar.GetCount()*4]; // make more space
for(j=0;j<fVar.GetCount(); j++)
{
// recopy with alpha=0 by default
@ -611,7 +611,7 @@ bool plSimpleStateVariable::IConvertFromRGB8(plVarDescriptor::Type newType)
{
// rgb8 to rgb
int i,j;
float* newF = TRACKED_NEW float[fVar.GetCount()*3]; // make more space
float* newF = new float[fVar.GetCount()*3]; // make more space
for(j=0;j<fVar.GetCount(); j++)
{
// recopy with alpha=0 by default
@ -626,7 +626,7 @@ bool plSimpleStateVariable::IConvertFromRGB8(plVarDescriptor::Type newType)
{
// rgb8 to rgba8
int i,j;
uint8_t * newB = TRACKED_NEW uint8_t [fVar.GetCount()*4]; // make more space
uint8_t * newB = new uint8_t [fVar.GetCount()*4]; // make more space
for(j=0;j<fVar.GetCount(); j++)
{
// recopy with alpha=0 by default
@ -655,7 +655,7 @@ bool plSimpleStateVariable::IConvertFromRGBA(plVarDescriptor::Type newType)
{
// rgba to rgb
int i,j;
float* newF = TRACKED_NEW float[fVar.GetCount()*3]; // make less space
float* newF = new float[fVar.GetCount()*3]; // make less space
for(j=0;j<fVar.GetCount(); j++)
{
// recopy and ignore alpha
@ -670,7 +670,7 @@ bool plSimpleStateVariable::IConvertFromRGBA(plVarDescriptor::Type newType)
{
// rgba to rgb8
int i,j;
uint8_t* newB = TRACKED_NEW uint8_t[fVar.GetCount()*3]; // make less space
uint8_t* newB = new uint8_t[fVar.GetCount()*3]; // make less space
for(j=0;j<fVar.GetCount(); j++)
{
// recopy and ignore alpha
@ -685,7 +685,7 @@ bool plSimpleStateVariable::IConvertFromRGBA(plVarDescriptor::Type newType)
{
// rgba to rgba8
int i,j;
uint8_t* newBy = TRACKED_NEW uint8_t [fVar.GetCount()*4]; // make less space
uint8_t* newBy = new uint8_t [fVar.GetCount()*4]; // make less space
for(j=0;j<fVar.GetCount(); j++)
{
// recopy and ignore alpha
@ -713,7 +713,7 @@ bool plSimpleStateVariable::IConvertFromRGBA8(plVarDescriptor::Type newType)
{
// rgba8 to rgb
int i,j;
float* newF = TRACKED_NEW float[fVar.GetCount()*3]; // make less space
float* newF = new float[fVar.GetCount()*3]; // make less space
for(j=0;j<fVar.GetCount(); j++)
{
// recopy and ignore alpha
@ -728,7 +728,7 @@ bool plSimpleStateVariable::IConvertFromRGBA8(plVarDescriptor::Type newType)
{
// rgba8 to rgb8
int i,j;
uint8_t* newB = TRACKED_NEW uint8_t[fVar.GetCount()*3]; // make less space
uint8_t* newB = new uint8_t[fVar.GetCount()*3]; // make less space
for(j=0;j<fVar.GetCount(); j++)
{
// recopy and ignore alpha
@ -743,7 +743,7 @@ bool plSimpleStateVariable::IConvertFromRGBA8(plVarDescriptor::Type newType)
{
// rgba8 to rgba
int i,j;
float* newF = TRACKED_NEW float[fVar.GetCount()*4]; // make less space
float* newF = new float[fVar.GetCount()*4]; // make less space
for(j=0;j<fVar.GetCount(); j++)
{
// recopy and ignore alpha
@ -771,7 +771,7 @@ bool plSimpleStateVariable::IConvertFromInt(plVarDescriptor::Type newType)
case plVarDescriptor::kFloat:
{
// int to float
float* newF = TRACKED_NEW float[fVar.GetCount()];
float* newF = new float[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newF[j] = (float)(fI[j]);
delete [] fI;
@ -781,7 +781,7 @@ bool plSimpleStateVariable::IConvertFromInt(plVarDescriptor::Type newType)
case plVarDescriptor::kShort:
{
// int to short
short* newS = TRACKED_NEW short[fVar.GetCount()];
short* newS = new short[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newS[j] = short(fI[j]);
delete [] fI;
@ -791,7 +791,7 @@ bool plSimpleStateVariable::IConvertFromInt(plVarDescriptor::Type newType)
case plVarDescriptor::kByte:
{
// int to byte
uint8_t* newBy = TRACKED_NEW uint8_t[fVar.GetCount()];
uint8_t* newBy = new uint8_t[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newBy[j] = uint8_t(fI[j]);
delete [] fI;
@ -801,7 +801,7 @@ bool plSimpleStateVariable::IConvertFromInt(plVarDescriptor::Type newType)
case plVarDescriptor::kDouble:
{
// int to double
double * newD = TRACKED_NEW double[fVar.GetCount()];
double * newD = new double[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newD[j] = fI[j];
delete [] fI;
@ -811,7 +811,7 @@ bool plSimpleStateVariable::IConvertFromInt(plVarDescriptor::Type newType)
case plVarDescriptor::kBool:
{
// int to bool
bool * newB = TRACKED_NEW bool[fVar.GetCount()];
bool * newB = new bool[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newB[j] = (fI[j]!=0);
delete [] fI;
@ -834,7 +834,7 @@ bool plSimpleStateVariable::IConvertFromShort(plVarDescriptor::Type newType)
{
case plVarDescriptor::kFloat:
{
float* newF = TRACKED_NEW float[fVar.GetCount()];
float* newF = new float[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newF[j] = fS[j];
delete [] fS;
@ -843,7 +843,7 @@ bool plSimpleStateVariable::IConvertFromShort(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kInt:
{
int* newI = TRACKED_NEW int[fVar.GetCount()];
int* newI = new int[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newI[j] = short(fS[j]);
delete [] fS;
@ -851,7 +851,7 @@ bool plSimpleStateVariable::IConvertFromShort(plVarDescriptor::Type newType)
}
case plVarDescriptor::kByte:
{
uint8_t* newBy = TRACKED_NEW uint8_t[fVar.GetCount()];
uint8_t* newBy = new uint8_t[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newBy[j] = uint8_t(fS[j]);
delete [] fS;
@ -860,7 +860,7 @@ bool plSimpleStateVariable::IConvertFromShort(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kDouble:
{
double * newD = TRACKED_NEW double[fVar.GetCount()];
double * newD = new double[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newD[j] = fS[j];
delete [] fS;
@ -869,7 +869,7 @@ bool plSimpleStateVariable::IConvertFromShort(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kBool:
{
bool * newB = TRACKED_NEW bool[fVar.GetCount()];
bool * newB = new bool[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newB[j] = (fS[j]!=0);
delete [] fS;
@ -892,7 +892,7 @@ bool plSimpleStateVariable::IConvertFromByte(plVarDescriptor::Type newType)
{
case plVarDescriptor::kFloat:
{
float* newF = TRACKED_NEW float[fVar.GetCount()];
float* newF = new float[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newF[j] = fBy[j];
delete [] fBy;
@ -901,7 +901,7 @@ bool plSimpleStateVariable::IConvertFromByte(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kInt:
{
int* newI = TRACKED_NEW int[fVar.GetCount()];
int* newI = new int[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newI[j] = short(fBy[j]);
delete [] fBy;
@ -909,7 +909,7 @@ bool plSimpleStateVariable::IConvertFromByte(plVarDescriptor::Type newType)
}
case plVarDescriptor::kShort:
{
short* newS = TRACKED_NEW short[fVar.GetCount()];
short* newS = new short[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newS[j] = fBy[j];
delete [] fBy;
@ -918,7 +918,7 @@ bool plSimpleStateVariable::IConvertFromByte(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kDouble:
{
double * newD = TRACKED_NEW double[fVar.GetCount()];
double * newD = new double[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newD[j] = fBy[j];
delete [] fBy;
@ -927,7 +927,7 @@ bool plSimpleStateVariable::IConvertFromByte(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kBool:
{
bool * newB = TRACKED_NEW bool[fVar.GetCount()];
bool * newB = new bool[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newB[j] = (fBy[j]!=0);
delete [] fBy;
@ -950,7 +950,7 @@ bool plSimpleStateVariable::IConvertFromFloat(plVarDescriptor::Type newType)
{
case plVarDescriptor::kInt:
{
int* newI = TRACKED_NEW int[fVar.GetCount()];
int* newI = new int[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newI[j] = (int)(fF[j]+.5f); // round to nearest int
delete [] fF;
@ -959,7 +959,7 @@ bool plSimpleStateVariable::IConvertFromFloat(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kShort:
{
short* newS = TRACKED_NEW short[fVar.GetCount()];
short* newS = new short[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newS[j] = (short)(fF[j]+.5f); // round to nearest int
delete [] fF;
@ -968,7 +968,7 @@ bool plSimpleStateVariable::IConvertFromFloat(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kByte:
{
uint8_t* newBy = TRACKED_NEW uint8_t[fVar.GetCount()];
uint8_t* newBy = new uint8_t[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newBy[j] = (uint8_t)(fF[j]+.5f); // round to nearest int
delete [] fF;
@ -977,7 +977,7 @@ bool plSimpleStateVariable::IConvertFromFloat(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kDouble:
{
double* newD = TRACKED_NEW double[fVar.GetCount()];
double* newD = new double[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newD[j] = fF[j];
delete [] fF;
@ -986,7 +986,7 @@ bool plSimpleStateVariable::IConvertFromFloat(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kBool:
{
bool* newB = TRACKED_NEW bool[fVar.GetCount()];
bool* newB = new bool[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newB[j] = (fF[j]!=0);
delete [] fF;
@ -1009,7 +1009,7 @@ bool plSimpleStateVariable::IConvertFromDouble(plVarDescriptor::Type newType)
{
case plVarDescriptor::kInt:
{
int* newI = TRACKED_NEW int[fVar.GetCount()];
int* newI = new int[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newI[j] = (int)(fD[j]+.5f); // round to nearest int
delete [] fD;
@ -1018,7 +1018,7 @@ bool plSimpleStateVariable::IConvertFromDouble(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kShort:
{
short* newS = TRACKED_NEW short[fVar.GetCount()];
short* newS = new short[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newS[j] = (short)(fD[j]+.5f); // round to nearest int
delete [] fD;
@ -1027,7 +1027,7 @@ bool plSimpleStateVariable::IConvertFromDouble(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kByte:
{
uint8_t* newBy = TRACKED_NEW uint8_t[fVar.GetCount()];
uint8_t* newBy = new uint8_t[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newBy[j] = (uint8_t)(fD[j]+.5f); // round to nearest int
delete [] fD;
@ -1036,7 +1036,7 @@ bool plSimpleStateVariable::IConvertFromDouble(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kFloat:
{
float* newF = TRACKED_NEW float[fVar.GetCount()];
float* newF = new float[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newF[j] = (float)(fD[j]);
delete [] fD;
@ -1045,7 +1045,7 @@ bool plSimpleStateVariable::IConvertFromDouble(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kBool:
{
bool* newB = TRACKED_NEW bool[fVar.GetCount()];
bool* newB = new bool[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newB[j] = (fD[j]!=0);
delete [] fD;
@ -1068,7 +1068,7 @@ bool plSimpleStateVariable::IConvertFromBool(plVarDescriptor::Type newType)
{
case plVarDescriptor::kInt:
{
int* newI = TRACKED_NEW int[fVar.GetCount()];
int* newI = new int[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newI[j] = (fB[j] == true ? 1 : 0);
delete [] fB;
@ -1077,7 +1077,7 @@ bool plSimpleStateVariable::IConvertFromBool(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kShort:
{
short* newS = TRACKED_NEW short[fVar.GetCount()];
short* newS = new short[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newS[j] = (fB[j] == true ? 1 : 0);
delete [] fB;
@ -1086,7 +1086,7 @@ bool plSimpleStateVariable::IConvertFromBool(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kByte:
{
uint8_t* newBy = TRACKED_NEW uint8_t[fVar.GetCount()];
uint8_t* newBy = new uint8_t[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newBy[j] = (fB[j] == true ? 1 : 0);
delete [] fB;
@ -1095,7 +1095,7 @@ bool plSimpleStateVariable::IConvertFromBool(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kFloat:
{
float* newF = TRACKED_NEW float[fVar.GetCount()];
float* newF = new float[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newF[j] = (fB[j] == true ? 1.f : 0.f);
delete [] fB;
@ -1104,7 +1104,7 @@ bool plSimpleStateVariable::IConvertFromBool(plVarDescriptor::Type newType)
break;
case plVarDescriptor::kDouble:
{
double* newD= TRACKED_NEW double[fVar.GetCount()];
double* newD= new double[fVar.GetCount()];
for(j=0;j<fVar.GetCount(); j++)
newD[j] = (fB[j] == true ? 1.f : 0.f);
delete [] fB;
@ -1948,7 +1948,7 @@ bool plSimpleStateVariable::IReadData(hsStream* s, float timeConvert, int idx, u
}
else
{
plSDLCreatableStub* stub = TRACKED_NEW plSDLCreatableStub(hClass, len);
plSDLCreatableStub* stub = new plSDLCreatableStub(hClass, len);
fC[j] = stub;
}
fC[j]->Read(s, hsgResMgr::ResMgr()); // data
@ -2419,7 +2419,7 @@ void plSDStateVariable::Resize(int cnt)
{
int i;
for(i=origCnt;i<cnt;i++)
fDataRecList[i] = TRACKED_NEW plStateDataRecord(fVarDescriptor->GetStateDescriptor());
fDataRecList[i] = new plStateDataRecord(fVarDescriptor->GetStateDescriptor());
}
SetDirty(true);
@ -2445,7 +2445,7 @@ void plSDStateVariable::Alloc(plSDVarDescriptor* sdvd, int listSize)
{
if (fVarDescriptor==nil)
{
fVarDescriptor = TRACKED_NEW plSDVarDescriptor;
fVarDescriptor = new plSDVarDescriptor;
fVarDescriptor->CopyFrom(sdvd);
}
@ -2453,7 +2453,7 @@ void plSDStateVariable::Alloc(plSDVarDescriptor* sdvd, int listSize)
fDataRecList.resize(cnt);
int j;
for (j=0;j<cnt; j++)
InsertStateDataRecord(TRACKED_NEW plStateDataRecord(sdvd->GetStateDescriptor()), j);
InsertStateDataRecord(new plStateDataRecord(sdvd->GetStateDescriptor()), j);
}
}