Integrate C++11 branch into 5_1-new

This commit is contained in:
teejusb
2019-06-22 12:35:38 -07:00
444 changed files with 19503 additions and 21007 deletions
+10 -10
View File
@@ -22,7 +22,7 @@ bool GetFileVersion( RString sFile, RString &sOut )
RString VersionBuffer( iSize, ' ' );
// Also VC6:
if( !GetFileVersionInfo( const_cast<char *>(sFile.c_str()), NULL, iSize, const_cast<char *>(VersionBuffer.c_str()) ) )
if( !GetFileVersionInfo( const_cast<char *>(sFile.c_str()), nullptr, iSize, const_cast<char *>(VersionBuffer.c_str()) ) )
break;
WORD *iTrans;
@@ -73,7 +73,7 @@ RString FindSystemFile( RString sFile )
"/system/",
"/system/drivers/",
"/",
NULL
nullptr
};
for( int i = 0; szPaths[i]; ++i )
@@ -95,7 +95,7 @@ bool GetProcessFileName( uint32_t iProcessID, RString &sName )
* kernel32.lib functions. */
do {
HANDLE hSnap = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, iProcessID );
if( hSnap == NULL )
if( hSnap == nullptr )
{
sName = werr_ssprintf( GetLastError(), "CreateToolhelp32Snapshot" );
break;
@@ -118,9 +118,9 @@ bool GetProcessFileName( uint32_t iProcessID, RString &sName )
// This method only works in NT/2K/XP.
do {
static HINSTANCE hPSApi = NULL;
static HINSTANCE hPSApi = nullptr;
typedef DWORD (WINAPI* pfnGetProcessImageFileNameA)(HANDLE hProcess, LPSTR lpImageFileName, DWORD nSize);
static pfnGetProcessImageFileNameA pGetProcessImageFileName = NULL;
static pfnGetProcessImageFileNameA pGetProcessImageFileName = nullptr;
static bool bTried = false;
if( !bTried )
@@ -128,7 +128,7 @@ bool GetProcessFileName( uint32_t iProcessID, RString &sName )
bTried = true;
hPSApi = LoadLibrary("psapi.dll");
if( hPSApi == NULL )
if( hPSApi == nullptr )
{
sName = werr_ssprintf( GetLastError(), "LoadLibrary" );
break;
@@ -136,7 +136,7 @@ bool GetProcessFileName( uint32_t iProcessID, RString &sName )
else
{
pGetProcessImageFileName = (pfnGetProcessImageFileNameA) GetProcAddress( hPSApi, "GetProcessImageFileNameA" );
if( pGetProcessImageFileName == NULL )
if( pGetProcessImageFileName == nullptr )
{
sName = werr_ssprintf( GetLastError(), "GetProcAddress" );
break;
@@ -144,10 +144,10 @@ bool GetProcessFileName( uint32_t iProcessID, RString &sName )
}
}
if( pGetProcessImageFileName != NULL )
if( pGetProcessImageFileName != nullptr )
{
HANDLE hProc = OpenProcess( PROCESS_VM_READ|PROCESS_QUERY_INFORMATION, NULL, iProcessID );
if( hProc == NULL )
HANDLE hProc = OpenProcess( PROCESS_VM_READ|PROCESS_QUERY_INFORMATION, nullptr, iProcessID );
if( hProc == nullptr )
{
sName = werr_ssprintf( GetLastError(), "OpenProcess" );
break;