diff --git a/common/include/Utilities/Dependencies.h b/common/include/Utilities/Dependencies.h index 6c6bf982c5..60c603fc91 100644 --- a/common/include/Utilities/Dependencies.h +++ b/common/include/Utilities/Dependencies.h @@ -23,6 +23,12 @@ class wxOutputStream; class wxInputStream; +class wxPoint; +class wxRect; +class wxSize; + +extern const wxSize wxDefaultSize; +extern const wxPoint wxDefaultPosition; // This should prove useful.... @@ -107,18 +113,17 @@ static const pxEnumEnd_t pxEnumEnd = {}; // translator (which the _() does automatically, and sometimes we don't want that). This is // a shorthand replacement for wxTRANSLATE. // -#define wxLt(a) (a) +#ifndef wxLt +# define wxLt(a) a +#endif #include -#include // for wxPoint/wxRect stuff #include #include #include "Pcsx2Defs.h" #include -#include -#include #include // string.h under c++ #include // stdio.h under c++ #include diff --git a/common/include/Utilities/StringHelpers.h b/common/include/Utilities/StringHelpers.h index 4e8b674b6d..5556465473 100644 --- a/common/include/Utilities/StringHelpers.h +++ b/common/include/Utilities/StringHelpers.h @@ -18,7 +18,6 @@ #include "Dependencies.h" #include -#include // for wxPoint/wxRect stuff // -------------------------------------------------------------------------------------- diff --git a/common/include/Utilities/win_memzero.h b/common/include/Utilities/win_memzero.h index f52c942b26..5207002cdc 100644 --- a/common/include/Utilities/win_memzero.h +++ b/common/include/Utilities/win_memzero.h @@ -187,8 +187,8 @@ static __forceinline void memzero_ptr( void *dest ) } // This function only works on 32-bit alignments. - jASSUME( (MZFbytes & 0x3) == 0 ); - jASSUME( ((uptr)dest & 0x3) == 0 ); + pxAssume( (MZFbytes & 0x3) == 0 ); + pxAssume( ((uptr)dest & 0x3) == 0 ); enum { @@ -278,8 +278,8 @@ static __forceinline void memset_8( void *dest ) if( bytes128 > 32 ) { // This function only works on 128-bit alignments. - jASSUME( (MZFbytes & 0xf) == 0 ); - jASSUME( ((uptr)dest & 0xf) == 0 ); + pxAssume( (MZFbytes & 0xf) == 0 ); + pxAssume( ((uptr)dest & 0xf) == 0 ); __asm { @@ -323,7 +323,7 @@ static __forceinline void memset_8( void *dest ) }*/ // This function only works on 32-bit alignments of data copied. - jASSUME( (MZFbytes & 0x3) == 0 ); + pxAssume( (MZFbytes & 0x3) == 0 ); enum { @@ -396,8 +396,8 @@ static __forceinline void memset_16( void *dest ) { if( MZFbytes == 0 ) return; - if( (MZFbytes & 0x1) != 0 ) - throw Exception::LogicError( "Invalid parameter passed to memset_16 - data length is not a multiple of 16 or 32 bits." ); + // Assertion: data length must be a multiple of 16 or 32 bits + pxAssume( (MZFbytes & 0x1) == 0 ); if( (MZFbytes & 0x3) != 0 ) { @@ -411,7 +411,7 @@ static __forceinline void memset_16( void *dest ) //u64 _xmm_backup[2]; // This function only works on 32-bit alignments of data copied. - jASSUME( (MZFbytes & 0x3) == 0 ); + pxAssume( (MZFbytes & 0x3) == 0 ); enum { @@ -484,9 +484,8 @@ static __forceinline void memset_32( void *dest ) { if( MZFbytes == 0 ) return; - if( (MZFbytes & 0x3) != 0 ) - throw Exception::LogicError( "Invalid parameter passed to memset_32 - data length is not a multiple of 32 bits." ); - + // Assertion: data length must be a multiple of 32 bits + pxAssume( (MZFbytes & 0x3) == 0 ); //u64 _xmm_backup[2]; @@ -494,7 +493,7 @@ static __forceinline void memset_32( void *dest ) // If the data length is not a factor of 32 bits, the C++ optimizing compiler will // probably just generate mysteriously broken code in Release builds. ;) - jASSUME( (MZFbytes & 0x3) == 0 ); + pxAssume( (MZFbytes & 0x3) == 0 ); enum { diff --git a/common/src/Utilities/IniInterface.cpp b/common/src/Utilities/IniInterface.cpp index 37ca022465..f1642f802c 100644 --- a/common/src/Utilities/IniInterface.cpp +++ b/common/src/Utilities/IniInterface.cpp @@ -16,6 +16,10 @@ #include "PrecompiledHeader.h" #include "IniInterface.h" +#include + +const wxRect wxDefaultRect( wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, wxDefaultCoord ); + static int _calcEnumLength( const wxChar* const* enumArray ) { int cnt = 0; diff --git a/common/src/Utilities/PrecompiledHeader.h b/common/src/Utilities/PrecompiledHeader.h index 10e33c3096..f348764f47 100644 --- a/common/src/Utilities/PrecompiledHeader.h +++ b/common/src/Utilities/PrecompiledHeader.h @@ -6,10 +6,6 @@ #include "Dependencies.h" -using std::string; -using std::min; -using std::max; - #include "Assertions.h" #include "MemcpyFast.h" #include "Console.h" diff --git a/common/src/Utilities/StringHelpers.cpp b/common/src/Utilities/StringHelpers.cpp index 26e549baab..5859ad9441 100644 --- a/common/src/Utilities/StringHelpers.cpp +++ b/common/src/Utilities/StringHelpers.cpp @@ -14,9 +14,7 @@ */ #include "PrecompiledHeader.h" - -const wxRect wxDefaultRect( wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, wxDefaultCoord ); - +#include // for wxPoint/wxRect stuff __forceinline wxString fromUTF8( const char* src ) { diff --git a/common/src/Utilities/vssprintf.cpp b/common/src/Utilities/vssprintf.cpp index e8d2995f86..8af6151aaf 100644 --- a/common/src/Utilities/vssprintf.cpp +++ b/common/src/Utilities/vssprintf.cpp @@ -613,7 +613,7 @@ repeat: // let's add support for std::string as a formatted parameter! (air) if( qualifier == 'h' ) { - static const string nullstring( "" ); + static const std::string nullstring( "" ); const std::string* ss = va_arg(args, std::string*); if( ss == NULL ) ss = &nullstring; diff --git a/common/src/x86emitter/PrecompiledHeader.h b/common/src/x86emitter/PrecompiledHeader.h index bb9541eb17..7d5b86b650 100644 --- a/common/src/x86emitter/PrecompiledHeader.h +++ b/common/src/x86emitter/PrecompiledHeader.h @@ -5,24 +5,14 @@ #define EMITTER_PRECOMPILED_HEADER #include -#include -#include // for wxPoint/wxRect stuff -#include -#include #include "Pcsx2Defs.h" #include -#include -#include #include // string.h under c++ #include // stdio.h under c++ #include -using std::string; -using std::min; -using std::max; - #include "Utilities/Console.h" #include "Utilities/Exceptions.h" #include "Utilities/General.h" diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index c6d8f4e60c..750b58c5ec 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -234,8 +234,7 @@ set(pcsx2Headers sio_internal.h SPR.h Stats.h - StringUtils.h - SysForwardDefs.h + SysForwardDefs.h System.h Vif_Dma.h Vif.h diff --git a/pcsx2/DebugTools/DisR5900.cpp b/pcsx2/DebugTools/DisR5900.cpp index 9abcde5905..a076d45f4e 100644 --- a/pcsx2/DebugTools/DisR5900.cpp +++ b/pcsx2/DebugTools/DisR5900.cpp @@ -20,6 +20,8 @@ #include "R5900.h" #include "VU.h" +using std::string; + const char * const disRNameCP2f[] = { "VF00", "VF01", "VF02", "VF03", "VF04", "VF05", "VF06", "VF07", "VF08", "VF09", "VF10", "VF11", "VF12", "VF13", "VF14", "VF15", diff --git a/pcsx2/Dump.cpp b/pcsx2/Dump.cpp index 096831eba7..ceb0e95e6d 100644 --- a/pcsx2/Dump.cpp +++ b/pcsx2/Dump.cpp @@ -25,6 +25,8 @@ #include "Utilities/AsciiFile.h" using namespace R5900; +using std::string; + // fixme: currently should not be uncommented. //#define TEST_BROKEN_DUMP_ROUTINES diff --git a/pcsx2/PrecompiledHeader.h b/pcsx2/PrecompiledHeader.h index b68d145823..f00c23151b 100644 --- a/pcsx2/PrecompiledHeader.h +++ b/pcsx2/PrecompiledHeader.h @@ -20,7 +20,9 @@ // macro provided for tagging translation strings, without actually running them through the // translator (which the _() does automatically, and sometimes we don't want that). This is // a shorthand replacement for wxTRANSLATE. -#define wxLt(a) (a) +#ifndef wxLt +# define wxLt(a) a +#endif #define NOMINMAX // Disables other libs inclusion of their own min/max macros (we use std instead) @@ -29,7 +31,6 @@ #include #include -#include // for wxPoint/wxRect stuff #include #include #include @@ -38,18 +39,11 @@ // Include the STL junk that's actually handy. #include -#include #include -#include #include -#include -#include #include // string.h under c++ #include // stdio.h under c++ #include -#include -#include -#include // ... and include some ANSI/POSIX C libs that are useful too, just for good measure. // (these compile lightning fast with or without PCH, but they never change so @@ -59,8 +53,6 @@ #include #include - -using std::string; // we use it enough, so bring it into the global namespace. using std::min; using std::max; @@ -117,14 +109,6 @@ typedef int BOOL; # define __declspec(x) # endif -# ifndef strnicmp -# define strnicmp strncasecmp -# endif - -# ifndef stricmp -# define stricmp strcasecmp -# endif - #endif // end GCC/Linux stuff #endif diff --git a/pcsx2/R5900.cpp b/pcsx2/R5900.cpp index 22785b52bb..411967db50 100644 --- a/pcsx2/R5900.cpp +++ b/pcsx2/R5900.cpp @@ -635,7 +635,7 @@ void __fastcall eeloadReplaceOSDSYS() } pxAssert(osdsys_p); - string elfname; + std::string elfname; if (!elf_override.IsEmpty()) { diff --git a/pcsx2/StringUtils.h b/pcsx2/StringUtils.h deleted file mode 100644 index ececc7a9be..0000000000 --- a/pcsx2/StringUtils.h +++ /dev/null @@ -1,33 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2010 PCSX2 Dev Team - * - * PCSX2 is free software: you can redistribute it and/or modify it under the terms - * of the GNU Lesser General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with PCSX2. - * If not, see . - */ - -#pragma once - -#include -#include -#include - -// to_string: A utility template for quick and easy inline string type conversion. -// Use to_string(intval), or to_string(float), etc. Anything that the STL itself -// would support should be supported here. :) -// Notice: Obsolete, use wxString features instead. -template< typename T > -std::string to_string(const T& value) -{ - std::ostringstream oss; - oss << value; - return oss.str(); -} - diff --git a/pcsx2/Utilities/FileUtils.cpp b/pcsx2/Utilities/FileUtils.cpp index ee41d307fc..88b24a0e45 100644 --- a/pcsx2/Utilities/FileUtils.cpp +++ b/pcsx2/Utilities/FileUtils.cpp @@ -20,7 +20,7 @@ void AsciiFile::Printf( const char* fmt, ... ) { va_list list; va_start( list, fmt ); - string writeme; vssprintf( writeme, fmt, list ); + std::string writeme; vssprintf( writeme, fmt, list ); va_end( list ); Write( writeme.c_str(), writeme.length() ); } diff --git a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj index 73a727118e..e9d4a14f2a 100644 --- a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj +++ b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj @@ -315,10 +315,6 @@ RelativePath="..\..\Utilities\FileUtils.cpp" > - - + #include "VU.h" #include "GS.h" #include "iR5900.h"