Changeset 28

Show
Ignore:
Timestamp:
12/03/04 08:15:10 (4 years ago)
Author:
bart
Message:

Fixed a bug in dynamic ports (objectAtIndex:i instead of objectAtIndex:0 :)
Changed NULL to nil
Removed all the stupid autorelease] retain] stuff
Updated TODO

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/AgentController.m

    r17 r28  
    2323        if(!(self = [super init])) 
    2424        { 
    25                 return NULL
     25                return nil
    2626        } 
    2727 
     
    9797                 
    9898        SecKeychainStatus status; 
    99         SecKeychainGetStatus(NULL, &status); 
     99        SecKeychainGetStatus(nil, &status); 
    100100         
    101101        agent = [SSHAgent currentAgent]; 
     
    139139                [allKeysOnAgentLock unlock]; 
    140140                 
    141                 SecKeychainGetStatus(NULL, &status); 
     141                SecKeychainGetStatus(nil, &status); 
    142142                 
    143143                if((status & 1) && ([agent isRunning])) 
     
    175175                if([[notification name] isEqualToString:@"SKSleep"]) 
    176176                { 
    177                         sleep_timestamp = time(NULL);  
     177                        sleep_timestamp = time(nil);   
    178178                } 
    179179 
     
    185185                         */ 
    186186 
    187                         if((time(NULL) - (minutes * 60)) > sleep_timestamp) 
     187                        if((time(nil) - (minutes * 60)) > sleep_timestamp) 
    188188                        { 
    189189                                [self removeKeysFromAgent:nil]; 
     
    225225                [allKeysOnAgentLock unlock]; 
    226226 
    227                 SecKeychainGetStatus(NULL, &status); 
     227                SecKeychainGetStatus(nil, &status); 
    228228 
    229229                if((status & 1) && ([agent isRunning])) 
     
    337337                [[Controller sharedController] setStatus:NO]; 
    338338 
    339                 SecKeychainGetStatus(NULL, &status); 
     339                SecKeychainGetStatus(nil, &status); 
    340340 
    341341                if((([[NSUserDefaults standardUserDefaults] integerForKey:followKeychainString] == 3) 
     
    657657        } 
    658658 
    659         return NULL
     659        return nil
    660660} 
    661661 
     
    670670{ 
    671671        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) { 
    675675                        NSLog(@"Can't connect to UI to post warning"); 
    676676                } 
     
    713713                        theOutput = [[[NSString alloc] initWithData:[[thePipe fileHandleForReading] readDataToEndOfFile] encoding:NSASCIIStringEncoding] autorelease]; 
    714714         
    715                         if(strstr([theOutput cString], "ScreenSaverEngine.app") != NULL
     715                        if(strstr([theOutput cString], "ScreenSaverEngine.app") != nil
    716716                        { 
    717717                                if((([[NSUserDefaults standardUserDefaults] integerForKey:onScreensaverString] == 2) 
     
    742742        BOOL isDirectory; 
    743743 
    744         if(path == NULL
     744        if(path == nil
    745745        { 
    746746                        [self warningPanelWithTitle:local(@"AgentNotStarted") andMessage:local(@"InternalInconsistency")]; 
  • trunk/Controller.m

    r17 r28  
    3535        if(!(self = [super init])) 
    3636        { 
    37                 return NULL
     37                return nil
    3838        } 
    3939 
     
    8484        dict = [[[NSMutableDictionary alloc] initWithContentsOfFile:path] autorelease]; 
    8585                 
    86         if(dict == NULL
     86        if(dict == nil
    8787        { 
    8888                dict = [NSMutableDictionary dictionary]; 
     
    103103                        /* Change the bundle's modification time to let LaunchServices know we've 
    104104                         * changed something. */ 
    105                         if(utime([[[NSBundle mainBundle] bundlePath] cString], NULL) == -1) 
     105                        if(utime([[[NSBundle mainBundle] bundlePath] cString], nil) == -1) 
    106106                        { 
    107107                                NSLog(@"DEBUG: utime on bundlePath failed."); 
     
    126126                        /* Change the bundle's modification time to let LaunchServices know we've 
    127127                                * changed something. */ 
    128                         if(utime([[[NSBundle mainBundle] bundlePath] cString], NULL) == -1) 
     128                        if(utime([[[NSBundle mainBundle] bundlePath] cString], nil) == -1) 
    129129                        { 
    130130                                NSLog(@"DEBUG: utime on bundlePath failed."); 
     
    209209 
    210210        SecKeychainStatus status; 
    211         SecKeychainGetStatus(NULL, &status); 
     211        SecKeychainGetStatus(nil, &status); 
    212212 
    213213        if(status & 1) 
     
    257257 
    258258                /* 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
    260260                { 
    261261                        dict = [NSMutableDictionary dictionary]; 
    262262                } 
    263263 
    264                 if([dict objectForKey:@"SSH_AUTH_SOCK"] == NULL
     264                if([dict objectForKey:@"SSH_AUTH_SOCK"] == nil
    265265                { 
    266266                        [dict setObject:socketPath forKey:@"SSH_AUTH_SOCK"]; 
     
    325325        { 
    326326                [appleKeychainUnlockedLock unlock]; 
    327                 SecKeychainLock(NULL); 
     327                SecKeychainLock(nil); 
    328328        } 
    329329 
     
    339339 
    340340                [NSApp activateIgnoringOtherApps:YES]; 
    341                 SecKeychainUnlock(NULL, 0, NULL, 0); 
     341                SecKeychainUnlock(nil, 0, nil, 0); 
    342342 
    343343                if(giveFocusBack) 
     
    372372        { 
    373373                [passphraseIsRequestedLock unlock]; 
    374                 return NULL
     374                return nil
    375375        } 
    376376 
     
    387387                serviceName = "SSHKeychain"; 
    388388 
    389                 SecKeychainGetStatus(NULL, &status); 
     389                SecKeychainGetStatus(nil, &status); 
    390390 
    391391                [appleKeychainUnlockedLock lock]; 
     
    404404                [appleKeychainUnlockedLock unlock]; 
    405405 
    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); 
    407407 
    408408                if(giveFocusBack) 
     
    445445 
    446446                /* 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. */ 
    450450                if(error) 
    451451                { 
     
    453453                        passphraseIsRequested = NO; 
    454454                        [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. */ 
    459459                if(CFUserNotificationReceiveResponse(notification, 0, &response)) 
    460460                { 
     
    462462                        passphraseIsRequested = NO; 
    463463                        [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. */ 
    468468                if((response & 0x3) != kCFUserNotificationDefaultResponse) 
    469469                { 
     
    471471                        passphraseIsRequested = NO; 
    472472                        [passphraseIsRequestedLock unlock]; 
    473                         return NULL
     473                        return nil
    474474                } 
    475475                 
     
    477477                enteredPassphrase = CFUserNotificationGetResponseValue(notification, kCFUserNotificationTextFieldValuesKey, 0); 
    478478 
    479                 if(enteredPassphrase != NULL
     479                if(enteredPassphrase != nil
    480480                { 
    481481                        passphrase = [NSString stringWithString:(NSString *)enteredPassphrase]; 
     
    502502                                [appleKeychainUnlockedLock unlock]; 
    503503                                 
    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); 
    505505                                 
    506506                                if(giveFocusBack) 
     
    524524        [passphraseIsRequestedLock unlock]; 
    525525 
    526         return NULL
     526        return nil
    527527} 
    528528 
  • trunk/Libs/SSHAgent.m

    r3 r28  
    2626+ (id)currentAgent 
    2727{ 
    28         if(currentAgent == NULL
     28        if(currentAgent == nil
    2929        { 
    3030                currentAgent = [[SSHAgent alloc] init]; 
     
    3636- (id)init 
    3737{ 
    38         if((self = [super init]) == NULL
    39         { 
    40                 return NULL
     38        if((self = [super init]) == nil
     39        { 
     40                return nil
    4141        } 
    4242 
     
    6363- (void)dealloc 
    6464{ 
    65         currentAgent = NULL
     65        currentAgent = nil
    6666 
    6767        [socketPathLock dealloc]; 
     
    8686 
    8787        /* We don't use the socketPath method here, since we've just locked socketPathLock. */ 
    88         if(socketPath != NULL
     88        if(socketPath != nil
    8989        { 
    9090                [socketPath release]; 
    91                 socketPath = NULL
     91                socketPath = nil
    9292        } 
    9393 
     
    101101- (NSString *)socketPath 
    102102{ 
    103         NSString *returnString = NULL
     103        NSString *returnString = nil
    104104         
    105105        [socketPathLock lock]; 
     
    118118- (NSString *)agentSocketPath 
    119119{ 
    120         NSString *returnString = NULL
     120        NSString *returnString = nil
    121121 
    122122        [agentSocketPathLock lock]; 
     
    152152                [agentSocketPathLock lock]; 
    153153                [agentSocketPath release]; 
    154                 agentSocketPath = NULL
     154                agentSocketPath = nil
    155155                [agentSocketPathLock unlock]; 
    156156        } 
    157157 
    158158 
    159         if([self socketPath] == NULL
     159        if([self socketPath] == nil
    160160        { 
    161161                NSLog(@"DEBUG: start: socketPath not set"); 
     
    170170        theOutput = [theTool launchForStandardOutput]; 
    171171 
    172         if(theOutput == NULL
     172        if(theOutput == nil
    173173        { 
    174174                NSLog(@"ssh-agent didn't launch"); 
     
    202202 
    203203        /* 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))) 
    205205        { 
    206206                NSLog(@"SSHAgent start: ssh-agent didn't give the output we expected"); 
     
    238238                [agentSocketPathLock lock]; 
    239239                [agentSocketPath release]; 
    240                 agentSocketPath = NULL
     240                agentSocketPath = nil
    241241                [agentSocketPathLock unlock]; 
    242242 
     
    249249                [keysOnAgentLock lock]; 
    250250                [keysOnAgent release]; 
    251                 keysOnAgent = NULL
     251                keysOnAgent = nil
    252252                [keysOnAgentLock unlock]; 
    253253 
     
    280280- (NSArray *)keysOnAgent 
    281281{ 
    282         NSArray *returnArray = NULL
     282        NSArray *returnArray = nil
    283283 
    284284        [keysOnAgentLock lock]; 
     
    298298{ 
    299299        close(s); 
    300         if([[self socketPath] cString] != NULL
     300        if([[self socketPath] cString] != nil
    301301        { 
    302302                unlink([[socketPath self] cString]); 
     
    367367        /* Allocate space for 10 int's, to keep track of fd's in use. */ 
    368368        fds = malloc(sizeof(int) * allocated); 
    369         if(fds == NULL
     369        if(fds == nil
    370370        { 
    371371                NSLog(@"handleAgentConnections: malloc() failed"); 
     
    386386 
    387387        /* 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))) 
    389389        { 
    390390                /* If a == -1 and errno == EBADF, then we're probably exiting. Stop agent to be sure and return. */ 
     
    413413                                fds = realloc(fds, ((sizeof(int) * allocated) * 2)); 
    414414                                allocated = allocated * 2; 
    415                                 if(fds == NULL
     415                                if(fds == nil
    416416                                { 
    417417                                        NSLog(@"handleAgentConnections: realloc() failed"); 
     
    607607                 
    608608                /* 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. */ 
    612612                if((error) || (CFUserNotificationReceiveResponse(notification, 0, &response)) 
    613613                                || ((response & 0x3) != kCFUserNotificationDefaultResponse)) 
     
    638638                keychain = [SSHKeychain currentKeychain]; 
    639639 
    640                 if((keychain != NULL) && ([keychain count] > 0)) 
     640                if((keychain != nil) && ([keychain count] > 0)) 
    641641                { 
    642642                        [openPanelLock lock]; 
     
    689689                 
    690690                        /* 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. */ 
    694694                        if((error) || (CFUserNotificationReceiveResponse(notification, 0, &response))) 
    695695                        { 
     
    722722        if([self pid] < 1) 
    723723        { 
    724                 return NULL
     724                return nil
    725725        } 
    726726 
     
    735735        theOutput = [theTool launchForStandardOutput]; 
    736736 
    737         if(theOutput == NULL
    738         { 
    739                 return NULL
     737        if(theOutput == nil
     738        { 
     739                return nil
    740740        } 
    741741 
    742742        if([theOutput isEqualToString:@"The agent has no identities.\n"]) 
    743743        { 
    744                 return NULL
     744                return nil
    745745        } 
    746746 
     
    781781        } 
    782782 
    783         return NULL
     783        return nil
    784784} 
    785785 
     
    795795                } 
    796796 
    797                 keysOnAgent = NULL
     797                keysOnAgent = nil
    798798                 
    799799                [keysOnAgentLock unlock]; 
  • trunk/Libs/SSHKey.m

    r3 r28  
    1616        NSArray *lines; 
    1717 
    18         if((self = [super init]) == NULL
     18        if((self = [super init]) == nil
    1919        { 
    20                 return NULL
     20                return nil
    2121        } 
    2222 
     
    6464        else 
    6565        { 
    66                 return NULL
     66                return nil
    6767        } 
    6868} 
  • trunk/Libs/SSHKeychain.m

    r3 r28  
    1111+ (id)currentKeychain 
    1212{ 
    13         if(currentKeychain == NULL
     13        if(currentKeychain == nil
    1414        { 
    1515                [self keychainWithPaths:[[NSUserDefaults standardUserDefaults] arrayForKey:@"Keys"]]; 
     
    2929        SSHKey *theKey; 
    3030 
    31         if((self = [super init]) == NULL
    32         { 
    33                 return NULL
     31        if((self = [super init]) == nil
     32        { 
     33                return nil
    3434        } 
    3535 
     
    4343                /* If the key is valid, add it to the keychain array. */ 
    4444                theKey = [SSHKey keyWithPath:[paths objectAtIndex:i]]; 
    45                 if(theKey != NULL
     45                if(theKey != nil
    4646                { 
    4747                        [keychain addObject:theKey]; 
     
    5858- (id)init 
    5959{ 
    60         if((self = [super init]) == NULL
    61         { 
    62                 return NULL
     60        if((self = [super init]) == nil
     61        { 
     62                return nil
    6363        } 
    6464 
     
    7171- (void)dealloc 
    7272{ 
    73         currentKeychain = NULL
     73        currentKeychain = nil
    7474 
    7575        int i; 
     
    8282 
    8383        [keychain release]; 
    84         keychain = NULL
     84        keychain = nil
    8585 
    8686        [keychainLock unlock]; 
     
    9898        [keychainLock lock]; 
    9999 
    100         if(keychain != NULL
     100        if(keychain != nil
    101101        { 
    102102                [keychain release]; 
     
    111111                /* If the key is valid, add it to the keychain array. */ 
    112112                theKey = [SSHKey keyWithPath:[paths objectAtIndex:i]]; 
    113                 if(theKey != NULL
     113                if(theKey != nil
    114114                { 
    115115                        [keychain addObject:theKey]; 
     
    148148        { 
    149149                [keychainLock unlock]; 
    150                 return NULL
     150                return nil
    151151        } 
    152152 
     
    187187        SSHKey *key = [SSHKey keyWithPath:path]; 
    188188 
    189         if(key == NULL
     189        if(key == nil
    190190        { 
    191191                return NO; 
     
    289289        [theTool setEnvironmentVariable:@"SSH_AUTH_SOCK" withValue:agentSocketPath]; 
    290290 
    291         if((paths != NULL) && ([paths count] > 0)) 
     291        if((paths != nil) && ([paths count] > 0)) 
    292292        { 
    293293                [theTool setArguments:paths]; 
  • trunk/Libs/SSHTool.m

    r18 r28  
    9898        if([self launchAndWait] == NO) 
    9999        { 
    100                 return NULL
     100                return nil
    101101        } 
    102102 
  • trunk/Libs/SSHTunnel.m

    r26 r28  
    99        if(self = [super init]) 
    1010        { 
    11                 tunnelHost = NULL
     11                tunnelHost = nil
    1212                tunnelPort = 0; 
    13                 tunnelUser = NULL
     13                tunnelUser = nil
    1414 
    1515                localPortForwards = [[NSMutableArray alloc] init]; 
     
    1717                dynamicPortForwards = [[NSMutableArray alloc] init]; 
    1818                 
    19                 closeSelector = NULL
    20                 closeObject = NULL
    21                 closeInfo = NULL
     19                closeSelector = nil
     20                closeObject = nil
     21                closeInfo = nil
    2222 
    2323                compression = NO; 
     
    150150        else 
    151151        { 
    152                 closeInfo = NULL
     152                closeInfo = nil
    153153        } 
    154154} 
     
    213213        for(i=0; i < [remotePortForwards count]; i++) 
    214214        { 
    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],  
    216217                                                                        [[remotePortForwards objectAtIndex:i] objectAtIndex:1], 
    217218                                                                        [[[remotePortForwards objectAtIndex:i] objectAtIndex:2] intValue]] 
     
    223224                for(i=0; i < [dynamicPortForwards count]; i++) 
    224225                { 
    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]]]; 
    227230                } 
    228231        } 
     
    230233        if((tunnelPort > 0) && (tunnelPort < 65535)) 
    231234        { 
    232                         [arguments addObject:[NSString stringWithFormat:@"-p %d", tunnelPort]]; 
     235                        [arguments addObject:@"-p"]; 
     236                        [arguments addObject:[NSString stringWithFormat:@"%d", tunnelPort]]; 
    233237        } 
    234238 
  • trunk/PassphraseRequester.m

    r3 r28  
    1414                pool = [[NSAutoreleasePool alloc] init]; 
    1515 
    16                 UI = [NSConnection rootProxyForConnectionWithRegisteredName:@"SSHKeychain" host:NULL]; 
     16                UI = [NSConnection rootProxyForConnectionWithRegisteredName:@"SSHKeychain" host:nil]; 
    1717 
    18                 if(UI == NULL) {  
     18                if(UI == nil) {  
    1919                        fprintf(stderr, "Can't connect to SSHKeychain\n");  
    2020                        [pool release];  
     
    3030                        passphrase = [UI askPassphrase:[[procinfo arguments] objectAtIndex:1] withInteraction:YES]; 
    3131                         
    32                         if(passphrase == NULL
     32                        if(passphrase == nil
    3333                        { 
    3434                                [pool release]; 
     
    4141                        passphrase = [UI askPassphrase:[[procinfo arguments] objectAtIndex:1] withInteraction:NO]; 
    4242                         
    43                         if(passphrase == NULL
     43                        if(passphrase == nil
    4444                        { 
    4545                                [pool release]; 
  • trunk/PreferenceController.m

    r26 r28  
    99        if(!(self = [super init])) 
    1010        { 
    11                 return NULL
     11                return nil
    1212        } 
    1313         
     
    1515         
    1616        [NSBundle loadNibNamed:@"Preferences" owner:sharedPreferenceController]; 
     17 
     18        blankView = [[NSView alloc] init]; 
    1719         
    1820        return self; 
     21} 
     22 
     23- (void)dealloc 
     24{ 
     25        [blankView dealloc]; 
     26        [super dealloc]; 
    1927} 
    2028 
     
    5361        preferenceItemsKeys = [[NSArray arrayWithObjects:@"General", @"Display", @"SSH Keys", @"Tunnels", @"Security", @"Environment", nil] retain]; 
    5462 
    55         blankView = [[[[NSView alloc] init] autorelease] retain]; 
    56  
    5763        toolbar = [[NSToolbar alloc] initWithIdentifier:@"preferenceToolbar"]; 
    5864        [toolbar setDelegate:self]; 
  • trunk/PreferenceViews/DisplayView.m

    r3 r28  
    4747                        /* Change the bundle's modification time to let LaunchServices know we've 
    4848                         * changed something. */ 
    49                         if(utime([[[NSBundle mainBundle] bundlePath] cString], NULL) == -1) 
     49                        if(utime([[[NSBundle mainBundle] bundlePath] cString], nil) == -1) 
    5050                        { 
    5151                                NSLog(@"DEBUG: utime on bundlePath failed."); 
  • trunk/PreferenceViews/EnvironmentView.m

    r18 r28  
    1212 
    1313        environment = [[[NSMutableDictionary alloc] initWithContentsOfFile:path] autorelease]; 
    14         if(environment == NULL
     14        if(environment == nil
    1515        { 
    1616                environment = [NSMutableDictionary dictionary]; 
     
    208208        } 
    209209 
    210         return NULL
     210        return nil
    211211} 
    212212 
  • trunk/PreferenceViews/KeysView.m

    r17 r28  
    7676        paths = [keychain arrayOfPaths]; 
    7777 
    78         if(paths != NULL
     78        if(paths != nil
    7979        { 
    8080                prefs = [NSUserDefaults standardUserDefaults]; 
     
    9898                /* Get a new list of paths. */ 
    9999                paths = [keychain arrayOfPaths]; 
    100                 if(paths != NULL
     100                if(paths != nil
    101101                { 
    102102                        /* Write the paths to the UserDefaults. */ 
     
    275275        paths = [keychain arrayOfPaths]; 
    276276 
    277         if(paths != NULL
     277        if(paths != nil
    278278        { 
    279279                prefs = [NSUserDefaults standardUserDefaults]; 
     
    339339        if((okFlag == YES) && ([[NSFileManager defaultManager] fileExistsAtPath:[sender filename]])) 
    340340        { 
    341                 return NULL
     341                return nil
    342342        } 
    343343         
     
    377377        } 
    378378         
    379         return NULL
     379        return nil
    380380} 
    381381 
  • trunk/PreferenceViews/TunnelsView.m

    r26 r28  
    2323         
    2424        if(!tunnels) { 
    25                 tunnels = [[[[NSMutableArray alloc] init] autorelease] retain]; 
     25                tunnels = [[NSMutableArray alloc] init]; 
    2626        } 
    2727 
     
    6464        if(!match) 
    6565        { 
    66                 NSMutableDictionary *dict = [[[[NSMutableDictionary alloc] init] autorelease] retain]; 
     66                NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; 
    6767                [dict setObject:@"New Tunnel" forKey:@"TunnelName"]; 
    6868                 
  • trunk/TODO

    r24 r28  
    1717The Early Spring Code Cleanup: 
    1818 
    19 - [[[[foo alloc] init] autorelease] retain] is rubbish. 
    2019- #define NSStrings is rubbish 
    2120- Constants should start uppercase 
    2221- Check retain/release 
    2322- Implement dealloc for all classes containing iVars 
    24 - NULL -> nil 
    2523- Use objectEnumerator for arrays, instead of indexes 
    26 - Check task arguments (@"-arg", @"foo", instead of @"-arg foo") 
    2724- Check for repeating code 
    2825- Move local() to a macro (http://developer.apple.com/intl/localization/tools.html) 
  • trunk/TunnelController.m

    r18 r28  
    1818        if(!(self = [super init])) 
    1919        { 
    20                 return NULL
     20                return nil
    2121        } 
    2222         
     
    6060- (void)applicationDidFinishLaunching:(NSNotification *)aNotification 
    6161{ 
    62         tunnels = [[[[NSMutableArray alloc] init] autorelease] retain]; 
     62        tunnels = [[NSMutableArray alloc] init]; 
    6363         
    6464        [self sync]; 
     
    264264        SSHTunnel *tunnel; 
    265265         
    266         dict = NULL
     266        dict = nil
    267267         
    268268        if(!tunnels) { return; } 
     
    335335                                } 
    336336 
    337                                 if((last_terminated) && ((time(NULL) - last_terminated) < 300))  
     337                                if((last_terminated) && ((time(nil) - last_terminated) < 300))  
    338338                                { 
    339339                                        fails_exceeded = YES; 
     
    343343                                else if((allKeysOnAgent) && ([output length] < 1)) 
    344344                                { 
    345                                         [[tunnels objectAtIndex:i] setObject:[NSNumber numberWithInt:time(NULL)] forKey:@"LastTerminated"]; 
     345                                        [[tunnels objectAtIndex:i] setObject:[NSNumber numberWithInt:time(nil)] forKey:@"LastTerminated"]; 
    346346                                        [self openTunnelWithDict:[tunnels objectAtIndex:i]]; 
    347347                                } 
  • trunk/UpdateController.m

    r17 r28  
    1414        if(!(self = [super init])) 
    1515        { 
    16                 return NULL
     16  &nbs