From be54d9fa012af9c38c18f82c95cbd01dd7d186f2 Mon Sep 17 00:00:00 2001 From: rfm Date: Sun, 14 Apr 2013 17:50:00 +0000 Subject: [PATCH] tweak enumerator return git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36531 72102866-910b-0410-8b05-ffd578937521 --- Source/Additions/NSObject+GNUstepBase.m | 6 +++--- Source/NSDictionary.m | 13 +++++-------- Source/NSHashTable.m | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Source/Additions/NSObject+GNUstepBase.m b/Source/Additions/NSObject+GNUstepBase.m index 09b318c4f..bab62e55b 100644 --- a/Source/Additions/NSObject+GNUstepBase.m +++ b/Source/Additions/NSObject+GNUstepBase.m @@ -99,7 +99,7 @@ format: @"[%@%c%@] not implemented", NSStringFromClass([self class]), c, aSel ? (id)NSStringFromSelector(aSel) : (id)@"(null)"]; - return nil; + return self; // Not reached } - (id) shouldNotImplement: (SEL)aSel @@ -111,7 +111,7 @@ format: @"[%@%c%@] should not be implemented", NSStringFromClass([self class]), c, aSel ? (id)NSStringFromSelector(aSel) : (id)@"(null)"]; - return nil; + return self; // Not reached } - (id) subclassResponsibility: (SEL)aSel @@ -122,7 +122,7 @@ format: @"[%@%c%@] should be overridden by subclass", NSStringFromClass([self class]), c, aSel ? (id)NSStringFromSelector(aSel) : (id)@"(null)"]; - return nil; + return self; // Not reached } @end diff --git a/Source/NSDictionary.m b/Source/NSDictionary.m index 01a445b5f..29ce4b5c0 100644 --- a/Source/NSDictionary.m +++ b/Source/NSDictionary.m @@ -238,8 +238,7 @@ static SEL appSel; */ - (NSEnumerator*) keyEnumerator { - [self subclassResponsibility: _cmd]; - return nil; + return [self subclassResponsibility: _cmd]; } /** @@ -248,8 +247,7 @@ static SEL appSel; */ - (id) objectForKey: (id)aKey { - [self subclassResponsibility: _cmd]; - return 0; + return [self subclassResponsibility: _cmd]; } - (id) objectForKeyedSubscript: (id)aKey @@ -262,8 +260,7 @@ static SEL appSel; */ - (NSEnumerator*) objectEnumerator { - [self subclassResponsibility: _cmd]; - return nil; + return [self subclassResponsibility: _cmd]; } /** @@ -1230,8 +1227,8 @@ compareIt(id o1, id o2, void* context) objects: (__unsafe_unretained id[])stackbuf count: (NSUInteger)len { - [self subclassResponsibility: _cmd]; - return 0; + [self subclassResponsibility: _cmd]; + return 0; } @end diff --git a/Source/NSHashTable.m b/Source/NSHashTable.m index 5c4098937..c456833ae 100644 --- a/Source/NSHashTable.m +++ b/Source/NSHashTable.m @@ -98,7 +98,7 @@ static Class concreteClass = 0; } - (id) initWithPointerFunctions: (NSPointerFunctions*)functions - capacity: (NSUInteger)initialCapacity + capacity: (NSUInteger)initialCapacity { [self subclassResponsibility: _cmd]; return nil;