From 145d86858569d3b6a0a3c02db50d9e91b10a2718 Mon Sep 17 00:00:00 2001 From: nakeee Date: Mon, 10 Nov 2008 19:30:16 +0000 Subject: [PATCH] fix to compile on linux (itoa is not standart please don't use it..) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1110 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_DSP_HLE/Src/Debugger/Debugger.cpp | 22 ++++++++++++------- .../Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp | 15 ++++++++----- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.cpp index a412e52f6f..a95a052faf 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.cpp @@ -22,6 +22,11 @@ // includes #include #include +#include + +#ifndef _WIN32 +#include +#endif #include "Debugger.h" #include "PBView.h" @@ -557,11 +562,11 @@ void CDebugger::DoUpdateMail() if(sFullMail.size() > 0 && sMailLog.size() > 0) { - m_log->SetValue(sFullMail.at(m_RadioBox[3]->GetSelection()).c_str()); - m_log->SetDefaultStyle(wxTextAttr(*wxBLUE)); // doesn't work because of the current wx - - m_log1->SetValue(sMailLog.at(m_RadioBox[3]->GetSelection()).c_str()); - m_log1->AppendText(wxT("\n\n")); + m_log->SetValue(wxString::FromAscii(sFullMail.at(m_RadioBox[3]->GetSelection()).c_str())); + m_log->SetDefaultStyle(wxTextAttr(*wxBLUE)); // doesn't work because of the current wx + + m_log1->SetValue(wxString::FromAscii(sMailLog.at(m_RadioBox[3]->GetSelection()).c_str())); + m_log1->AppendText(wxT("\n\n")); } } @@ -734,9 +739,10 @@ void CDebugger::Readfile(std::string FileName, bool GC) //wprintf("m_RadioBox[3] enabled: %i\n", i); std::string sz = ""; - char ci[10]; itoa(i, ci, 10); - std::string f0 = "Logs/Mail/" + FileName + "_sep" + ci + "_sep" + "0_sep" + (GC ? "GC" : "Wii") + "_sep.log"; - std::string f1 = "Logs/Mail/" + FileName + "_sep" + ci + "_sep" + "1_sep" + (GC ? "GC" : "Wii") + "_sep.log"; + std::ostringstream ci; + ci << i; + std::string f0 = "Logs/Mail/" + FileName + "_sep" + ci.str() + "_sep" + "0_sep" + (GC ? "GC" : "Wii") + "_sep.log"; + std::string f1 = "Logs/Mail/" + FileName + "_sep" + ci.str() + "_sep" + "1_sep" + (GC ? "GC" : "Wii") + "_sep.log"; //wprintf("ifstream %s %s\n", f0.c_str(), f1.c_str()); diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp index 46056cd93e..fee288eedb 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp @@ -18,6 +18,7 @@ #include "FileUtil.h" // for IsDirectory #include "../Debugger/Debugger.h" #include "../Logging/Console.h" // for aprintf +#include #ifdef _WIN32 #include "../PCHW/DSoundStream.h" @@ -67,11 +68,14 @@ CUCode_AX::~CUCode_AX() void CUCode_AX::SaveLogFile(std::string f, int resizeTo, bool type, bool Wii) { if (!File::IsDirectory("Logs/Mail")) File::CreateDir("Logs/Mail"); - char ci[10]; itoa(resizeTo - 1, ci, 10); // write ci - char cType[10]; itoa(type, cType, 10); // write cType + std::ostringstream ci; + std::ostringstream cType; + + ci << (resizeTo - 1); // write ci + cType << type; // write cType std::string FileName = "Logs/Mail/"; FileName += gpName; - FileName += "_sep"; FileName += ci; FileName += "_sep"; FileName += cType; + FileName += "_sep"; FileName += ci.str(); FileName += "_sep"; FileName += cType.str(); FileName += Wii ? "_sepWii_sep" : "_sepGC_sep"; FileName += ".log"; FILE* fhandle = fopen(FileName.c_str(), "w"); @@ -107,10 +111,11 @@ if(m_frame->ScanMails) //wprintf("End"); // Save the timestamps and comment - char ci[10]; itoa(saveNext - 1, ci, 10); // write ci + std::ostringstream ci; + ci << (saveNext - 1); TmpMailLog += "\n\n"; TmpMailLog += "-----------------------------------------------------------------------\n"; - TmpMailLog += "Current mail: " + gpName + " mail " + ci + "\n\n"; + TmpMailLog += "Current mail: " + gpName + " mail " + ci.str() + "\n\n"; for (int i = 0; i < sMailTime.size(); i++) {