tweak foirmat of debug output to match MacOS-X

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24352 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2007-01-15 12:53:20 +00:00
parent 4e07eaedbd
commit d38e116a81

View file

@ -247,14 +247,26 @@ static unsigned posForIndex(GSIArray array, unsigned index)
unsigned c = (_array == 0) ? 0 : GSIArrayCount(_array);
unsigned i;
if (c == 0)
{
return [NSString stringWithFormat: @"%@(no indexes)",
[super description]];
}
m = [NSMutableString stringWithFormat:
@"%@[number of indexes: %u (in %u ranges), indexes: ",
@"%@[number of indexes: %u (in %u ranges), indexes:",
[super description], [self count], c];
for (i = 0; i < c; i++)
{
NSRange r = GSIArrayItemAtIndex(_array, i).ext;
[m appendFormat: @"(%u-%u) ", r.location, NSMaxRange(r) - 1];
if (r.length > 1)
{
[m appendFormat: @" (%u-%u)", r.location, NSMaxRange(r) - 1];
}
else
{
[m appendFormat: @" (%u)", r.location];
}
}
[m appendString: @"]"];
return m;