mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-12 16:30:44 +00:00
Modify getCFint32() to cope with values of zero
(it was assuming 0 was an error condition)
This commit is contained in:
parent
c9563ddb5c
commit
71c4389094
@ -187,14 +187,21 @@ static void add_standard_modes(const video_depth depth)
|
||||
// Helper function to get a 32bit int from a dictionary
|
||||
static int32 getCFint32 (CFDictionaryRef dict, CFStringRef key)
|
||||
{
|
||||
int32 val = 0;
|
||||
CFNumberRef ref = CFDictionaryGetValue(dict, key);
|
||||
|
||||
if ( ref && CFNumberGetValue(ref, kCFNumberSInt32Type, &val) )
|
||||
if ( ! val )
|
||||
NSLog(@"getCFint32() - Logic error - Got a value of 0");
|
||||
if ( ref )
|
||||
{
|
||||
int32 val;
|
||||
|
||||
return val;
|
||||
if ( CFNumberGetValue(ref, kCFNumberSInt32Type, &val) )
|
||||
return val;
|
||||
else
|
||||
NSLog(@"getCFint32() - Failed to get the value %@", key);
|
||||
}
|
||||
else
|
||||
NSLog(@"getCFint32() - Failed to get a 32bit int for %@", key);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool add_CGDirectDisplay_modes()
|
||||
|
Loading…
x
Reference in New Issue
Block a user