Fixed errors preventing clang from compiling

Also did some changed the whitespace of the affected functions.
This commit is contained in:
Arthur Moore 2015-03-11 00:54:22 -04:00
parent 34bd14628c
commit 477621c489
2 changed files with 88 additions and 69 deletions

View File

@ -19,5 +19,7 @@ fi
mkdir "$BUILD_DIRECTORY" mkdir "$BUILD_DIRECTORY"
cd build cd build
# cmake -DCMAKE_BUILD_TYPE=Debug .. # cmake -DCMAKE_BUILD_TYPE=Debug ..
#scan-build cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
cmake .. cmake ..
make make
#scan-build make

View File

@ -520,9 +520,10 @@ public:
// It might be safest to only support desc edits, and force the // It might be safest to only support desc edits, and force the
// user to re-enter codes to change them // user to re-enter codes to change them
int ncodes = isgb ? gbCheatNumber : cheatsNumber; int ncodes = isgb ? gbCheatNumber : cheatsNumber;
if(ncodes > id + 1) { if(ncodes > id + 1)
wxString codes[ncodes - id - 1]; {
wxString descs[ncodes - id - 1]; std::vector<wxString> codes;
std::vector<wxString> descs;
bool checked[ncodes - id - 1]; bool checked[ncodes - id - 1];
bool v3[ncodes - id - 1]; bool v3[ncodes - id - 1];
for(int i = id + 1; i < ncodes; i++) { for(int i = id + 1; i < ncodes; i++) {
@ -555,30 +556,40 @@ public:
for(int i = id + 1; i < ncodes; i++) { for(int i = id + 1; i < ncodes; i++) {
ce_codes = codes[i - id - 1]; ce_codes = codes[i - id - 1];
ce_desc = descs[i - id - 1]; ce_desc = descs[i - id - 1];
if(isgb) { if(isgb)
{
if(ce_codes.find(wxT('-')) == wxString::npos) if(ce_codes.find(wxT('-')) == wxString::npos)
ce_type = 0; ce_type = 0;
else else
ce_type = 1; ce_type = 1;
} else { }
else
{
if(ce_codes.find(wxT(':')) != wxString::npos) if(ce_codes.find(wxT(':')) != wxString::npos)
ce_type = 0; ce_type = 0;
else if(ce_codes.find(wxT(' ')) == wxString::npos) { else if(ce_codes.find(wxT(' ')) == wxString::npos)
{
ce_type = 1; ce_type = 1;
if(v3[i - id - 1]) if(v3[i - id - 1])
ce_codes.insert(8, 1, wxT(' ')); ce_codes.insert(8, 1, wxT(' '));
} else }
else
{
ce_type = 2; ce_type = 2;
} }
}
AddCheat(); AddCheat();
if(!checked[i - id - 1]) { if(!checked[i - id - 1])
{
if(isgb) if(isgb)
gbCheatDisable(i); gbCheatDisable(i);
else else
cheatsDisable(i); cheatsDisable(i);
} }
} }
} else { }
else
{
list->DeleteItem(id); list->DeleteItem(id);
if(isgb) if(isgb)
gbCheatRemove(id); gbCheatRemove(id);
@ -3188,16 +3199,22 @@ void MainFrame::set_global_accels()
if(!accels[i].GetMenuItem()) if(!accels[i].GetMenuItem())
len++; len++;
if(len) { if(len) {
wxAcceleratorEntry tab[len]; wxAcceleratorEntry * tab = new wxAcceleratorEntry[len];
for(int i = 0, j = 0; i < accels.size(); i++) for(int i = 0, j = 0; i < accels.size(); i++)
{
if(!accels[i].GetMenuItem()) if(!accels[i].GetMenuItem())
tab[j++] = accels[i]; tab[j++] = accels[i];
}
wxAcceleratorTable atab(len, tab); wxAcceleratorTable atab(len, tab);
// set the table on the panel, where focus usually is // set the table on the panel, where focus usually is
// otherwise accelerators are lost sometimes // otherwise accelerators are lost sometimes
panel->SetAcceleratorTable(atab); panel->SetAcceleratorTable(atab);
} else delete tab;
}
else
{
panel->SetAcceleratorTable(wxNullAcceleratorTable); panel->SetAcceleratorTable(wxNullAcceleratorTable);
}
// save recent accels // save recent accels
for(int i = 0; i < 10; i++) for(int i = 0; i < 10; i++)