Simplify some code, style changes

This commit is contained in:
Maximilian Irlinger 2014-09-19 07:19:42 +02:00
parent 4ee413bc35
commit 72c79d1a6d

View File

@ -71,7 +71,7 @@ void prefs_exit()
{
DiskType *d = (DiskType*)[diskArray objectAtIndex:row];
if([[col identifier] isEqualTo:@"isCDROMcol"]) {
if ([[col identifier] isEqualTo:@"isCDROMcol"]) {
return [NSString stringWithFormat:@"%d", [d isCDROM]];
}
@ -260,12 +260,7 @@ static NSString *makeRelativeIfNecessary(NSString *path)
DiskType *d = [[DiskType alloc] init];
[d setPath:makeRelativeIfNecessary([open filename])];
if([isCDROMcheckbox state] == NSOnState) {
[d setIsCDROM:YES];
}
else {
[d setIsCDROM:NO];
}
[d setIsCDROM:([isCDROMcheckbox state] == NSOnState)];
[diskArray addObject: d];
[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]);
int ret = system(cmd);
if (ret == 0) {
DiskType *d=[[DiskType alloc] init];
DiskType *d = [[DiskType alloc] init];
[d setPath:makeRelativeIfNecessary([save filename])];
[d setIsCDROM:NO];