Index: Source/Additions/GCArray.m =================================================================== RCS file: /cvsroot/gnustep/gnustep/core/base/Source/Additions/GCArray.m,v retrieving revision 1.11 diff -u -r1.11 GCArray.m --- Source/Additions/GCArray.m 31 Jul 2003 23:49:32 -0000 1.11 +++ Source/Additions/GCArray.m 5 Dec 2004 20:12:30 -0000 @@ -57,11 +57,26 @@ - (id) copyWithZone: (NSZone*)zone { + GCArray *result; + id *objects; + unsigned i, c = [self count]; + if (NSShouldRetainWithZone(self, zone)) { return [self retain]; } - return [[GCArray allocWithZone: zone] initWithArray: self copyItems: YES]; + + objects = NSZoneMalloc(zone, c * sizeof(id)); + // if (objects == NULL) { ... + [self getObjects: objects]; + for (i = 0; i < c; i++) + { + objects[i] = [objects[i] copy]; + } + result = [[GCArray allocWithZone: zone] initWithObjects: objects count: c]; + NSZoneFree(zone, objects); + + return result; } - (unsigned int) count @@ -189,8 +204,7 @@ - (id) mutableCopyWithZone: (NSZone*)zone { - return [[GCMutableArray allocWithZone: zone] - initWithArray: self copyItems: NO]; + return [[GCMutableArray allocWithZone: zone] initWithArray: self]; } - (id) objectAtIndex: (unsigned int)index @@ -233,8 +247,21 @@ - (id) copyWithZone: (NSZone*)zone { - return [[GCArray allocWithZone: zone] - initWithArray: self copyItems: YES]; + GCArray *result; + id *objects; + unsigned i, c = [self count]; + + objects = NSZoneMalloc(zone, c * sizeof(id)); + // if (objects == NULL) { ... + [self getObjects: objects]; + for (i = 0; i < c; i++) + { + objects[i] = [objects[i] copy]; + } + result = [[GCArray allocWithZone: zone] initWithObjects: objects count: c]; + NSZoneFree(zone, objects); + + return result; } - (id) init @@ -345,8 +372,7 @@ - (id) mutableCopyWithZone: (NSZone*)zone { - return [[GCMutableArray allocWithZone: zone] - initWithArray: self copyItems: NO]; + return [[GCMutableArray allocWithZone: zone] initWithArray: self]; } - (void) removeAllObjects Index: Source/Additions/GSCategories.m =================================================================== RCS file: /cvsroot/gnustep/gnustep/core/base/Source/Additions/GSCategories.m,v retrieving revision 1.22 diff -u -r1.22 GSCategories.m --- Source/Additions/GSCategories.m 5 Oct 2004 08:32:18 -0000 1.22 +++ Source/Additions/GSCategories.m 5 Dec 2004 20:12:34 -0000 @@ -135,7 +135,7 @@ dst[dpos++] = hexChars[c & 0x0f]; } data = [NSData allocWithZone: NSDefaultMallocZone()]; - data = [data initWithBytesNoCopy: dst length: dlen freeWhenDone: YES]; + data = [data initWithBytesNoCopy: dst length: dlen]; string = [[NSString alloc] initWithData: data encoding: NSASCIIStringEncoding]; RELEASE(data); @@ -1070,10 +1070,12 @@ - (void) replaceString: (NSString*)replace withString: (NSString*)by { - [self replaceOccurrencesOfString: replace - withString: by - options: 0 - range: NSMakeRange(0, [self length])]; + NSRange range = [self rangeOfString: replace]; + + while (range.location != NSNotFound) { + [self replaceCharactersInRange: range withString: by]; + range = [self rangeOfString: replace]; + } } /** Index: Tools/AGSHtml.m =================================================================== RCS file: /cvsroot/gnustep/gnustep/core/base/Tools/AGSHtml.m,v retrieving revision 1.82 diff -u -r1.82 AGSHtml.m --- Tools/AGSHtml.m 19 Sep 2004 23:01:23 -0000 1.82 +++ Tools/AGSHtml.m 5 Dec 2004 20:12:44 -0000 @@ -1561,8 +1561,8 @@ // get rid of nbsps put in for readability above linkRef = [NSMutableString stringWithCapacity: [sel length]]; [linkRef setString:sel]; - [linkRef replaceOccurrencesOfString:@" " withString:@"" - options: 0 range: NSMakeRange(0, [sel length])]; + [linkRef replaceString: @" " withString: @""]; + s = [self makeLink: linkRef ofType: @"method" inUnit: nil isRef: NO]; if (s != nil) { Index: Tools/autogsdoc.m =================================================================== RCS file: /cvsroot/gnustep/gnustep/core/base/Tools/autogsdoc.m,v retrieving revision 1.89 diff -u -r1.89 autogsdoc.m --- Tools/autogsdoc.m 13 Oct 2004 16:46:09 -0000 1.89 +++ Tools/autogsdoc.m 5 Dec 2004 20:12:54 -0000 @@ -1779,10 +1779,8 @@ @" \n" @" \n" @"\n"]; - [tocSkel replaceOccurrencesOfString: @"[prjName]" withString: project - options: 0 - range: NSMakeRange(0, [tocSkel length])]; - + [tocSkel replaceString: @"[prjName]" withString: project]; + // file for top-left frame (header only; rest appended below) idxIndexFile = [@"MainIndex" stringByAppendingPathExtension: @"html"]; [idxIndex setString: @"\n \n" @@ -1806,10 +1804,8 @@ @" \n" @" \n" @"\n"]; - [frameset replaceOccurrencesOfString: @"[prjName]" withString: project - options: 0 - range: NSMakeRange(0, [frameset length])]; - + [frameset replaceString: @"[prjName]" withString: project]; + // generate the table of contents gsdoc files for (i = 0; i < [idxTypes count]; i++) { @@ -1824,12 +1820,8 @@ typeU = [@"Class" isEqualToString: typeU] ? [typeU stringByAppendingString: @"es"] : [typeU stringByAppendingString: @"s"]; - [contents replaceOccurrencesOfString: @"[typeL]" withString: typeL - options: 0 - range: NSMakeRange(0,[contents length])]; - [contents replaceOccurrencesOfString: @"[typeU]" withString: typeU - options: 0 - range: NSMakeRange(0,[contents length])]; + [contents replaceString: @"[typeL]" withString: typeL]; + [contents replaceString: @"[typeU]" withString: typeU]; gsdocFile = [[typeU stringByAppendingString: @"TOC"] stringByAppendingPathExtension: @"gsdoc"]; htmlFile = [[typeU stringByAppendingString: @"TOC"] @@ -1894,10 +1886,7 @@ @" \n" @" \n" @"\n"]; - [prjFileContents replaceOccurrencesOfString: @"[prjName]" - withString: project - options: 0 - range: NSMakeRange(0, [prjFileContents length])]; + [prjFileContents replaceString: @"[prjName]" withString: project]; [prjFileContents writeToFile: [documentationDirectory stringByAppendingPathComponent: prjFile] atomically: YES];