Some DO fixes ... don;'t use the -getObjects: method with a proxy as it

can't pass back distant items into a local buffer.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18847 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2004-03-15 18:01:53 +00:00
parent d5345b8bd6
commit f4bcea754f
4 changed files with 96 additions and 13 deletions

View file

@ -1,3 +1,12 @@
2004-03-15 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSCompatibility.m:
* Source/GSDictionary.m:
* Source/NSPropertyList.m: Check for proxies in a few places and
avoid pointer code which won't work for them. Also avoid caching
imps as a temporary workaround for a problem (not yet understood)
with ffi forwarding using a cached imp.
2004-03-12 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSCategories.m:
@ -431,7 +440,7 @@ Sat Mar 6 13:54:28 2004 Nicola Pero <n.pero@mi.flashnet.it>
* Source/NSURLHandle.m: ([-availableResourceData]) remove condition
that returns nil while resource is loading. Fix typo in method
description. Return copy a of internal variable rather than the
actuyal mutable data object.
actual mutable data object.
2004-01-12 Adam Fedor <fedor@gnu.org>

View file

@ -623,7 +623,17 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
NSString *plists[count];
unsigned i;
[obj getObjects: plists];
if ([obj isProxy] == YES)
{
for (i = 0; i < count; i++)
{
plists[i] = [obj objectAtIndex: i];
}
}
else
{
[obj getObjects: plists];
}
if (loc == nil)
{
@ -713,8 +723,6 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
}
else
{
SEL objSel = @selector(objectForKey:);
IMP myObj = [obj methodForSelector: objSel];
unsigned i;
NSArray *keyArray = [obj allKeys];
unsigned numKeys = [keyArray count];
@ -722,8 +730,19 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
NSString *keys[numKeys];
BOOL canCompare = YES;
Class lastClass = 0;
BOOL isProxy = [obj isProxy];
[keyArray getObjects: keys];
if (isProxy == YES)
{
for (i = 0; i < numKeys; i++)
{
keys[i] = [keyArray objectAtIndex: i];
}
}
else
{
[keyArray getObjects: keys];
}
for (i = 0; i < numKeys; i++)
{
@ -819,9 +838,22 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
#endif
}
for (i = 0; i < numKeys; i++)
if (isProxy == YES)
{
plists[i] = (*myObj)(obj, objSel, keys[i]);
for (i = 0; i < numKeys; i++)
{
plists[i] = [obj objectForKey: keys[i]];
}
}
else
{
SEL objSel = @selector(objectForKey:);
IMP myObj = [obj methodForSelector: objSel];
for (i = 0; i < numKeys; i++)
{
plists[i] = (*myObj)(obj, objSel, keys[i]);
}
}
if (loc == nil)

View file

@ -215,14 +215,25 @@ static SEL objSel;
NSEnumerator *e = [other keyEnumerator];
IMP nxtObj = [e methodForSelector: nxtSel];
IMP otherObj = [other methodForSelector: objSel];
BOOL isProxy = [other isProxy];
unsigned i;
for (i = 0; i < c; i++)
{
GSIMapNode node;
id k = (*nxtObj)(e, nxtSel);
id o = (*otherObj)(other, objSel, k);
id k;
id o;
if (isProxy == YES)
{
k = [e nextObject];
o = [other objectForKey: k];
}
else
{
k = (*nxtObj)(e, nxtSel);
o = (*otherObj)(other, objSel, k);
}
k = [k copyWithZone: z];
if (k == nil)
{

View file

@ -1697,7 +1697,17 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
NSString *plists[count];
unsigned i;
[obj getObjects: plists];
if ([obj isProxy] == YES)
{
for (i = 0; i < count; i++)
{
plists[i] = [obj objectAtIndex: i];
}
}
else
{
[obj getObjects: plists];
}
if (loc == nil)
{
@ -1751,6 +1761,7 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
BOOL canCompare = YES;
Class lastClass = 0;
unsigned level = lev;
BOOL isProxy = [obj isProxy];
if (level*step < sizeof(indentStrings)/sizeof(id))
{
@ -1772,7 +1783,17 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
= indentStrings[sizeof(indentStrings)/sizeof(id)-1];
}
[keyArray getObjects: keys];
if (isProxy == YES)
{
for (i = 0; i < numKeys; i++)
{
keys[i] = [keyArray objectAtIndex: i];
}
}
else
{
[keyArray getObjects: keys];
}
for (i = 0; i < numKeys; i++)
{
@ -1868,9 +1889,19 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
#endif
}
for (i = 0; i < numKeys; i++)
if (isProxy == YES)
{
plists[i] = (*myObj)(obj, objSel, keys[i]);
for (i = 0; i < numKeys; i++)
{
plists[i] = [obj objectForKey: keys[i]];
}
}
else
{
for (i = 0; i < numKeys; i++)
{
plists[i] = (*myObj)(obj, objSel, keys[i]);
}
}
if (x == NSPropertyListXMLFormat_v1_0)