Remove global "using namespace std;" declarations, use "std::" prefixes on all std elements

Fix whitespace changes
This commit is contained in:
Michael Sundqvist
2022-07-31 22:14:38 +02:00
committed by Martin Natano
parent f0680a29fc
commit 0cba3579de
534 changed files with 3456 additions and 3488 deletions
+3 -3
View File
@@ -446,8 +446,8 @@ struct CompleteCrashData
RString m_sInfo;
RString m_sAdditionalLog;
RString m_sCrashedThread;
vector<RString> m_asRecent;
vector<RString> m_asCheckpoints;
std::vector<RString> m_asRecent;
std::vector<RString> m_asCheckpoints;
};
static void MakeCrashReport( const CompleteCrashData &Data, RString &sOut )
@@ -455,7 +455,7 @@ static void MakeCrashReport( const CompleteCrashData &Data, RString &sOut )
sOut += ssprintf(
"%s crash report (build %s, %s @ %s)\n"
"--------------------------------------\n\n",
(string(PRODUCT_FAMILY) + product_version).c_str(), ::sm_version_git_hash, version_date, version_time );
(std::string(PRODUCT_FAMILY) + product_version).c_str(), ::sm_version_git_hash, version_date, version_time );
sOut += ssprintf( "Crash reason: %s\n", Data.m_CrashInfo.m_CrashReason );
sOut += ssprintf( "\n" );
@@ -582,7 +582,7 @@ NetworkPostData::~NetworkPostData()
}
/** @brief Create a MIME multipart data block from the given set of fields. */
void NetworkPostData::CreateMimeData( const map<RString,RString> &mapNameToData, RString &sOut, RString &sMimeBoundaryOut )
void NetworkPostData::CreateMimeData( const std::map<RString, RString> &mapNameToData, RString &sOut, RString &sMimeBoundaryOut )
{
// Find a non-conflicting mime boundary.
while(1)
@@ -667,7 +667,7 @@ void NetworkPostData::HttpThread()
// Parse the results.
int iStart = 0, iSize = -1;
map<RString,RString> mapHeaders;
std::map<RString, RString> mapHeaders;
while( 1 )
{
split( sResult, "\n", iStart, iSize, false );
+2 -2
View File
@@ -30,7 +30,7 @@ public:
RString GetResult() const { return m_sResult; }
private:
static void CreateMimeData( const map<RString,RString> &mapNameToData, RString &sOut, RString &sMimeBoundaryOut );
static void CreateMimeData( const std::map<RString, RString> &mapNameToData, RString &sOut, RString &sMimeBoundaryOut );
void SetProgress( float fProgress );
RageThread m_Thread;
@@ -42,7 +42,7 @@ private:
float m_fProgress;
// When the thread exists, it owns the rest of the data, regardless of m_Mutex.
map<RString, RString> m_Data;
std::map<RString, RString> m_Data;
bool m_bFinished;
RString m_sHost;
+6 -6
View File
@@ -89,13 +89,13 @@ static void GetDriveDebugInfo9x()
* DMACurrentlyUsed 0 or 1
* DeviceDesc "GENERIC IDE DISK TYPE01"
*/
vector<RString> Drives;
std::vector<RString> Drives;
if( !RegistryAccess::GetRegSubKeys( "HKEY_LOCAL_MACHINE\\Enum\\ESDI", Drives ) )
return;
for( unsigned drive = 0; drive < Drives.size(); ++drive )
{
vector<RString> IDs;
std::vector<RString> IDs;
if( !RegistryAccess::GetRegSubKeys( Drives[drive], IDs ) )
continue;
@@ -128,7 +128,7 @@ static void GetDriveDebugInfoNT()
* Identifier "WDC WD1200JB-75CRA0"
* Type "DiskPeripheral"
*/
vector<RString> Ports;
std::vector<RString> Ports;
if( !RegistryAccess::GetRegSubKeys( "HKEY_LOCAL_MACHINE\\HARDWARE\\DEVICEMAP\\Scsi", Ports ) )
return;
@@ -140,19 +140,19 @@ static void GetDriveDebugInfoNT()
RString Driver;
RegistryAccess::GetRegValue( Ports[i], "Driver", Driver );
vector<RString> Busses;
std::vector<RString> Busses;
if( !RegistryAccess::GetRegSubKeys( Ports[i], Busses, "Scsi Bus .*" ) )
continue;
for( unsigned bus = 0; bus < Busses.size(); ++bus )
{
vector<RString> TargetIDs;
std::vector<RString> TargetIDs;
if( !RegistryAccess::GetRegSubKeys( Busses[bus], TargetIDs, "Target Id .*" ) )
continue;
for( unsigned tid = 0; tid < TargetIDs.size(); ++tid )
{
vector<RString> LUIDs;
std::vector<RString> LUIDs;
if( !RegistryAccess::GetRegSubKeys( TargetIDs[tid], LUIDs, "Logical Unit Id .*" ) )
continue;
+4 -4
View File
@@ -25,7 +25,7 @@ RString werr_ssprintf( int err, const char *fmt, ... )
return s += ssprintf( " (%s)", text.c_str() );
}
RString ConvertWstringToCodepage( wstring s, int iCodePage )
RString ConvertWstringToCodepage( std::wstring s, int iCodePage )
{
if( s.empty() )
return RString();
@@ -48,17 +48,17 @@ RString ConvertUTF8ToACP( const RString &s )
return ConvertWstringToCodepage( RStringToWstring(s), CP_ACP );
}
wstring ConvertCodepageToWString( RString s, int iCodePage )
std::wstring ConvertCodepageToWString( RString s, int iCodePage )
{
if( s.empty() )
return wstring();
return std::wstring();
int iBytes = MultiByteToWideChar( iCodePage, 0, s.data(), s.size(), nullptr, 0 );
ASSERT_M( iBytes > 0, werr_ssprintf( GetLastError(), "MultiByteToWideChar" ).c_str() );
wchar_t *pTemp = new wchar_t[iBytes];
MultiByteToWideChar( iCodePage, 0, s.data(), s.size(), pTemp, iBytes );
wstring sRet( pTemp, iBytes );
std::wstring sRet( pTemp, iBytes );
delete [] pTemp;
return sRet;
+2 -2
View File
@@ -2,9 +2,9 @@
#define ERROR_STRINGS_H
RString werr_ssprintf( int err, const char *fmt, ... );
RString ConvertWstringToCodepage( wstring s, int iCodePage );
RString ConvertWstringToCodepage( std::wstring s, int iCodePage );
RString ConvertUTF8ToACP( const RString &s );
wstring ConvertCodepageToWString( RString s, int iCodePage );
std::wstring ConvertCodepageToWString( RString s, int iCodePage );
RString ConvertACPToUTF8( const RString &s );
#endif
+3 -3
View File
@@ -70,10 +70,10 @@ static LRESULT CALLBACK GraphicsWindow_WndProc( HWND hWnd, UINT msg, WPARAM wPar
if( !g_bHasFocus )
{
RString sName = GetNewWindow();
static set<RString> sLostFocusTo;
static std::set<RString> sLostFocusTo;
sLostFocusTo.insert( sName );
RString sStr;
for( set<RString>::const_iterator it = sLostFocusTo.begin(); it != sLostFocusTo.end(); ++it )
for( std::set<RString>::const_iterator it = sLostFocusTo.begin(); it != sLostFocusTo.end(); ++it )
sStr += (sStr.size()?", ":"") + *it;
LOG->MapLog( "LOST_FOCUS", "Lost focus to: %s", sStr.c_str() );
@@ -432,7 +432,7 @@ void GraphicsWindow::Initialize( bool bD3D )
AppInstance inst;
do
{
const wstring wsClassName = RStringToWstring( g_sClassName );
const std::wstring wsClassName = RStringToWstring( g_sClassName );
WNDCLASSW WindowClassW =
{
CS_OWNDC | CS_BYTEALIGNCLIENT,
+2 -2
View File
@@ -112,7 +112,7 @@ bool RegistryAccess::GetRegValue( const RString &sKey, const RString &sName, boo
return b;
}
bool RegistryAccess::GetRegSubKeys( const RString &sKey, vector<RString> &lst, const RString &regex, bool bReturnPathToo )
bool RegistryAccess::GetRegSubKeys( const RString &sKey, std::vector<RString> &lst, const RString &regex, bool bReturnPathToo )
{
HKEY hKey = OpenRegKey( sKey, READ );
if( hKey == nullptr )
@@ -196,7 +196,7 @@ bool RegistryAccess::CreateKey( const RString &sKey )
RString sSubkey;
HKEY hType;
if( !GetRegKeyType(sKey, sSubkey, hType) )
return nullptr;
return false;
HKEY hKey;
DWORD dwDisposition = 0;
+1 -1
View File
@@ -9,7 +9,7 @@ namespace RegistryAccess
bool GetRegValue( const RString &sKey, const RString &sName, int &val, bool bWarnOnError = true );
bool GetRegValue( const RString &sKey, const RString &sName, bool &val );
bool GetRegSubKeys( const RString &sKey, vector<RString> &asList, const RString &sRegex = ".*", bool bReturnPathToo = true );
bool GetRegSubKeys( const RString &sKey, std::vector<RString> &asList, const RString &sRegex = ".*", bool bReturnPathToo = true );
bool SetRegValue( const RString &sKey, const RString &sName, const RString &val );
bool SetRegValue( const RString &sKey, const RString &sName, int val );
+1 -1
View File
@@ -189,7 +189,7 @@ int WindowsFileIO::read( void *p )
return finish_read(p);
}
int WindowsFileIO::read_several(const vector<WindowsFileIO *> &sources, void *p, int &actual, float timeout)
int WindowsFileIO::read_several(const std::vector<WindowsFileIO *> &sources, void *p, int &actual, float timeout)
{
HANDLE *Handles = new HANDLE[sources.size()];
for( unsigned i = 0; i < sources.size(); ++i )
+1 -1
View File
@@ -17,7 +17,7 @@ public:
/* Nonblocking read. size must always be the same. Returns the number of bytes
* read, or 0. */
int read( void *p );
static int read_several( const vector<WindowsFileIO *> &sources, void *p, int &actual, float timeout );
static int read_several( const std::vector<WindowsFileIO *> &sources, void *p, int &actual, float timeout );
private:
void queue_read();
+1 -1
View File
@@ -68,7 +68,7 @@ bool GetVideoDriverInfo( int iCardno, VideoDriverInfo &info )
const bool bIsWin9x = version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS;
static bool bInitialized=false;
static vector<RString> lst;
static std::vector<RString> lst;
if( !bInitialized )
{
bInitialized = true;