mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Fixed typo in JoystickImpl.cpp to prevent crash on OS X
This commit is contained in:
parent
b7c0af3a58
commit
8a8793e00c
@ -53,7 +53,7 @@ namespace
|
||||
std::string getDeviceString(IOHIDDeviceRef ref, CFStringRef prop, unsigned int index)
|
||||
{
|
||||
CFTypeRef typeRef = IOHIDDeviceGetProperty(ref, prop);
|
||||
if (ref && (CFGetTypeID(typeRef) == CFStringGetTypeID()))
|
||||
if (typeRef && (CFGetTypeID(typeRef) == CFStringGetTypeID()))
|
||||
{
|
||||
CFStringRef str = static_cast<CFStringRef>(typeRef);
|
||||
return stringFromCFString(str);
|
||||
@ -68,7 +68,7 @@ namespace
|
||||
unsigned int getDeviceUint(IOHIDDeviceRef ref, CFStringRef prop, unsigned int index)
|
||||
{
|
||||
CFTypeRef typeRef = IOHIDDeviceGetProperty(ref, prop);
|
||||
if (ref && (CFGetTypeID(typeRef) == CFNumberGetTypeID()))
|
||||
if (typeRef && (CFGetTypeID(typeRef) == CFNumberGetTypeID()))
|
||||
{
|
||||
SInt32 value;
|
||||
CFNumberGetValue((CFNumberRef)typeRef, kCFNumberSInt32Type, &value);
|
||||
|
Loading…
Reference in New Issue
Block a user