Skip to content

Commit

Permalink
Now reporting 64-bit capability of the host system.
Browse files Browse the repository at this point in the history
Showing GHz to the user instead of MHz for the clock speed reading.
  • Loading branch information
andymatuschak committed Jul 5, 2008
2 parents c3f2c69 + 918217f commit 44a5473
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
16 changes: 14 additions & 2 deletions SUSystemProfiler.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,24 @@ - (NSMutableArray *)systemProfileArrayForHostBundle:(NSBundle *)hostBundle
}
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cputype",@"CPU Type", [NSNumber numberWithInt:value], visibleCPUType,nil] forKeys:profileDictKeys]];
}
error = sysctlbyname("hw.cpu64bit_capable", &value, &length, NULL, 0);
if(error != 0)
error = sysctlbyname("hw.optional.x86_64", &value, &length, NULL, 0); //x86 specific
if(error != 0)
error = sysctlbyname("hw.optional.64bitops", &value, &length, NULL, 0); //PPC specific

BOOL is64bit = NO;

if (error == 0) {
is64bit = value == 1;
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpu64bit", @"CPU is 64-Bit?", [NSNumber numberWithBool:is64bit], is64bit ? @"Yes" : @"No", nil] forKeys:profileDictKeys]];
}
error = sysctlbyname("hw.cpusubtype", &value, &length, NULL, 0);
if (error == 0) {
NSString *visibleCPUSubType;
if (cpuType == 7) {
// Intel
visibleCPUSubType = @"Intel"; // If anyone knows how to tell a Core Duo from a Core Solo, please email [email protected]
visibleCPUSubType = is64bit ? @"Intel Core 2" : @"Intel Core"; // If anyone knows how to tell a Core Duo from a Core Solo, please email [email protected]
} else if (cpuType == 18) {
// PowerPC
switch(value) {
Expand Down Expand Up @@ -116,7 +128,7 @@ - (NSMutableArray *)systemProfileArrayForHostBundle:(NSBundle *)hostBundle
SInt32 gestaltInfo;
err = Gestalt(gestaltProcClkSpeedMHz,&gestaltInfo);
if (err == noErr)
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpuFreqMHz",@"CPU Speed (MHz)", [NSNumber numberWithInt:gestaltInfo], [NSNumber numberWithInt:gestaltInfo],nil] forKeys:profileDictKeys]];
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpuFreqMHz",@"CPU Speed (GHz)", [NSNumber numberWithInt:gestaltInfo], [NSNumber numberWithDouble:gestaltInfo/1000.0],nil] forKeys:profileDictKeys]];

// amount of RAM
err = Gestalt(gestaltPhysicalRAMSizeInMegabytes,&gestaltInfo);
Expand Down
1 change: 1 addition & 0 deletions SUUpdater.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ - (void)checkForUpdatesWithDriver:(SUUpdateDriver *)d

driver = [d retain];
if ([driver delegate] == nil) { [driver setDelegate:delegate]; }
NSLog(@"Checking %@", [self feedURL]);
[driver checkForUpdatesAtURL:[self feedURL] hostBundle:hostBundle];
}

Expand Down
6 changes: 3 additions & 3 deletions en.lproj/SUUpdatePermissionPrompt.nib/info.nib

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified en.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib
Binary file not shown.

0 comments on commit 44a5473

Please sign in to comment.