diff --git a/src/RageFileManager.cpp b/src/RageFileManager.cpp index 0a13efffbc..80db4a8779 100644 --- a/src/RageFileManager.cpp +++ b/src/RageFileManager.cpp @@ -414,7 +414,7 @@ static void ChangeToDirOfExecutable( const RString &argv0 ) * through a symlink. Assume this is the case and change to the dir of the symlink. */ if( Basename(RageFileManagerUtil::sDirOfExecutable) == "MacOS" ) CollapsePath( RageFileManagerUtil::sDirOfExecutable += "/../../../" ); - if( chdir( RageFileManagerUtil::sDirOfExecutable ) ) + if( chdir( RageFileManagerUtil::sDirOfExecutable.c_str() ) ) #endif { LOG->Warn("Can't set current working directory to %s", RageFileManagerUtil::sDirOfExecutable.c_str()); diff --git a/src/RageUtil_CharConversions.cpp b/src/RageUtil_CharConversions.cpp index 0f63aaeb1d..739cfa3984 100644 --- a/src/RageUtil_CharConversions.cpp +++ b/src/RageUtil_CharConversions.cpp @@ -99,7 +99,7 @@ static bool ConvertFromCP( RString &sText, int iCodePage ) if( encoding == kCFStringEncodingInvalidId ) return false; - CFStringRef old = CFStringCreateWithCString( kCFAllocatorDefault, sText, encoding ); + CFStringRef old = CFStringCreateWithCString( kCFAllocatorDefault, sText.c_str(), encoding ); if( old == nullptr ) return false; diff --git a/src/arch/Dialog/DialogDriver_MacOSX.cpp b/src/arch/Dialog/DialogDriver_MacOSX.cpp index b227f83e47..cb902f14f3 100644 --- a/src/arch/Dialog/DialogDriver_MacOSX.cpp +++ b/src/arch/Dialog/DialogDriver_MacOSX.cpp @@ -46,7 +46,7 @@ void DialogDriver_MacOSX::OK( RString sMessage, RString sID ) { CFBundleRef bundle = CFBundleGetMainBundle(); CFStringRef sDSA = LSTRING( bundle, "Don't show again" ); - CFOptionFlags result = ShowAlert( kCFUserNotificationNoteAlertLevel, sMessage, CFSTR("OK"), sDSA ); + CFOptionFlags result = ShowAlert( kCFUserNotificationNoteAlertLevel, sMessage.c_str(), CFSTR("OK"), sDSA ); CFRelease( sDSA ); if( result == kCFUserNotificationAlternateResponse ) @@ -55,7 +55,7 @@ void DialogDriver_MacOSX::OK( RString sMessage, RString sID ) void DialogDriver_MacOSX::Error( RString sError, RString sID ) { - ShowAlert( kCFUserNotificationStopAlertLevel, sError, CFSTR("OK") ); + ShowAlert( kCFUserNotificationStopAlertLevel, sError.c_str(), CFSTR("OK") ); } Dialog::Result DialogDriver_MacOSX::OKCancel( RString sMessage, RString sID ) @@ -63,7 +63,7 @@ Dialog::Result DialogDriver_MacOSX::OKCancel( RString sMessage, RString sID ) CFBundleRef bundle = CFBundleGetMainBundle(); CFStringRef sOK = LSTRING( bundle, "OK" ); CFStringRef sCancel = LSTRING( bundle, "Cancel" ); - CFOptionFlags result = ShowAlert( kCFUserNotificationNoteAlertLevel, sMessage, sOK, sCancel ); + CFOptionFlags result = ShowAlert( kCFUserNotificationNoteAlertLevel, sMessage.c_str(), sOK, sCancel ); CFRelease( sOK ); CFRelease( sCancel ); @@ -85,7 +85,7 @@ Dialog::Result DialogDriver_MacOSX::AbortRetryIgnore( RString sMessage, RString CFStringRef sIgnore = LSTRING( bundle, "Ignore" ); CFStringRef sRetry = LSTRING( bundle, "Retry" ); CFStringRef sAbort = LSTRING( bundle, "Abort" ); - CFOptionFlags result = ShowAlert( kCFUserNotificationNoteAlertLevel, sMessage, sIgnore, sRetry, sAbort ); + CFOptionFlags result = ShowAlert( kCFUserNotificationNoteAlertLevel, sMessage.c_str(), sIgnore, sRetry, sAbort ); CFRelease( sIgnore ); CFRelease( sRetry ); @@ -110,7 +110,7 @@ Dialog::Result DialogDriver_MacOSX::AbortRetry( RString sMessage, RString sID ) CFBundleRef bundle = CFBundleGetMainBundle(); CFStringRef sRetry = LSTRING( bundle, "Retry" ); CFStringRef sAbort = LSTRING( bundle, "Abort" ); - CFOptionFlags result = ShowAlert( kCFUserNotificationNoteAlertLevel, sMessage, sRetry, sAbort ); + CFOptionFlags result = ShowAlert( kCFUserNotificationNoteAlertLevel, sMessage.c_str(), sRetry, sAbort ); CFRelease( sRetry ); CFRelease( sAbort ); @@ -131,7 +131,7 @@ Dialog::Result DialogDriver_MacOSX::YesNo( RString sMessage, RString sID ) CFBundleRef bundle = CFBundleGetMainBundle(); CFStringRef sYes = LSTRING( bundle, "Yes" ); CFStringRef sNo = LSTRING( bundle, "No" ); - CFOptionFlags result = ShowAlert( kCFUserNotificationNoteAlertLevel, sMessage, sYes, sNo ); + CFOptionFlags result = ShowAlert( kCFUserNotificationNoteAlertLevel, sMessage.c_str(), sYes, sNo ); CFRelease( sYes ); CFRelease( sNo ); diff --git a/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm b/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm index 35c990fdb4..47aaf916fd 100644 --- a/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm +++ b/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm @@ -325,7 +325,7 @@ void *LowLevelWindow_MacOSX::GetProcAddress( RString s ) { // http://developer.apple.com/qa/qa2001/qa1188.html // Both functions mentioned in there are deprecated in 10.4. - const RString& symbolName( '_' + s ); + const RString& symbolName( '_' + s.c_str() ); const uint32_t count = _dyld_image_count(); NSSymbol symbol = nil; const uint32_t options = NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR; diff --git a/src/arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.cpp b/src/arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.cpp index f18e5fd116..0a29ea3df7 100644 --- a/src/arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.cpp +++ b/src/arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.cpp @@ -160,7 +160,7 @@ void MemoryCardDriverThreaded_MacOSX::GetUSBStorageDevices( std::vectorsOsMountDir, W_OK) ) + if( access(pDevice->sOsMountDir.c_str(), W_OK) ) { pDevice->SetError( "TestFailed" ); return false; diff --git a/src/archutils/Darwin/Crash.h b/src/archutils/Darwin/Crash.h index 8dcd37f66c..e6f6f68db3 100644 --- a/src/archutils/Darwin/Crash.h +++ b/src/archutils/Darwin/Crash.h @@ -1,10 +1,11 @@ #ifndef DARWIN_CRASH_H #define DARWIN_CRASH_H +#include namespace CrashHandler { - RString GetLogsDirectory(); - void InformUserOfCrash( const RString& sPath ); + std::string GetLogsDirectory(); + void InformUserOfCrash( const std::string& sPath ); bool IsDebuggerPresent(); void DebugBreak(); } diff --git a/src/archutils/Darwin/Crash.mm b/src/archutils/Darwin/Crash.mm index e00d718176..565622a5ae 100644 --- a/src/archutils/Darwin/Crash.mm +++ b/src/archutils/Darwin/Crash.mm @@ -4,6 +4,7 @@ #include "arch/ArchHooks/ArchHooks.h" #include +#include #include #include @@ -15,20 +16,21 @@ #import -RString CrashHandler::GetLogsDirectory() +std::string CrashHandler::GetLogsDirectory() { NSFileManager *fileManager = [NSFileManager defaultManager]; NSURL *url = [fileManager URLForDirectory:NSLibraryDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; if (url == nil) return "/tmp"; - return RString([url fileSystemRepresentation]) + "/Logs/" PRODUCT_ID; + RString path= RString([url fileSystemRepresentation]) + "/Logs/" PRODUCT_ID; + return std::string(path.c_str()); } // XXX Can we use LocalizedString here instead? #define LSTRING(b,x) CFBundleCopyLocalizedString( (b), CFSTR(x), nullptr, CFSTR("Localizable") ) -void CrashHandler::InformUserOfCrash( const RString& sPath ) +void CrashHandler::InformUserOfCrash( const std::string& sPath ) { CFBundleRef bundle = CFBundleGetMainBundle(); CFStringRef sAlternate = LSTRING( bundle, "Quit " PRODUCT_FAMILY ); diff --git a/src/archutils/Darwin/DarwinThreadHelpers.cpp b/src/archutils/Darwin/DarwinThreadHelpers.cpp index e3cb341fc5..6e65114d9e 100644 --- a/src/archutils/Darwin/DarwinThreadHelpers.cpp +++ b/src/archutils/Darwin/DarwinThreadHelpers.cpp @@ -59,7 +59,7 @@ bool GetThreadBacktraceContext( uint64_t iID, BacktraceContext *ctx ) #endif } -RString SetThreadPrecedence( float prec ) +const char* SetThreadPrecedence( float prec ) { // Real values are between 0 and 63. DEBUG_ASSERT( 0.0f <= prec && prec <= 1.0f ); @@ -69,7 +69,7 @@ RString SetThreadPrecedence( float prec ) if( ret != KERN_SUCCESS ) return mach_error_string( ret ); - return RString(); + return ""; } /* diff --git a/src/archutils/Darwin/DarwinThreadHelpers.h b/src/archutils/Darwin/DarwinThreadHelpers.h index 403bfa93b4..48e0d37c58 100644 --- a/src/archutils/Darwin/DarwinThreadHelpers.h +++ b/src/archutils/Darwin/DarwinThreadHelpers.h @@ -23,7 +23,7 @@ uint64_t GetCurrentThreadId(); * Valid values for the thread are from 0.0f to 1.0f. * 0.5f is the default. * @param prec the precedence to set. */ -RString SetThreadPrecedence( float prec ); +const char* SetThreadPrecedence( float prec ); #endif diff --git a/src/archutils/Darwin/HIDDevice.h b/src/archutils/Darwin/HIDDevice.h index 204c4ab4a1..ccea51e042 100644 --- a/src/archutils/Darwin/HIDDevice.h +++ b/src/archutils/Darwin/HIDDevice.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -72,7 +73,7 @@ private: IOHIDDeviceInterface **m_Interface; IOHIDQueueInterface **m_Queue; bool m_bRunning; - RString m_sDescription; + std::string m_sDescription; static void AddLogicalDevice( const void *value, void *context ); static void AddElement( const void *value, void *context ); @@ -112,7 +113,7 @@ public: bool Open( io_object_t device ); void StartQueue( CFRunLoopRef loopRef, IOHIDCallbackFunction callback, void *target ); - inline const RString& GetDescription() const { return m_sDescription; } + inline const std::string& GetDescription() const { return m_sDescription; } /* Add button presses (or releases) to vPresses for the given cookie. More * than one DeviceInput can be added at a time. For example, Two axes diff --git a/src/archutils/Darwin/SpecialDirs.h b/src/archutils/Darwin/SpecialDirs.h index d4576e1241..7e3d58abee 100644 --- a/src/archutils/Darwin/SpecialDirs.h +++ b/src/archutils/Darwin/SpecialDirs.h @@ -1,9 +1,11 @@ #ifndef SPECIAL_DIRS_H #define SPECIAL_DIRS_H +#include + namespace SpecialDirs { - RString GetDesktopDir(); + std::string GetDesktopDir(); }; #endif diff --git a/src/archutils/Darwin/SpecialDirs.mm b/src/archutils/Darwin/SpecialDirs.mm index f013747cac..b8c3fcbc33 100644 --- a/src/archutils/Darwin/SpecialDirs.mm +++ b/src/archutils/Darwin/SpecialDirs.mm @@ -2,16 +2,18 @@ #include "SpecialDirs.h" #include "ProductInfo.h" +#include + #import -RString SpecialDirs::GetDesktopDir() +std::string SpecialDirs::GetDesktopDir() { NSFileManager *fileManager = [NSFileManager defaultManager]; NSURL *url = [fileManager URLForDirectory:NSDesktopDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; if (url == nil) return "/tmp"; - return RString([url fileSystemRepresentation]) + "/" PRODUCT_ID; + return std::string([url fileSystemRepresentation]) + "/" PRODUCT_ID; }