Fixups for DO compatibility.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26747 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2008-07-06 09:18:30 +00:00
parent f4e165a49e
commit d790d9747f
8 changed files with 197 additions and 17 deletions

View file

@ -315,17 +315,33 @@ static SEL rlSel;
- (NSArray*) arrayByAddingObjectsFromArray: (NSArray*)anotherArray
{
id na;
unsigned c, l;
unsigned c;
unsigned l;
unsigned e;
c = [self count];
l = [anotherArray count];
e = c + l;
{
GS_BEGINIDBUF(objects, c+l);
GS_BEGINIDBUF(objects, e);
[self getObjects: objects];
[anotherArray getObjects: &objects[c]];
na = [NSArrayClass arrayWithObjects: objects count: c+l];
if ([anotherArray isProxy])
{
unsigned i = c;
unsigned j = 0;
while (i < e)
{
objects[i++] = [anotherArray objectAtIndex: j++];
}
}
else
{
[anotherArray getObjects: &objects[c]];
}
na = [NSArrayClass arrayWithObjects: objects count: e];
GS_ENDIDBUF();
}
@ -582,7 +598,19 @@ static SEL rlSel;
unsigned c = [array count];
GS_BEGINIDBUF(objects, c);
[array getObjects: objects];
if ([array isProxy])
{
unsigned i;
for (i = 0; i < c; i++)
{
objects[i] = [array objectAtIndex: i];
}
}
else
{
[array getObjects: objects];
}
if (shouldCopy == YES)
{
unsigned i;
@ -617,7 +645,19 @@ static SEL rlSel;
unsigned c = [array count];
GS_BEGINIDBUF(objects, c);
[array getObjects: objects];
if ([array isProxy])
{
unsigned i;
for (i = 0; i < c; i++)
{
objects[i] = [array objectAtIndex: i];
}
}
else
{
[array getObjects: objects];
}
self = [self initWithObjects: objects count: c];
GS_ENDIDBUF();
return self;