本文整理匯總了C++中DeleteArray函數的典型用法代碼示例。如果您正苦於以下問題:C++ DeleteArray函數的具體用法?C++ DeleteArray怎麽用?C++ DeleteArray使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DeleteArray函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: Read
bool Read()
{
Conn->Read((char*) Protocol, sizeof(Protocol), 0);
Command = ReadUShort();
Status.Status = ReadULong();
Flags = ReadUChar();
Flags2 = ReadUShort();
Conn->Read((char*) Pad, sizeof(Pad), 0);
Tid = ReadUShort();
Pid = ReadUShort();
Uid = ReadUShort();
Mid = ReadUShort();
WordCount = ReadUChar();
DeleteArray(ParameterWords);
ParameterWords = new ushort[WordCount];
if (ParameterWords)
{
Conn->Read((char*) ParameterWords, sizeof(ushort)*WordCount, 0);
}
ByteCount = ReadUChar();
DeleteArray(Buffer);
Buffer = new uchar[ByteCount];
if (Buffer)
{
Conn->Read((char*) Buffer, sizeof(uchar)*ByteCount, 0);
}
return true;
}
示例2: backtrace
int OS::StackWalk(Vector<OS::StackFrame> frames) {
int frames_size = frames.length();
void** addresses = NewArray<void*>(frames_size);
int frames_count = backtrace(addresses, frames_size);
char** symbols;
symbols = backtrace_symbols(addresses, frames_count);
if (symbols == NULL) {
DeleteArray(addresses);
return kStackWalkError;
}
for (int i = 0; i < frames_count; i++) {
frames[i].address = addresses[i];
// Format a text representation of the frame based on the information
// available.
SNPrintF(MutableCStrVector(frames[i].text, kStackWalkMaxTextLen),
"%s",
symbols[i]);
// Make sure line termination is in place.
frames[i].text[kStackWalkMaxTextLen - 1] = '\0';
}
DeleteArray(addresses);
free(symbols);
return frames_count;
}
示例3: min
bool GRegion::SetSize(int s)
{
bool Status = true;
if (s > Alloc)
{
int NewAlloc = (s + 15) & (~0xF);
GRect *Temp = new GRect[NewAlloc];
if (Temp)
{
int Common = min(Size, s);
memcpy(Temp, a, sizeof(GRect)*Common);
DeleteArray(a);
a = Temp;
Size = s;
Alloc = NewAlloc;
}
else
{
Status = false;
}
}
else
{
Size = s;
if (!Size)
{
DeleteArray(a);
Alloc = 0;
}
}
return Status;
}
示例4: DeleteArray
CMotion::~CMotion()
{
DeleteArray(m_attributes);
DeleteArray(m_paths);
DeleteArray(m_bones);
DeleteArray(m_animations);
DeleteArray(m_frames);
}
示例5: DeleteArray
ArcScriptCreatureAI::~ArcScriptCreatureAI()
{
DeleteArray(mOnDiedEmotes);
DeleteArray(mOnTargetDiedEmotes);
DeleteArray(mOnCombatStartEmotes);
DeleteArray(mOnTauntEmotes);
DeleteArray(mSpells);
}
示例6: GetCycle
/*
*****************************************************************************
**函 數 名:Uint8 GetCycle(Uint8 *p,Uint8 n)
**功能描述:算周期
**輸 入:Uint8 *p,Uint8 n
**輸 出:
*****************************************************************************
*/
Uint8 GetCycle(Uint8 *p,Uint8 n) //算周期
{
Uint8 xdata i,j,account,condition,tempMin,posMin,posMax;
Uint16 xdata tempMax;
Uint8 xdata cycle = 0;
condition =(Uint16)(SerialMore(p,n)+SerialLess(p,n))*4/5;
for(i=MIN_POINT;i<=MAX_POINT;i++)
{
CalculateArea(p,i);
account=FindLeastValue(GatDat->Area,TOTAL-i);
while(account>=3)
{
tempMin = 0xff;
posMin = 0;
for(j=0;j<(account-1);j++)
{
if(abs(GatDat->Num[j+1]-GatDat->Num[j])<tempMin)
{
tempMin = abs(GatDat->Num[j+1]-GatDat->Num[j]);
posMin = j;
}
}
if(tempMin<condition)
{
if(GatDat->Area[GatDat->Num[posMin]] > GatDat->Area[GatDat->Num[posMin+1]])
DeleteArray(account,posMin);
else
DeleteArray(account,posMin+1);
account --;
}
else
{
cycle=DistanceEqu(account);
if(cycle)
return cycle;
else
{
tempMax = 0;
posMax = 0xff;
for(j=0;j<account;j++)
{
if(GatDat->Area[GatDat->Num[j]]>=tempMax)
{
tempMax = GatDat->Area[GatDat->Num[j]];
posMax = j;
}
}
DeleteArray(account,posMax);
account --;
}
}
}
}
return 0;
}
示例7: DeleteArray
CProject::~CProject()
{
Project = null;
for (int i = 0; i < m_waterListCount; i++)
{
DeleteArray(m_waterLists[i].textures);
DeleteArray(m_waterLists[i].textureIDs);
}
DeleteArray(m_waterLists);
}
示例8: switch
void ArcScriptCreatureAI::RemoveAllEmotes(EventType pEventType)
{
switch( pEventType )
{
case Event_OnCombatStart: DeleteArray(mOnCombatStartEmotes); break;
case Event_OnTargetDied: DeleteArray(mOnTargetDiedEmotes); break;
case Event_OnDied: DeleteArray(mOnDiedEmotes); break;
case Event_OnTaunt: DeleteArray(mOnTauntEmotes); break;
default: sLog.outDebug("ArcScriptCreatureAI::RemoveAllEmotes() : Invalid event type!\n"); break;
}
}
示例9: DeleteArray
TextLock::~TextLock()
{
DeleteArray(Line);
if (LineW)
{
for (int i=0; i<Lines; i++)
{
DeleteArray(LineW[i]);
}
DeleteArray(LineW);
}
}
示例10: DeleteArray
HRESULT AllocMeshHierarchy::DestroyFrame( THIS_ D3DXFRAME* pFrameToFree)
{
DeleteArray(pFrameToFree->Name) ;
Delete(pFrameToFree) ;
return D3D_OK ;
}
示例11: LgiToNativeCp
bool GCombo::Insert(char *p, int Index)
{
bool Status = false;
if (p)
{
if (Handle())
{
char *n = LgiToNativeCp(p);
if (n)
{
if (Index < 0)
{
Index = GetItems();
}
Status = SendMessage(Handle(), CB_INSERTSTRING, Index, (long)n) == Index;
DeleteArray(n);
}
}
else
{
d->InitStrs.Insert(NewStr(p), Index);
Status = true;
}
}
return Status;
}
示例12: memset
bool TextDocument::SetLength(int Len)
{
bool Status = TRUE;
if (Len + 1 > Alloc)
{
int NewAlloc = (Len + TEXT_BLOCK) & (~TEXT_MASK);
char *Temp = new char[NewAlloc];
if (Temp)
{
memset(Temp + Length, 0, NewAlloc - Length);
memcpy(Temp, Data, Length);
DeleteArray(Data);
Data = Temp;
Length = Len;
Alloc = NewAlloc;
}
else
{
Status = FALSE;
}
}
else
{
// TODO: resize Data to be smaller if theres a
// considerable size change
Length = Len;
}
return Status;
}
示例13: va_start
void PrettyPrinter::Print(const char* format, ...) {
for (;;) {
va_list arguments;
va_start(arguments, format);
int n = OS::VSNPrintF(Vector<char>(output_, size_) + pos_,
format,
arguments);
va_end(arguments);
if (n >= 0) {
// there was enough space - we are done
pos_ += n;
return;
} else {
// there was not enough space - allocate more and try again
const int slack = 32;
int new_size = size_ + (size_ >> 1) + slack;
char* new_output = NewArray<char>(new_size);
OS::MemCopy(new_output, output_, pos_);
DeleteArray(output_);
output_ = new_output;
size_ = new_size;
}
}
}
示例14: Test
void Test(int row, int col, int bomb, int &y, int &x)
{
struct pole** src;
src = CreateArray(row, col);
if (src == NULL)
cout << "Problem\n";
Random(src, row, col, bomb);
// bool wygrana = IsWin(src, row, col, bomb);
bool bomba = false;
int zakryte = row*col; // zakryte pola
while (zakryte != bomb) {
Write(src, row, col, y, x);
//CountFlags(src, row, col, bomb);
//ShowCell(src, row, col, y, x);
PressKey(src, row, col, bomb, y, x,zakryte);
bomba = IfBomb(src, row, col, y, x);
if (bomba == true) break;
system("cls");
}
x = 0;
y = 0;
if (zakryte == bomb) { //warunek wygranej
cout << "Gratulacje, wygrales!\n\n";
}
Write(src, row, col, y, x);
cout << "\n";
DeleteArray(&src, row);
}
示例15:
GenerateSequence::GenerateRandom(int Size)
{
if(Value != NULL) DeleteArray();
Value = new int[Size];
for(int i=0;i<Size;i++) Value[i]=RandomNumber();
return 0;
}