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
+4 -4
View File
@@ -24,7 +24,7 @@ RString CrashHandler::GetLogsDirectory()
}
// XXX Can we use LocalizedString here instead?
#define LSTRING(b,x) CFBundleCopyLocalizedString( (b), CFSTR(x), NULL, CFSTR("Localizable") )
#define LSTRING(b,x) CFBundleCopyLocalizedString( (b), CFSTR(x), nullptr, CFSTR("Localizable") )
void CrashHandler::InformUserOfCrash( const RString& sPath )
{
@@ -41,12 +41,12 @@ void CrashHandler::InformUserOfCrash( const RString& sPath )
CFStringRef sFormat = LSTRING( bundle, PRODUCT_FAMILY " has crashed. "
"Debugging information has been output to\n\n%s\n\n"
"Please file a bug report at\n\n%s" );
CFStringRef sBody = CFStringCreateWithFormat( kCFAllocatorDefault, NULL, sFormat,
CFStringRef sBody = CFStringCreateWithFormat( kCFAllocatorDefault, nullptr, sFormat,
sPath.c_str(), REPORT_BUG_URL );
CFOptionFlags response = kCFUserNotificationCancelResponse;
CFTimeInterval timeout = 0.0; // Should we ever time out?
CFUserNotificationDisplayAlert( timeout, kCFUserNotificationStopAlertLevel, NULL, NULL, NULL,
CFUserNotificationDisplayAlert( timeout, kCFUserNotificationStopAlertLevel, nullptr, nullptr, nullptr,
sTitle, sBody, sDefault, sAlternate, sOther, &response );
switch( response )
@@ -86,7 +86,7 @@ bool CrashHandler::IsDebuggerPresent()
// Call sysctl.
size = sizeof( info );
ret = sysctl( mib, sizeof(mib)/sizeof(*mib), &info, &size, NULL, 0 );
ret = sysctl( mib, sizeof(mib)/sizeof(*mib), &info, &size, nullptr, 0 );
// We're being debugged if the P_TRACED flag is set.
+5 -5
View File
@@ -2,7 +2,7 @@
#include "HIDDevice.h"
#include "RageUtil.h"
HIDDevice::HIDDevice() : m_Interface( NULL ), m_Queue( NULL ), m_bRunning( false )
HIDDevice::HIDDevice() : m_Interface(nullptr), m_Queue(nullptr), m_bRunning( false )
{
}
@@ -108,7 +108,7 @@ bool HIDDevice::Open( io_object_t device )
if( hresult != S_OK )
{
LOG->Warn( "Couldn't get device interface from plugin interface." );
m_Interface = NULL;
m_Interface = nullptr;
return false;
}
@@ -117,7 +117,7 @@ bool HIDDevice::Open( io_object_t device )
{
PrintIOErr( ret, "Failed to open the interface." );
CALL( m_Interface, Release );
m_Interface = NULL;
m_Interface = nullptr;
return false;
}
@@ -133,9 +133,9 @@ bool HIDDevice::Open( io_object_t device )
{
PrintIOErr( ret, "Failed to create the queue." );
CALL( m_Queue, Release );
m_Queue = NULL;
m_Queue = nullptr;
CALL( m_Interface, Release );
m_Interface = NULL;
m_Interface = nullptr;
return false;
}
+1 -1
View File
@@ -101,7 +101,7 @@ protected:
// Perform a synchronous set report on the HID interface.
inline IOReturn SetReport( IOHIDReportType type, UInt32 reportID, void *buffer, UInt32 size, UInt32 timeoutMS )
{
return CALL( m_Interface, setReport, type, reportID, buffer, size, timeoutMS, NULL, NULL, NULL );
return CALL( m_Interface, setReport, type, reportID, buffer, size, timeoutMS, nullptr, nullptr, nullptr );
}
public:
HIDDevice();
+5 -9
View File
@@ -1,7 +1,6 @@
#include "global.h"
#include "JoystickDevice.h"
#include "RageLog.h"
#include "Foreach.h"
using __gnu_cxx::hash_map;
@@ -128,9 +127,8 @@ void JoystickDevice::AddElement( int usagePage, int usage, IOHIDElementCookie co
void JoystickDevice::Open()
{
// Add elements to the queue for each Joystick
FOREACH_CONST( Joystick, m_vSticks, i )
for (Joystick const &js : m_vSticks)
{
const Joystick& js = *i;
#define ADD(x) if( js.x ) AddElementToQueue( js.x )
ADD( x_axis ); ADD( y_axis ); ADD( z_axis );
ADD( x_rot ); ADD( y_rot ); ADD( z_rot );
@@ -156,10 +154,8 @@ bool JoystickDevice::InitDevice( int vid, int pid )
void JoystickDevice::GetButtonPresses( vector<DeviceInput>& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const
{
FOREACH_CONST( Joystick, m_vSticks, i )
for (Joystick const &js : m_vSticks)
{
const Joystick& js = *i;
if( js.x_axis == cookie )
{
float level = SCALE( value, js.x_min, js.x_max, -1.0f, 1.0f );
@@ -251,7 +247,7 @@ int JoystickDevice::AssignIDs( InputDevice startID )
{
if( !IsJoystick(startID) )
return -1;
FOREACH( Joystick, m_vSticks, i )
for (auto i = m_vSticks.begin(); i != m_vSticks.end(); ++i)
{
if( !IsJoystick(startID) )
{
@@ -266,8 +262,8 @@ int JoystickDevice::AssignIDs( InputDevice startID )
void JoystickDevice::GetDevicesAndDescriptions( vector<InputDeviceInfo>& vDevices ) const
{
FOREACH_CONST( Joystick, m_vSticks, i )
vDevices.push_back( InputDeviceInfo(i->id,GetDescription()) );
for (auto &i : m_vSticks)
vDevices.push_back( InputDeviceInfo(i.id,GetDescription()) );
}
/*
+2 -2
View File
@@ -191,8 +191,8 @@ static void SetupMenus( void )
[item setKeyEquivalentModifierMask:NSAlternateKeyMask]; // opt-enter
[windowMenu addItem:item];
[[mainMenu addItemWithTitle:[appMenu title] action:NULL keyEquivalent:@""] setSubmenu:appMenu];
[[mainMenu addItemWithTitle:[windowMenu title] action:NULL keyEquivalent:@""] setSubmenu:windowMenu];
[[mainMenu addItemWithTitle:[appMenu title] action:nil keyEquivalent:@""] setSubmenu:appMenu];
[[mainMenu addItemWithTitle:[windowMenu title] action:nil keyEquivalent:@""] setSubmenu:windowMenu];
[NSApp setMainMenu:mainMenu];
[NSApp setAppleMenu:appMenu]; // This isn't the apple menu, but it doesn't work without this.
+1 -1
View File
@@ -10,7 +10,7 @@ bool Vector::CheckForVector()
int32_t result = 0;
size_t size = 4;
return !sysctlbyname( "hw.vectorunit", &result, &size, NULL, 0 ) && result;
return !sysctlbyname( "hw.vectorunit", &result, &size, nullptr, 0 ) && result;
}
/* for( unsigned pos = 0; pos < size; ++pos )