1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

OP-958: fix cast.

I am about to check-in something that I have not compiled :(
Will check build server to make sure it pass build and revert if needed.
This commit is contained in:
Mathieu Rondonneau 2013-05-23 19:33:54 -07:00
parent 1d0c18ebcd
commit ccc7e4a0ab

View File

@ -230,12 +230,12 @@ static bool HID_GetIntProperty(IOHIDDeviceRef dev, CFStringRef property, int *va
*/
static bool HID_GetStrProperty(IOHIDDeviceRef dev, CFStringRef property, QString & value)
{
CFTypeRef prop = IOHIDDeviceGetProperty(dev, property);
CFStringRef prop = static_cast<CFStringRef>(IOHIDDeviceGetProperty(dev, property));
if (prop) {
if (CFStringGetTypeID() == CFGetTypeID(prop)) { // if a string
char buffer[2550];
bool success = CFStringGetCString((CFStringRef)prop, buffer, sizeof(buffer), kCFStringEncodingMacRoman);
bool success = CFStringGetCString(prop, buffer, sizeof(buffer), kCFStringEncodingMacRoman);
value = QString(buffer);
return success;
}