mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-02-19 19:30:42 +00:00
Simplify some code, style changes
This commit is contained in:
parent
4ee413bc35
commit
72c79d1a6d
@ -71,7 +71,7 @@ void prefs_exit()
|
|||||||
{
|
{
|
||||||
DiskType *d = (DiskType*)[diskArray objectAtIndex:row];
|
DiskType *d = (DiskType*)[diskArray objectAtIndex:row];
|
||||||
|
|
||||||
if([[col identifier] isEqualTo:@"isCDROMcol"]) {
|
if ([[col identifier] isEqualTo:@"isCDROMcol"]) {
|
||||||
return [NSString stringWithFormat:@"%d", [d isCDROM]];
|
return [NSString stringWithFormat:@"%d", [d isCDROM]];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,12 +260,7 @@ static NSString *makeRelativeIfNecessary(NSString *path)
|
|||||||
DiskType *d = [[DiskType alloc] init];
|
DiskType *d = [[DiskType alloc] init];
|
||||||
[d setPath:makeRelativeIfNecessary([open filename])];
|
[d setPath:makeRelativeIfNecessary([open filename])];
|
||||||
|
|
||||||
if([isCDROMcheckbox state] == NSOnState) {
|
[d setIsCDROM:([isCDROMcheckbox state] == NSOnState)];
|
||||||
[d setIsCDROM:YES];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
[d setIsCDROM:NO];
|
|
||||||
}
|
|
||||||
|
|
||||||
[diskArray addObject: d];
|
[diskArray addObject: d];
|
||||||
[disks reloadData];
|
[disks reloadData];
|
||||||
@ -303,7 +298,7 @@ static NSString *makeRelativeIfNecessary(NSString *path)
|
|||||||
snprintf(cmd, sizeof(cmd), "dd if=/dev/zero \"of=%s\" bs=1024k count=%d", [[save filename] UTF8String], [diskSaveSizeField intValue]);
|
snprintf(cmd, sizeof(cmd), "dd if=/dev/zero \"of=%s\" bs=1024k count=%d", [[save filename] UTF8String], [diskSaveSizeField intValue]);
|
||||||
int ret = system(cmd);
|
int ret = system(cmd);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
DiskType *d=[[DiskType alloc] init];
|
DiskType *d = [[DiskType alloc] init];
|
||||||
[d setPath:makeRelativeIfNecessary([save filename])];
|
[d setPath:makeRelativeIfNecessary([save filename])];
|
||||||
[d setIsCDROM:NO];
|
[d setIsCDROM:NO];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user