Changeset 28
- Timestamp:
- 12/03/04 08:15:10 (4 years ago)
- Files:
-
- trunk/AgentController.m (modified) (11 diffs)
- trunk/Controller.m (modified) (18 diffs)
- trunk/Libs/SSHAgent.m (modified) (23 diffs)
- trunk/Libs/SSHKey.m (modified) (2 diffs)
- trunk/Libs/SSHKeychain.m (modified) (11 diffs)
- trunk/Libs/SSHTool.m (modified) (1 diff)
- trunk/Libs/SSHTunnel.m (modified) (6 diffs)
- trunk/PassphraseRequester.m (modified) (3 diffs)
- trunk/PreferenceController.m (modified) (3 diffs)
- trunk/PreferenceViews/DisplayView.m (modified) (1 diff)
- trunk/PreferenceViews/EnvironmentView.m (modified) (2 diffs)
- trunk/PreferenceViews/KeysView.m (modified) (5 diffs)
- trunk/PreferenceViews/TunnelsView.m (modified) (2 diffs)
- trunk/TODO (modified) (1 diff)
- trunk/TunnelController.m (modified) (5 diffs)
- trunk/UpdateController.m (modified) (2 diffs)
- trunk/main.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/AgentController.m
r17 r28 23 23 if(!(self = [super init])) 24 24 { 25 return NULL;25 return nil; 26 26 } 27 27 … … 97 97 98 98 SecKeychainStatus status; 99 SecKeychainGetStatus( NULL, &status);99 SecKeychainGetStatus(nil, &status); 100 100 101 101 agent = [SSHAgent currentAgent]; … … 139 139 [allKeysOnAgentLock unlock]; 140 140 141 SecKeychainGetStatus( NULL, &status);141 SecKeychainGetStatus(nil, &status); 142 142 143 143 if((status & 1) && ([agent isRunning])) … … 175 175 if([[notification name] isEqualToString:@"SKSleep"]) 176 176 { 177 sleep_timestamp = time( NULL);177 sleep_timestamp = time(nil); 178 178 } 179 179 … … 185 185 */ 186 186 187 if((time( NULL) - (minutes * 60)) > sleep_timestamp)187 if((time(nil) - (minutes * 60)) > sleep_timestamp) 188 188 { 189 189 [self removeKeysFromAgent:nil]; … … 225 225 [allKeysOnAgentLock unlock]; 226 226 227 SecKeychainGetStatus( NULL, &status);227 SecKeychainGetStatus(nil, &status); 228 228 229 229 if((status & 1) && ([agent isRunning])) … … 337 337 [[Controller sharedController] setStatus:NO]; 338 338 339 SecKeychainGetStatus( NULL, &status);339 SecKeychainGetStatus(nil, &status); 340 340 341 341 if((([[NSUserDefaults standardUserDefaults] integerForKey:followKeychainString] == 3) … … 657 657 } 658 658 659 return NULL;659 return nil; 660 660 } 661 661 … … 670 670 { 671 671 if(thread == YES) { 672 id UI = [NSConnection rootProxyForConnectionWithRegisteredName:@"SSHKeychain" host: NULL];673 674 if(UI == NULL) {672 id UI = [NSConnection rootProxyForConnectionWithRegisteredName:@"SSHKeychain" host:nil]; 673 674 if(UI == nil) { 675 675 NSLog(@"Can't connect to UI to post warning"); 676 676 } … … 713 713 theOutput = [[[NSString alloc] initWithData:[[thePipe fileHandleForReading] readDataToEndOfFile] encoding:NSASCIIStringEncoding] autorelease]; 714 714 715 if(strstr([theOutput cString], "ScreenSaverEngine.app") != NULL)715 if(strstr([theOutput cString], "ScreenSaverEngine.app") != nil) 716 716 { 717 717 if((([[NSUserDefaults standardUserDefaults] integerForKey:onScreensaverString] == 2) … … 742 742 BOOL isDirectory; 743 743 744 if(path == NULL)744 if(path == nil) 745 745 { 746 746 [self warningPanelWithTitle:local(@"AgentNotStarted") andMessage:local(@"InternalInconsistency")]; trunk/Controller.m
r17 r28 35 35 if(!(self = [super init])) 36 36 { 37 return NULL;37 return nil; 38 38 } 39 39 … … 84 84 dict = [[[NSMutableDictionary alloc] initWithContentsOfFile:path] autorelease]; 85 85 86 if(dict == NULL)86 if(dict == nil) 87 87 { 88 88 dict = [NSMutableDictionary dictionary]; … … 103 103 /* Change the bundle's modification time to let LaunchServices know we've 104 104 * changed something. */ 105 if(utime([[[NSBundle mainBundle] bundlePath] cString], NULL) == -1)105 if(utime([[[NSBundle mainBundle] bundlePath] cString], nil) == -1) 106 106 { 107 107 NSLog(@"DEBUG: utime on bundlePath failed."); … … 126 126 /* Change the bundle's modification time to let LaunchServices know we've 127 127 * changed something. */ 128 if(utime([[[NSBundle mainBundle] bundlePath] cString], NULL) == -1)128 if(utime([[[NSBundle mainBundle] bundlePath] cString], nil) == -1) 129 129 { 130 130 NSLog(@"DEBUG: utime on bundlePath failed."); … … 209 209 210 210 SecKeychainStatus status; 211 SecKeychainGetStatus( NULL, &status);211 SecKeychainGetStatus(nil, &status); 212 212 213 213 if(status & 1) … … 257 257 258 258 /* If ~/.MacOSX/environment.plist doesn't exists, make a new dictionary. */ 259 if((dict = [[[NSMutableDictionary alloc] initWithContentsOfFile:path] autorelease]) == NULL)259 if((dict = [[[NSMutableDictionary alloc] initWithContentsOfFile:path] autorelease]) == nil) 260 260 { 261 261 dict = [NSMutableDictionary dictionary]; 262 262 } 263 263 264 if([dict objectForKey:@"SSH_AUTH_SOCK"] == NULL)264 if([dict objectForKey:@"SSH_AUTH_SOCK"] == nil) 265 265 { 266 266 [dict setObject:socketPath forKey:@"SSH_AUTH_SOCK"]; … … 325 325 { 326 326 [appleKeychainUnlockedLock unlock]; 327 SecKeychainLock( NULL);327 SecKeychainLock(nil); 328 328 } 329 329 … … 339 339 340 340 [NSApp activateIgnoringOtherApps:YES]; 341 SecKeychainUnlock( NULL, 0, NULL, 0);341 SecKeychainUnlock(nil, 0, nil, 0); 342 342 343 343 if(giveFocusBack) … … 372 372 { 373 373 [passphraseIsRequestedLock unlock]; 374 return NULL;374 return nil; 375 375 } 376 376 … … 387 387 serviceName = "SSHKeychain"; 388 388 389 SecKeychainGetStatus( NULL, &status);389 SecKeychainGetStatus(nil, &status); 390 390 391 391 [appleKeychainUnlockedLock lock]; … … 404 404 [appleKeychainUnlockedLock unlock]; 405 405 406 status = SecKeychainFindGenericPassword( NULL, strlen(serviceName), serviceName, strlen(accountName), accountName, &passwordLength, (void **)&kcPassword, NULL);406 status = SecKeychainFindGenericPassword(nil, strlen(serviceName), serviceName, strlen(accountName), accountName, &passwordLength, (void **)&kcPassword, nil); 407 407 408 408 if(giveFocusBack) … … 445 445 446 446 /* Display a passphrase request notification. */ 447 notification = CFUserNotificationCreate( NULL, 30, CFUserNotificationSecureTextField(0), &error, (CFDictionaryRef)dict);448 449 /* If there was an error, return NULL. */447 notification = CFUserNotificationCreate(nil, 30, CFUserNotificationSecureTextField(0), &error, (CFDictionaryRef)dict); 448 449 /* If there was an error, return nil. */ 450 450 if(error) 451 451 { … … 453 453 passphraseIsRequested = NO; 454 454 [passphraseIsRequestedLock unlock]; 455 return NULL;456 } 457 458 /* If we couldn't receive a response, return NULL. */455 return nil; 456 } 457 458 /* If we couldn't receive a response, return nil. */ 459 459 if(CFUserNotificationReceiveResponse(notification, 0, &response)) 460 460 { … … 462 462 passphraseIsRequested = NO; 463 463 [passphraseIsRequestedLock unlock]; 464 return NULL;465 } 466 467 /* If OK wasn't pressed, return NULL. */464 return nil; 465 } 466 467 /* If OK wasn't pressed, return nil. */ 468 468 if((response & 0x3) != kCFUserNotificationDefaultResponse) 469 469 { … … 471 471 passphraseIsRequested = NO; 472 472 [passphraseIsRequestedLock unlock]; 473 return NULL;473 return nil; 474 474 } 475 475 … … 477 477 enteredPassphrase = CFUserNotificationGetResponseValue(notification, kCFUserNotificationTextFieldValuesKey, 0); 478 478 479 if(enteredPassphrase != NULL)479 if(enteredPassphrase != nil) 480 480 { 481 481 passphrase = [NSString stringWithString:(NSString *)enteredPassphrase]; … … 502 502 [appleKeychainUnlockedLock unlock]; 503 503 504 SecKeychainAddGenericPassword( NULL, strlen(serviceName), serviceName, strlen(accountName), accountName, [passphrase length], (const void *)[passphrase cString], NULL);504 SecKeychainAddGenericPassword(nil, strlen(serviceName), serviceName, strlen(accountName), accountName, [passphrase length], (const void *)[passphrase cString], nil); 505 505 506 506 if(giveFocusBack) … … 524 524 [passphraseIsRequestedLock unlock]; 525 525 526 return NULL;526 return nil; 527 527 } 528 528 trunk/Libs/SSHAgent.m
r3 r28 26 26 + (id)currentAgent 27 27 { 28 if(currentAgent == NULL)28 if(currentAgent == nil) 29 29 { 30 30 currentAgent = [[SSHAgent alloc] init]; … … 36 36 - (id)init 37 37 { 38 if((self = [super init]) == NULL)39 { 40 return NULL;38 if((self = [super init]) == nil) 39 { 40 return nil; 41 41 } 42 42 … … 63 63 - (void)dealloc 64 64 { 65 currentAgent = NULL;65 currentAgent = nil; 66 66 67 67 [socketPathLock dealloc]; … … 86 86 87 87 /* We don't use the socketPath method here, since we've just locked socketPathLock. */ 88 if(socketPath != NULL)88 if(socketPath != nil) 89 89 { 90 90 [socketPath release]; 91 socketPath = NULL;91 socketPath = nil; 92 92 } 93 93 … … 101 101 - (NSString *)socketPath 102 102 { 103 NSString *returnString = NULL;103 NSString *returnString = nil; 104 104 105 105 [socketPathLock lock]; … … 118 118 - (NSString *)agentSocketPath 119 119 { 120 NSString *returnString = NULL;120 NSString *returnString = nil; 121 121 122 122 [agentSocketPathLock lock]; … … 152 152 [agentSocketPathLock lock]; 153 153 [agentSocketPath release]; 154 agentSocketPath = NULL;154 agentSocketPath = nil; 155 155 [agentSocketPathLock unlock]; 156 156 } 157 157 158 158 159 if([self socketPath] == NULL)159 if([self socketPath] == nil) 160 160 { 161 161 NSLog(@"DEBUG: start: socketPath not set"); … … 170 170 theOutput = [theTool launchForStandardOutput]; 171 171 172 if(theOutput == NULL)172 if(theOutput == nil) 173 173 { 174 174 NSLog(@"ssh-agent didn't launch"); … … 202 202 203 203 /* If the PID is > 0 but the socket path isn't filled, stop the agent and return -1. */ 204 if(([self pid] > 0) && (([self agentSocketPath] == NULL) || ([agentSocketPath length] < 1)))204 if(([self pid] > 0) && (([self agentSocketPath] == nil) || ([agentSocketPath length] < 1))) 205 205 { 206 206 NSLog(@"SSHAgent start: ssh-agent didn't give the output we expected"); … … 238 238 [agentSocketPathLock lock]; 239 239 [agentSocketPath release]; 240 agentSocketPath = NULL;240 agentSocketPath = nil; 241 241 [agentSocketPathLock unlock]; 242 242 … … 249 249 [keysOnAgentLock lock]; 250 250 [keysOnAgent release]; 251 keysOnAgent = NULL;251 keysOnAgent = nil; 252 252 [keysOnAgentLock unlock]; 253 253 … … 280 280 - (NSArray *)keysOnAgent 281 281 { 282 NSArray *returnArray = NULL;282 NSArray *returnArray = nil; 283 283 284 284 [keysOnAgentLock lock]; … … 298 298 { 299 299 close(s); 300 if([[self socketPath] cString] != NULL)300 if([[self socketPath] cString] != nil) 301 301 { 302 302 unlink([[socketPath self] cString]); … … 367 367 /* Allocate space for 10 int's, to keep track of fd's in use. */ 368 368 fds = malloc(sizeof(int) * allocated); 369 if(fds == NULL)369 if(fds == nil) 370 370 { 371 371 NSLog(@"handleAgentConnections: malloc() failed"); … … 386 386 387 387 /* Run a select over all available fd's. */ 388 while((a = select(hfd + 1, &rfds, (fd_set *) 0, (fd_set *) 0, NULL)))388 while((a = select(hfd + 1, &rfds, (fd_set *) 0, (fd_set *) 0, nil))) 389 389 { 390 390 /* If a == -1 and errno == EBADF, then we're probably exiting. Stop agent to be sure and return. */ … … 413 413 fds = realloc(fds, ((sizeof(int) * allocated) * 2)); 414 414 allocated = allocated * 2; 415 if(fds == NULL)415 if(fds == nil) 416 416 { 417 417 NSLog(@"handleAgentConnections: realloc() failed"); … … 607 607 608 608 /* Display a passphrase request notification. */ 609 notification = CFUserNotificationCreate( NULL, 30, CFUserNotificationSecureTextField(0), &error, (CFDictionaryRef)dict);610 611 /* If we couldn't receive a response, return NULL. */609 notification = CFUserNotificationCreate(nil, 30, CFUserNotificationSecureTextField(0), &error, (CFDictionaryRef)dict); 610 611 /* If we couldn't receive a response, return nil. */ 612 612 if((error) || (CFUserNotificationReceiveResponse(notification, 0, &response)) 613 613 || ((response & 0x3) != kCFUserNotificationDefaultResponse)) … … 638 638 keychain = [SSHKeychain currentKeychain]; 639 639 640 if((keychain != NULL) && ([keychain count] > 0))640 if((keychain != nil) && ([keychain count] > 0)) 641 641 { 642 642 [openPanelLock lock]; … … 689 689 690 690 /* Display a passphrase request notification. */ 691 notification = CFUserNotificationCreate( NULL, 30, CFUserNotificationSecureTextField(0), &error, (CFDictionaryRef)dict);692 693 /* If we couldn't receive a response, return NULL. */691 notification = CFUserNotificationCreate(nil, 30, CFUserNotificationSecureTextField(0), &error, (CFDictionaryRef)dict); 692 693 /* If we couldn't receive a response, return nil. */ 694 694 if((error) || (CFUserNotificationReceiveResponse(notification, 0, &response))) 695 695 { … … 722 722 if([self pid] < 1) 723 723 { 724 return NULL;724 return nil; 725 725 } 726 726 … … 735 735 theOutput = [theTool launchForStandardOutput]; 736 736 737 if(theOutput == NULL)738 { 739 return NULL;737 if(theOutput == nil) 738 { 739 return nil; 740 740 } 741 741 742 742 if([theOutput isEqualToString:@"The agent has no identities.\n"]) 743 743 { 744 return NULL;744 return nil; 745 745 } 746 746 … … 781 781 } 782 782 783 return NULL;783 return nil; 784 784 } 785 785 … … 795 795 } 796 796 797 keysOnAgent = NULL;797 keysOnAgent = nil; 798 798 799 799 [keysOnAgentLock unlock]; trunk/Libs/SSHKey.m
r3 r28 16 16 NSArray *lines; 17 17 18 if((self = [super init]) == NULL)18 if((self = [super init]) == nil) 19 19 { 20 return NULL;20 return nil; 21 21 } 22 22 … … 64 64 else 65 65 { 66 return NULL;66 return nil; 67 67 } 68 68 } trunk/Libs/SSHKeychain.m
r3 r28 11 11 + (id)currentKeychain 12 12 { 13 if(currentKeychain == NULL)13 if(currentKeychain == nil) 14 14 { 15 15 [self keychainWithPaths:[[NSUserDefaults standardUserDefaults] arrayForKey:@"Keys"]]; … … 29 29 SSHKey *theKey; 30 30 31 if((self = [super init]) == NULL)32 { 33 return NULL;31 if((self = [super init]) == nil) 32 { 33 return nil; 34 34 } 35 35 … … 43 43 /* If the key is valid, add it to the keychain array. */ 44 44 theKey = [SSHKey keyWithPath:[paths objectAtIndex:i]]; 45 if(theKey != NULL)45 if(theKey != nil) 46 46 { 47 47 [keychain addObject:theKey]; … … 58 58 - (id)init 59 59 { 60 if((self = [super init]) == NULL)61 { 62 return NULL;60 if((self = [super init]) == nil) 61 { 62 return nil; 63 63 } 64 64 … … 71 71 - (void)dealloc 72 72 { 73 currentKeychain = NULL;73 currentKeychain = nil; 74 74 75 75 int i; … … 82 82 83 83 [keychain release]; 84 keychain = NULL;84 keychain = nil; 85 85 86 86 [keychainLock unlock]; … … 98 98 [keychainLock lock]; 99 99 100 if(keychain != NULL)100 if(keychain != nil) 101 101 { 102 102 [keychain release]; … … 111 111 /* If the key is valid, add it to the keychain array. */ 112 112 theKey = [SSHKey keyWithPath:[paths objectAtIndex:i]]; 113 if(theKey != NULL)113 if(theKey != nil) 114 114 { 115 115 [keychain addObject:theKey]; … … 148 148 { 149 149 [keychainLock unlock]; 150 return NULL;150 return nil; 151 151 } 152 152 … … 187 187 SSHKey *key = [SSHKey keyWithPath:path]; 188 188 189 if(key == NULL)189 if(key == nil) 190 190 { 191 191 return NO; … … 289 289 [theTool setEnvironmentVariable:@"SSH_AUTH_SOCK" withValue:agentSocketPath]; 290 290 291 if((paths != NULL) && ([paths count] > 0))291 if((paths != nil) && ([paths count] > 0)) 292 292 { 293 293 [theTool setArguments:paths]; trunk/Libs/SSHTool.m
r18 r28 98 98 if([self launchAndWait] == NO) 99 99 { 100 return NULL;100 return nil; 101 101 } 102 102 trunk/Libs/SSHTunnel.m
r26 r28 9 9 if(self = [super init]) 10 10 { 11 tunnelHost = NULL;11 tunnelHost = nil; 12 12 tunnelPort = 0; 13 tunnelUser = NULL;13 tunnelUser = nil; 14 14 15 15 localPortForwards = [[NSMutableArray alloc] init]; … … 17 17 dynamicPortForwards = [[NSMutableArray alloc] init]; 18 18 19 closeSelector = NULL;20 closeObject = NULL;21 closeInfo = NULL;19 closeSelector = nil; 20 closeObject = nil; 21 closeInfo = nil; 22 22 23 23 compression = NO; … … 150 150 else 151 151 { 152 closeInfo = NULL;152 closeInfo = nil; 153 153 } 154 154 } … … 213 213 for(i=0; i < [remotePortForwards count]; i++) 214 214 { 215 [arguments addObject:[NSString stringWithFormat:@"-L%d:%@:%d", [[[remotePortForwards objectAtIndex:i] objectAtIndex:0] intValue], 215 [arguments addObject:@"-L"]; 216 [arguments addObject:[NSString stringWithFormat:@"%d:%@:%d", [[[remotePortForwards objectAtIndex:i] objectAtIndex:0] intValue], 216 217 [[remotePortForwards objectAtIndex:i] objectAtIndex:1], 217 218 [[[remotePortForwards objectAtIndex:i] objectAtIndex:2] intValue]] … … 223 224 for(i=0; i < [dynamicPortForwards count]; i++) 224 225 { 225 [arguments addObject:[NSString stringWithFormat:@"-D%d", 226 [[dynamicPortForwards objectAtIndex:0] intValue]]]; 226 [arguments addObject:@"-D"]; 227 228 /* A bit awkward, but it makes sure a number is given. */ 229 [arguments addObject:[NSString stringWithFormat:@"%d", [[dynamicPortForwards objectAtIndex:i] intValue]]]; 227 230 } 228 231 } … … 230 233 if((tunnelPort > 0) && (tunnelPort < 65535)) 231 234 { 232 [arguments addObject:[NSString stringWithFormat:@"-p %d", tunnelPort]]; 235 [arguments addObject:@"-p"]; 236 [arguments addObject:[NSString stringWithFormat:@"%d", tunnelPort]]; 233 237 } 234 238 trunk/PassphraseRequester.m
r3 r28 14 14 pool = [[NSAutoreleasePool alloc] init]; 15 15 16 UI = [NSConnection rootProxyForConnectionWithRegisteredName:@"SSHKeychain" host: NULL];16 UI = [NSConnection rootProxyForConnectionWithRegisteredName:@"SSHKeychain" host:nil]; 17 17 18 if(UI == NULL) {18 if(UI == nil) { 19 19 fprintf(stderr, "Can't connect to SSHKeychain\n"); 20 20 [pool release]; … … 30 30 passphrase = [UI askPassphrase:[[procinfo arguments] objectAtIndex:1] withInteraction:YES]; 31 31 32 if(passphrase == NULL)32 if(passphrase == nil) 33 33 { 34 34 [pool release]; … … 41 41 passphrase = [UI askPassphrase:[[procinfo arguments] objectAtIndex:1] withInteraction:NO]; 42 42 43 if(passphrase == NULL)43 if(passphrase == nil) 44 44 { 45 45 [pool release]; trunk/PreferenceController.m
r26 r28 9 9 if(!(self = [super init])) 10 10 { 11 return NULL;11 return nil; 12 12 } 13 13 … … 15 15 16 16 [NSBundle loadNibNamed:@"Preferences" owner:sharedPreferenceController]; 17 18 blankView = [[NSView alloc] init]; 17 19 18 20 return self; 21 } 22 23 - (void)dealloc 24 { 25 [blankView dealloc]; 26 [super dealloc]; 19 27 } 20 28 … … 53 61 preferenceItemsKeys = [[NSArray arrayWithObjects:@"General", @"Display", @"SSH Keys", @"Tunnels", @"Security", @"Environment", nil] retain]; 54 62 55 blankView = [[[[NSView alloc] init] autorelease] retain];56 57 63 toolbar = [[NSToolbar alloc] initWithIdentifier:@"preferenceToolbar"]; 58 64 [toolbar setDelegate:self]; trunk/PreferenceViews/DisplayView.m
r3 r28 47 47 /* Change the bundle's modification time to let LaunchServices know we've 48 48 * changed something. */ 49 if(utime([[[NSBundle mainBundle] bundlePath] cString], NULL) == -1)49 if(utime([[[NSBundle mainBundle] bundlePath] cString], nil) == -1) 50 50 { 51 51 NSLog(@"DEBUG: utime on bundlePath failed."); trunk/PreferenceViews/EnvironmentView.m
r18 r28 12 12 13 13 environment = [[[NSMutableDictionary alloc] initWithContentsOfFile:path] autorelease]; 14 if(environment == NULL)14 if(environment == nil) 15 15 { 16 16 environment = [NSMutableDictionary dictionary]; … … 208 208 } 209 209 210 return NULL;210 return nil; 211 211 } 212 212 trunk/PreferenceViews/KeysView.m
r17 r28 76 76 paths = [keychain arrayOfPaths]; 77 77 78 if(paths != NULL)78 if(paths != nil) 79 79 { 80 80 prefs = [NSUserDefaults standardUserDefaults]; … … 98 98 /* Get a new list of paths. */ 99 99 paths = [keychain arrayOfPaths]; 100 if(paths != NULL)100 if(paths != nil) 101 101 { 102 102 /* Write the paths to the UserDefaults. */ … … 275 275 paths = [keychain arrayOfPaths]; 276 276 277 if(paths != NULL)277 if(paths != nil) 278 278 { 279 279 prefs = [NSUserDefaults standardUserDefaults]; … … 339 339 if((okFlag == YES) && ([[NSFileManager defaultManager] fileExistsAtPath:[sender filename]])) 340 340 { 341 return NULL;341 return nil; 342 342 } 343 343 … … 377 377 } 378 378 379 return NULL;379 return nil; 380 380 } 381 381 trunk/PreferenceViews/TunnelsView.m
r26 r28 23 23 24 24 if(!tunnels) { 25 tunnels = [[ [[NSMutableArray alloc] init] autorelease] retain];25 tunnels = [[NSMutableArray alloc] init]; 26 26 } 27 27 … … 64 64 if(!match) 65 65 { 66 NSMutableDictionary *dict = [[ [[NSMutableDictionary alloc] init] autorelease] retain];66 NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; 67 67 [dict setObject:@"New Tunnel" forKey:@"TunnelName"]; 68 68 trunk/TODO
r24 r28 17 17 The Early Spring Code Cleanup: 18 18 19 - [[[[foo alloc] init] autorelease] retain] is rubbish.20 19 - #define NSStrings is rubbish 21 20 - Constants should start uppercase 22 21 - Check retain/release 23 22 - Implement dealloc for all classes containing iVars 24 - NULL -> nil25 23 - Use objectEnumerator for arrays, instead of indexes 26 - Check task arguments (@"-arg", @"foo", instead of @"-arg foo")27 24 - Check for repeating code 28 25 - Move local() to a macro (http://developer.apple.com/intl/localization/tools.html) trunk/TunnelController.m
r18 r28 18 18 if(!(self = [super init])) 19 19 { 20 return NULL;20 return nil; 21 21 } 22 22 … … 60 60 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 61 61 { 62 tunnels = [[ [[NSMutableArray alloc] init] autorelease] retain];62 tunnels = [[NSMutableArray alloc] init]; 63 63 64 64 [self sync]; … … 264 264 SSHTunnel *tunnel; 265 265 266 dict = NULL;266 dict = nil; 267 267 268 268 if(!tunnels) { return; } … … 335 335 } 336 336 337 if((last_terminated) && ((time( NULL) - last_terminated) < 300))337 if((last_terminated) && ((time(nil) - last_terminated) < 300)) 338 338 { 339 339 fails_exceeded = YES; … … 343 343 else if((allKeysOnAgent) && ([output length] < 1)) 344 344 { 345 [[tunnels objectAtIndex:i] setObject:[NSNumber numberWithInt:time( NULL)] forKey:@"LastTerminated"];345 [[tunnels objectAtIndex:i] setObject:[NSNumber numberWithInt:time(nil)] forKey:@"LastTerminated"]; 346 346 [self openTunnelWithDict:[tunnels objectAtIndex:i]]; 347 347 } trunk/UpdateController.m
r17 r28 14 14 if(!(self = [super init])) 15 15 { 16 return NULL;16 &nbs
