From 30584cb9f628fc59da7f87f97934221eff108362 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Tue, 3 Nov 2009 20:36:47 +0000 Subject: [PATCH] ToAscii() -> ToUFT8() [missed a few last time] git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2124 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/CDVD/CDVD.cpp | 4 ++-- pcsx2/CDVD/CDVDaccess.cpp | 2 +- pcsx2/Elfheader.cpp | 20 ++++++++++---------- pcsx2/SaveState.cpp | 6 +++--- pcsx2/ShiftJisToUnicode.cpp | 3 +-- pcsx2/gui/ConsoleLogger.cpp | 1 - pcsx2/ps2/BiosTools.cpp | 2 +- pcsx2/x86/iR3000A.cpp | 2 +- 8 files changed, 19 insertions(+), 21 deletions(-) diff --git a/pcsx2/CDVD/CDVD.cpp b/pcsx2/CDVD/CDVD.cpp index a2968738a7..43a341160f 100644 --- a/pcsx2/CDVD/CDVD.cpp +++ b/pcsx2/CDVD/CDVD.cpp @@ -325,7 +325,7 @@ void cdvdReadKey(u8 arg0, u16 arg1, u32 arg2, u8* key) { // get main elf name bool IsPs2 = (GetPS2ElfName(fname) == 2); - const wxCharBuffer crap( fname.ToAscii() ); + const wxCharBuffer crap( fname.To8BitData() ); const char* str = crap.data(); sprintf(exeName, "%c%c%c%c%c%c%c%c%c%c%c",str[8],str[9],str[10],str[11],str[12],str[13],str[14],str[15],str[16],str[17],str[18]); DevCon.Warning("exeName = %s", &str[8]); @@ -515,7 +515,7 @@ static void cdvdDetectDisk() wxString str; bool IsPs2 = (GetPS2ElfName(str) == 2); - if (IsPs2) reloadElfInfo(str.ToAscii().data()); + if (IsPs2) reloadElfInfo( str.ToUTF8() ); } void cdvdNewDiskCB() diff --git a/pcsx2/CDVD/CDVDaccess.cpp b/pcsx2/CDVD/CDVDaccess.cpp index dddc922742..04ef3b4055 100644 --- a/pcsx2/CDVD/CDVDaccess.cpp +++ b/pcsx2/CDVD/CDVDaccess.cpp @@ -343,7 +343,7 @@ bool DoCDVDopen() cdvdTD td; CDVD->getTD(0, &td); - blockDumpFile = isoCreate(temp.ToAscii().data(), ISOFLAGS_BLOCKDUMP_V3); + blockDumpFile = isoCreate(temp.ToUTF8(), ISOFLAGS_BLOCKDUMP_V3); if( blockDumpFile != NULL ) { diff --git a/pcsx2/Elfheader.cpp b/pcsx2/Elfheader.cpp index 2f7b1542f0..685e1490a8 100644 --- a/pcsx2/Elfheader.cpp +++ b/pcsx2/Elfheader.cpp @@ -26,7 +26,7 @@ u32 ElfCRC; struct ELF_HEADER { u8 e_ident[16]; //0x7f,"ELF" (ELF file identifier) - u16 e_type; //ELF type: 0=NONE, 1=REL, 2=EXEC, 3=SHARED, 4=CORE + u16 e_type; //ELF type: 0=NONE, 1=REL, 2=EXEC, 3=SHARED, 4=CORE u16 e_machine; //Processor: 8=MIPS R3000 u32 e_version; //Version: 1=current u32 e_entry; //Entry point address @@ -246,7 +246,7 @@ struct ElfObject // Destructor! // C++ does all the cleanup automagically for us. - ~ElfObject() { } + virtual ~ElfObject() { } ElfObject( const wxString& srcfile, uint hdrsize ) : filename( srcfile ) @@ -321,11 +321,11 @@ struct ElfObject void readFile() { int rsize = 0; - const wxCharBuffer work( filename.ToAscii() ); - if ((strnicmp( work.data(), "cdrom0:", strlen("cdromN:")) == 0) || - (strnicmp( work.data(), "cdrom1:", strlen("cdromN:")) == 0)) + const wxCharBuffer work( filename.ToUTF8() ); + if ((strnicmp( work, "cdrom0:", strlen("cdromN:")) == 0) || + (strnicmp( work, "cdrom1:", strlen("cdromN:")) == 0)) { - int fi = IsoFS_open(work.data() + strlen("cdromN:"), 1);//RDONLY + int fi = IsoFS_open(work + strlen("cdromN:"), 1);//RDONLY if (fi < 0) throw Exception::FileNotFound( filename ); @@ -499,12 +499,12 @@ void ElfApplyPatches() /*if(LoadPatch( filename ) != 0) { Console.WriteLn( "XML Loader returned an error. Trying to load a pnach..." ); - inifile_read( filename.ToAscii().data() ); + inifile_read( filename.ToUTF8() ); } else Console.WriteLn( "XML Loading success. Will not load from pnach..." );*/ - inifile_read( filename.ToAscii().data() ); + inifile_read( filename.ToUTF8() ); applypatch( 0 ); } @@ -542,9 +542,9 @@ void loadElfFile(const wxString& filename) if( filename.IsEmpty() ) return; s64 elfsize; - Console.WriteLn( L"loadElfFile: %s", filename.c_str() ); + Console.WriteLn( L"loadElfFile: " + filename ); - const wxCharBuffer buffer( filename.ToAscii() ); + const wxCharBuffer buffer( filename.ToUTF8() ); const char* fnptr = buffer.data(); bool useCdvdSource=false; diff --git a/pcsx2/SaveState.cpp b/pcsx2/SaveState.cpp index 4c51d7986a..a089e79d21 100644 --- a/pcsx2/SaveState.cpp +++ b/pcsx2/SaveState.cpp @@ -105,8 +105,8 @@ void SaveStateBase::FreezeBios() memzero( descin ); memzero( desccmp ); - memcpy_fast( descin, descout.ToAscii().data(), descout.Length() ); - memcpy_fast( desccmp, descout.ToAscii().data(), descout.Length() ); + memcpy_fast( descin, descout.ToUTF8().data(), descout.Length() ); + memcpy_fast( desccmp, descout.ToUTF8().data(), descout.Length() ); // ... and only freeze bios info once per state, since the user msg could // become really annoying on a corrupted state or something. (have to always @@ -123,7 +123,7 @@ void SaveStateBase::FreezeBios() "\n\tWarning: BIOS Version Mismatch, savestate may be unstable!\n" "\t\tCurrent Version: %s\n" "\t\tSavestate Version: %s\n", - descout.ToAscii().data(), descin + descout.ToUTF8().data(), descin ); } } diff --git a/pcsx2/ShiftJisToUnicode.cpp b/pcsx2/ShiftJisToUnicode.cpp index ea0ba41073..86d8910726 100644 --- a/pcsx2/ShiftJisToUnicode.cpp +++ b/pcsx2/ShiftJisToUnicode.cpp @@ -824,8 +824,7 @@ wchar_t ShiftJIS_ConvertChar(const char* input, int& used) } used = 2; - const uint SecondByte = input[1]; - return TwoBytes[FirstByte][SecondByte]; + return TwoBytes[FirstByte][input[1]]; } } diff --git a/pcsx2/gui/ConsoleLogger.cpp b/pcsx2/gui/ConsoleLogger.cpp index 6e9c1c26be..d6ce030caf 100644 --- a/pcsx2/gui/ConsoleLogger.cpp +++ b/pcsx2/gui/ConsoleLogger.cpp @@ -20,7 +20,6 @@ #include "Utilities/Console.h" #include "DebugTools/Debug.h" -#include #include #ifdef __WXMSW__ diff --git a/pcsx2/ps2/BiosTools.cpp b/pcsx2/ps2/BiosTools.cpp index 7d60a1c2c4..fb6758c1b8 100644 --- a/pcsx2/ps2/BiosTools.cpp +++ b/pcsx2/ps2/BiosTools.cpp @@ -123,7 +123,7 @@ static void loadBiosRom( const wxChar *ext, u8 *dest, s64 maxSize ) Bios1 = Path::ReplaceExtension( Bios, ext ); if( (filesize=Path::GetFileSize( Bios1 ) ) <= 0 ) { - Console.Warning( "Load Bios Warning: %s not found (this is not an error!)", wxString(ext).ToAscii().data() ); + Console.Warning( L"Load Bios Warning: %s module not found, skipping... (this is not an error)", ext ); return; } } diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index f5e14d5a0f..7565c29193 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -436,7 +436,7 @@ static void iIopDumpBlock( int startpc, u8 * ptr ) AsciiFile f2( L"mydump1", wxFile::write ); f2.Write( ptr, (uptr)x86Ptr - (uptr)ptr ); } - wxCharBuffer buf( filename.ToAscii() ); + wxCharBuffer buf( filename.ToUTF8() ); const char* filenamea = buf.data(); sprintf( command, "objdump -D --target=binary --architecture=i386 -M intel mydump1 | cat %s - > tempdump", filenamea ); system( command );