more cleanups

This commit is contained in:
DarthArgus
2014-10-28 07:51:05 -07:00
parent 0fa7e3137d
commit 075c070adc
5 changed files with 24 additions and 40 deletions
@@ -564,10 +564,7 @@ dataReplyMessage::dataReplyMessage(const unsigned short command,
monMessage(command, sequence, size)
{
data = new unsigned char[newDataLen];
if (data)
memcpy(data, newData, newDataLen);
else
data = NULL;
memcpy(data, newData, newDataLen);
}
//----------------------------------------------------------------
@@ -112,8 +112,7 @@ ResGetIssueHierarchy::ResGetIssueHierarchy(unsigned track, const void *userData)
ResGetIssueHierarchy::~ResGetIssueHierarchy()
//----------------------------------------------
{
if (rawStringPtr)
delete [] rawStringPtr;
delete [] rawStringPtr;
}
//----------------------------------------------
@@ -190,8 +189,7 @@ ResGetTicketComments::ResGetTicketComments(unsigned track, const void *userData)
ResGetTicketComments::~ResGetTicketComments()
//----------------------------------------------
{
if (mCommentArray != 0)
delete [] mCommentArray; // be sure to free up any resources!
delete [] mCommentArray; // be sure to free up any resources!
}
//----------------------------------------------
@@ -224,8 +222,7 @@ ResGetTicketByCharacter::ResGetTicketByCharacter(unsigned track, const void *use
ResGetTicketByCharacter::~ResGetTicketByCharacter()
//----------------------------------------------
{
if (mTicketArray != 0)
delete [] mTicketArray; // be sure to free up any resources!
delete [] mTicketArray; // be sure to free up any resources!
}
//----------------------------------------------
@@ -259,8 +256,7 @@ ResTicketChange::ResTicketChange(unsigned track)
ResTicketChange::~ResTicketChange()
//----------------------------------------------
{
if (rawCharacter)
delete [] rawCharacter;
delete [] rawCharacter;
}
//----------------------------------------------
@@ -329,8 +325,7 @@ rawCharacter(0)
ResRequestGameLocation::~ResRequestGameLocation()
//----------------------------------------------
{
if (rawCharacter)
delete [] rawCharacter;
delete [] rawCharacter;
}
//----------------------------------------------
@@ -362,8 +357,7 @@ ResGetDocumentList::ResGetDocumentList(unsigned track, const void *userData)
ResGetDocumentList::~ResGetDocumentList()
//----------------------------------------------
{
if (mDocumentArray != 0)
delete [] mDocumentArray; // be sure to free up any resources!
delete [] mDocumentArray; // be sure to free up any resources!
}
//----------------------------------------------
@@ -397,8 +391,7 @@ ResGetDocument::ResGetDocument(unsigned track, const void *userData)
ResGetDocument::~ResGetDocument()
//----------------------------------------------
{
if (rawDocument)
delete [] rawDocument;
delete [] rawDocument;
}
//----------------------------------------------
@@ -420,8 +413,7 @@ ResGetTicketXMLBlock::ResGetTicketXMLBlock(unsigned track, const void *userData)
ResGetTicketXMLBlock::~ResGetTicketXMLBlock()
//----------------------------------------------
{
if (rawXML)
delete [] rawXML;
delete [] rawXML;
}
//----------------------------------------------
@@ -443,10 +435,8 @@ ResGetKBArticle::ResGetKBArticle(unsigned track, const void *userData)
ResGetKBArticle::~ResGetKBArticle()
//----------------------------------------------
{
if (rawArticle)
delete [] rawArticle;
if (rawTitle)
delete [] rawTitle;
delete [] rawArticle;
delete [] rawTitle;
}
//----------------------------------------------
@@ -473,8 +463,7 @@ ResSearchKB::ResSearchKB(unsigned track, const void *userData)
ResSearchKB::~ResSearchKB()
//----------------------------------------------
{
if (mArticleArray != 0)
delete [] mArticleArray; // be sure to free up any resources!
delete [] mArticleArray; // be sure to free up any resources!
}
//----------------------------------------------
@@ -507,12 +496,9 @@ rawGame(0), rawVersion(0), rawLanguage(0), mChangeType(CSASSIST_HIERARCHY_NONE)
ResHierarchyChange::~ResHierarchyChange()
{
if (rawGame)
delete [] rawGame;
if (rawVersion)
delete [] rawVersion;
if (rawLanguage)
delete [] rawLanguage;
delete [] rawGame;
delete [] rawVersion;
delete [] rawLanguage;
}
//----------------------------------------------
@@ -273,7 +273,7 @@ namespace soe
return asHex(Final());
}
string MD5::asHex(vector<char> achar0)
string MD5::asHex(const vector<char> &achar0)
{
const string hex = "0123456789abcdef";
@@ -37,7 +37,7 @@ namespace soe
void Update(const std::vector<char> &achar0, int i);
void Update(const std::vector<char> &achar0, int i, int j);
std::string asHex();
static std::string asHex(std::vector<char> achar0);
static std::string asHex(const std::vector<char> &achar0);
private:
std::vector<int> Decode(const std::vector<char> &achar0, int i, int j);
@@ -382,6 +382,7 @@ int CMonitorData::setDescription( int Id, const char *Description , int & mode)
int x;
size_t sDescP1 = (strlen(Description) + 1);
int retVal = -1;
for(x=0;x<m_count;x++)
{
@@ -391,19 +392,19 @@ int x;
delete [] m_data[x].discription;
m_data[x].discription = NULL;
mode = 0;
return x;
retVal = x;
}
if( m_data[x].discription && !strcmp( m_data[x].discription, Description ) )
return -1;
retVal = - 1;
if( m_data[x].discription )
delete [] m_data[x].discription;
delete [] m_data[x].discription;
m_data[x].discription = new char [ sDescP1 ];
strcpy(m_data[x].discription,Description);
mode = 1;
return x;
retVal = x;
}
return -1;
return retVal;
}
int CMonitorData::pingValue(int p)