RString no longer allows NULL. (I have no idea how it took me so long to catch this.)
This commit is contained in:
@@ -172,7 +172,8 @@ RString ArchHooks_darwin::GetMachineId() const
|
||||
|
||||
if( serial )
|
||||
{
|
||||
ret = CFStringGetCStringPtr( (CFStringRef)serial, kCFStringEncodingMacRoman );
|
||||
const char *str = CFStringGetCStringPtr( (CFStringRef)serial, CFStringGetSystemEncoding() );
|
||||
ret = str? str:"";
|
||||
CFRelease( serial );
|
||||
}
|
||||
IOObjectRelease( service );
|
||||
@@ -339,7 +340,9 @@ RString ArchHooks::GetPreferredLanguage()
|
||||
(lang = (CFStringRef)CFArrayGetValueAtIndex(languages, 0)) != NULL )
|
||||
{
|
||||
// MacRoman agrees with ASCII in the low-order 7 bits.
|
||||
ret = RString( CFStringGetCStringPtr(lang, kCFStringEncodingMacRoman), 2 );
|
||||
const char *str = CFStringGetCStringPtr( lang, kCFStringEncodingMacRoman );
|
||||
ASSERT( str );
|
||||
ret = RString( str, 2 );
|
||||
}
|
||||
|
||||
CFRelease( languages );
|
||||
|
||||
@@ -62,7 +62,10 @@ bool HIDDevice::Open( io_object_t device )
|
||||
}
|
||||
|
||||
if( object && CFGetTypeID(object) == CFStringGetTypeID() )
|
||||
m_sDescription = CFStringGetCStringPtr( CFStringRef(object), CFStringGetSystemEncoding() );
|
||||
{
|
||||
const char *str = CFStringGetCStringPtr( CFStringRef(object), CFStringGetSystemEncoding() );
|
||||
m_sDescription = str? str:"";
|
||||
}
|
||||
if( m_sDescription == "" )
|
||||
m_sDescription = ssprintf( "%04x:%04x", vid, pid );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user