Commits

Jens Alfke committed 12840f6

Fixed some new warnings in Snow Leopard / Xcode 3.2 / Clang.

Comments (0)

Files changed (4)

Source/HgConfigFile.m

                 line = trim(line);
                 if( line.length>0 && stanzaDict && key ) {
                     NSString *value = [stanzaDict objectForKey: key];
-                    if( value.length>0 )
-                        value = [value stringByAppendingString: @" "];
-                    value = [value stringByAppendingString: line];
+					if (value) {
+						if( value.length>0 )
+							value = [value stringByAppendingString: @" "];
+						value = [value stringByAppendingString: line];
+						[stanzaDict setObject: value forKey: key];
+					}
                 }
             } else {
                 // key/value pair:

Source/HgRepository.m

     Assert(dstURL);
     if( dstURL.isFileURL ) {
         NSString *dstPath = dstURL.path;
-        if( [[NSFileManager defaultManager] fileExistsAtPath: dstPath] )
-            return [[HgOperation alloc] initWithError: @"The path to clone into already exists"];
+        if( [[NSFileManager defaultManager] fileExistsAtPath: dstPath] ) {
+            NSError *error;
+            MYMiscError(&error, @"The path to clone into already exists");
+            return [[HgOperation alloc] initWithError: error];
+        }
         NSString *root = [[self class] findRootOf: dstPath localPath: NULL];
         if( root ) {
             NSError *error;
             MYMiscError(&error, @"The path to clone into is already inside a Mercurial repository at %@",root);
-            return  [[HgOperation alloc] initWithError: error];
+            return [[HgOperation alloc] initWithError: error];
         }
     }
     

Source/HgRevision.m

                                                      command: @"cat",
                        @"--rev", [NSString stringWithFormat: @"%i",_localNumber], @"--", file.path, nil];
     if( ! [op run] ) {
-        *outError = op.error;
+        if (outError) *outError = op.error;
         return nil;
     }
     return op.outputData;
                        @"--rev", [NSString stringWithFormat: @"%i",MAX(otherRev,_localNumber)],
                        @"--", file.path, nil];
     if( ! [op run] ) {
-        *outError = op.error;
+        if (outError) *outError = op.error;
         return nil;
     }
     return op.output ?: @"";    
                        @"--rev", [NSString stringWithFormat: @"%i",MAX(otherRev,_localNumber)],
                        @"--", file.path, nil];
     if( ! [op run] ) {
-        *outError = op.error;
+        if (outError) *outError = op.error;
         return nil;
     }
     return op.output;    

Source/RepoController.m

                                      @"Convert", @"Cancel", nil,
                                      path);
         if( result != NSOKButton ) {
-            *error = nil;
+            if (error) *error = nil;
             return nil;
         }
         repo = [[HgRepository alloc] initNewWithPath: path error: error];