Completely fixed DSPTool, on all of its memory leaks, bad API and bad C++. (compiling with include works perfectly)

More small leftover fixes

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3071 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY
2009-04-25 10:38:26 +00:00
parent 72febe7b8a
commit 1045fc7e98
14 changed files with 153 additions and 138 deletions

View File

@ -35,7 +35,7 @@ void LabelMap::RegisterDefaults()
}
}
void LabelMap::RegisterLabel(const char *label, u16 lval, LabelType type)
void LabelMap::RegisterLabel(const std::string &label, u16 lval, LabelType type)
{
u16 old_value;
if (GetLabelValue(label, &old_value) && old_value != lval)
@ -47,12 +47,12 @@ void LabelMap::RegisterLabel(const char *label, u16 lval, LabelType type)
labels.push_back(label_t(label, lval, type));
}
void LabelMap::DeleteLabel(const char *label)
void LabelMap::DeleteLabel(const std::string &label)
{
for (std::vector<label_t>::iterator iter = labels.begin();
iter != labels.end(); ++iter)
{
if (!strcmp(label, iter->name.c_str()))
if (!label.compare(iter->name))
{
labels.erase(iter);
return;
@ -60,11 +60,11 @@ void LabelMap::DeleteLabel(const char *label)
}
}
bool LabelMap::GetLabelValue(const char *label, u16 *value, LabelType type) const
bool LabelMap::GetLabelValue(const std::string &label, u16 *value, LabelType type) const
{
for (int i = 0; i < labels.size(); i++)
{
if (!strcmp(labels[i].name.c_str(), label))
if (!label.compare(labels[i].name))
{
if (type & labels[i].type) {
*value = labels[i].addr;