Kill off some usages of c_str.

Also changes some function params, but this is ok.
Some simplifications were also able to be made (ie. killing off strcmps with ==, etc).
This commit is contained in:
Lioncash
2014-03-12 15:33:41 -04:00
parent dccc6d8b47
commit a82675b7d5
170 changed files with 812 additions and 704 deletions

View File

@ -42,7 +42,7 @@ void BreakPointDlg::OnOK(wxCommandEvent& event)
{
wxString AddressString = m_pEditAddress->GetLineText(0);
u32 Address = 0;
if (AsciiToHex(WxStrToStr(AddressString).c_str(), Address))
if (AsciiToHex(WxStrToStr(AddressString), Address))
{
PowerPC::breakpoints.Add(Address);
Parent->NotifyUpdate();

View File

@ -195,7 +195,7 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event)
{
std::string filename = File::GetUserPath(D_DUMP_IDX) + "Debug/profiler.txt";
File::CreateFullPath(filename);
Profiler::WriteProfileResults(filename.c_str());
Profiler::WriteProfileResults(filename);
wxFileType* filetype = nullptr;
if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("txt"))))
@ -235,7 +235,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
{
PPCAnalyst::FindFunctions(0x80000000, 0x81800000, &g_symbolDB);
SignatureDB db;
if (db.Load((File::GetSysDirectory() + TOTALDB).c_str()))
if (db.Load(File::GetSysDirectory() + TOTALDB))
{
db.Apply(&g_symbolDB);
Parent->StatusBarMessage("Generated symbol names from '%s'", TOTALDB);
@ -255,23 +255,23 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
g_symbolDB.Clear();
PPCAnalyst::FindFunctions(0x81300000, 0x81800000, &g_symbolDB);
SignatureDB db;
if (db.Load((File::GetSysDirectory() + TOTALDB).c_str()))
if (db.Load(File::GetSysDirectory() + TOTALDB))
db.Apply(&g_symbolDB);
Parent->StatusBarMessage("'%s' not found, scanning for common functions instead", writable_map_file.c_str());
}
else
{
g_symbolDB.LoadMap(existing_map_file.c_str());
g_symbolDB.LoadMap(existing_map_file);
Parent->StatusBarMessage("Loaded symbols from '%s'", existing_map_file.c_str());
}
HLE::PatchFunctions();
NotifyMapLoaded();
break;
case IDM_SAVEMAPFILE:
g_symbolDB.SaveMap(writable_map_file.c_str());
g_symbolDB.SaveMap(writable_map_file);
break;
case IDM_SAVEMAPFILEWITHCODES:
g_symbolDB.SaveMap(writable_map_file.c_str(), true);
g_symbolDB.SaveMap(writable_map_file, true);
break;
case IDM_RENAME_SYMBOLS:
@ -328,8 +328,8 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
if (!path.IsEmpty())
{
SignatureDB db;
db.Initialize(&g_symbolDB, prefix.c_str());
db.Save(WxStrToStr(path).c_str());
db.Initialize(&g_symbolDB, prefix);
db.Save(WxStrToStr(path));
}
}
}
@ -343,7 +343,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
if (!path.IsEmpty())
{
SignatureDB db;
db.Load(WxStrToStr(path).c_str());
db.Load(WxStrToStr(path));
db.Apply(&g_symbolDB);
}
}

View File

@ -278,50 +278,50 @@ void GFXDebuggerPanel::OnDumpButton(wxCommandEvent& event)
switch (m_pDumpList->GetSelection())
{
case 0: // Pixel Shader
DumpPixelShader(dump_path.c_str());
DumpPixelShader(dump_path);
break;
case 1: // Vertex Shader
DumpVertexShader(dump_path.c_str());
DumpVertexShader(dump_path);
break;
case 2: // Pixel Shader Constants
DumpPixelShaderConstants(dump_path.c_str());
DumpPixelShaderConstants(dump_path);
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 3: // Vertex Shader Constants
DumpVertexShaderConstants(dump_path.c_str());
DumpVertexShaderConstants(dump_path);
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 4: // Textures
DumpTextures(dump_path.c_str());
DumpTextures(dump_path);
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 5: // Frame Buffer
DumpFrameBuffer(dump_path.c_str());
DumpFrameBuffer(dump_path);
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 6: // Geometry
DumpGeometry(dump_path.c_str());
DumpGeometry(dump_path);
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 7: // Vertex Description
DumpVertexDecl(dump_path.c_str());
DumpVertexDecl(dump_path);
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 8: // Vertex Matrices
DumpMatrices(dump_path.c_str());
DumpMatrices(dump_path);
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 9: // Statistics
DumpStats(dump_path.c_str());
DumpStats(dump_path);
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
}

View File

@ -81,9 +81,9 @@ void MemoryCheckDlg::OnOK(wxCommandEvent& event)
u32 StartAddress, EndAddress;
bool EndAddressOK = EndAddressString.Len() &&
AsciiToHex(WxStrToStr(EndAddressString).c_str(), EndAddress);
AsciiToHex(WxStrToStr(EndAddressString), EndAddress);
if (AsciiToHex(WxStrToStr(StartAddressString).c_str(), StartAddress) &&
if (AsciiToHex(WxStrToStr(StartAddressString), StartAddress) &&
(OnRead || OnWrite) && (Log || Break))
{
TMemCheck MemCheck;