From f12678ccf256db967cc1248d55211d0ed45e5b99 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Tue, 11 Dec 2007 06:36:19 +0000 Subject: [PATCH] debug keyed archiving git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25718 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSIndexSet.m | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2662efa47..fa5bc2fa9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-12-11 Richard Frith-Macdonald + + * Source/NSIndexSet.m: Test and debug ([-initWithCoder:]) + and ([-encodeWithCoder:]) methods for keyed archiving of sets + with multiple index ranges. + 2007-12-10 Chris Farber * Source/NSKeyValueObserving.m: implement methods needed for gui diff --git a/Source/NSIndexSet.m b/Source/NSIndexSet.m index 8b5e2a934..4a35d4d5f 100644 --- a/Source/NSIndexSet.m +++ b/Source/NSIndexSet.m @@ -267,7 +267,7 @@ static unsigned posForIndex(GSIArray array, unsigned index) } else { - [m appendFormat: @" (%u)", r.location]; + [m appendFormat: @" %u", r.location]; } } [m appendString: @"]"]; @@ -308,7 +308,7 @@ static unsigned posForIndex(GSIArray array, unsigned index) unsigned v; uint8_t b; - r = GSIArrayItemAtIndex(_array, 0).ext; + r = GSIArrayItemAtIndex(_array, i).ext; v = r.location; do { @@ -339,8 +339,8 @@ static unsigned posForIndex(GSIArray array, unsigned index) [m appendBytes: &b length: 1]; } while (v > 0); - [aCoder encodeObject: m forKey: @"NSRangeData"]; } + [aCoder encodeObject: m forKey: @"NSRangeData"]; } } @@ -555,7 +555,7 @@ static unsigned posForIndex(GSIArray array, unsigned index) NSData *data = nil; const uint8_t *bytes; unsigned length; - unsigned index; + unsigned index = 0; if ([aCoder containsValueForKey: @"NSRangeData"]) {