mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
More tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@8534 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ede24b003d
commit
31a5fc78ed
9 changed files with 133 additions and 91 deletions
|
@ -147,6 +147,7 @@ BASE_MFILES = \
|
|||
GSArray.m \
|
||||
GSAttributedString.m \
|
||||
GSCountedSet.m \
|
||||
GSDictionary.m \
|
||||
GSHTTPURLHandle.m \
|
||||
GSMime.m \
|
||||
GSSet.m \
|
||||
|
@ -183,7 +184,6 @@ NSFileHandle.m \
|
|||
NSFileManager.m \
|
||||
NSFormatter.m \
|
||||
NSGeometry.m \
|
||||
NSGDictionary.m \
|
||||
NSHashTable.m \
|
||||
NSHost.m \
|
||||
NSInvocation.m \
|
||||
|
|
|
@ -829,3 +829,32 @@ SANITY();
|
|||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@interface NSGAttributedString : NSAttributedString
|
||||
@end
|
||||
@implementation NSGAttributedString
|
||||
- (id) initWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
NSLog(@"Warning - decoding archive containing obsolete %@ object - please delete/replace this archive", NSStringFromClass([self class]));
|
||||
RELEASE(self);
|
||||
self = (id)NSAllocateObject([GSAttributedString class], 0, NSDefaultMallocZone());
|
||||
self = [self initWithCoder: aCoder];
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface NSGMutableAttributedString : NSMutableAttributedString
|
||||
@end
|
||||
@implementation NSGMutableAttributedString
|
||||
- (id) initWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
NSLog(@"Warning - decoding archive containing obsolete %@ object - please delete/replace this archive", NSStringFromClass([self class]));
|
||||
RELEASE(self);
|
||||
self = (id)NSAllocateObject([GSMutableAttributedString class], 0, NSDefaultMallocZone());
|
||||
self = [self initWithCoder: aCoder];
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -49,42 +49,41 @@
|
|||
@class NSDictionaryNonCore;
|
||||
@class NSMutableDictionaryNonCore;
|
||||
|
||||
@interface NSGDictionary : NSDictionary
|
||||
@interface GSDictionary : NSDictionary
|
||||
{
|
||||
@public
|
||||
GSIMapTable_t map;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface NSGMutableDictionary : NSMutableDictionary
|
||||
@interface GSMutableDictionary : NSMutableDictionary
|
||||
{
|
||||
@public
|
||||
GSIMapTable_t map;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface NSGDictionaryKeyEnumerator : NSEnumerator
|
||||
@interface GSDictionaryKeyEnumerator : NSEnumerator
|
||||
{
|
||||
NSGDictionary *dictionary;
|
||||
GSDictionary *dictionary;
|
||||
GSIMapEnumerator_t enumerator;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface NSGDictionaryObjectEnumerator : NSGDictionaryKeyEnumerator
|
||||
@interface GSDictionaryObjectEnumerator : GSDictionaryKeyEnumerator
|
||||
@end
|
||||
|
||||
@implementation NSGDictionary
|
||||
@implementation GSDictionary
|
||||
|
||||
static SEL nxtSel;
|
||||
static SEL objSel;
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
if (self == [NSGDictionary class])
|
||||
if (self == [GSDictionary class])
|
||||
{
|
||||
nxtSel = @selector(nextObject);
|
||||
objSel = @selector(objectForKey:);
|
||||
behavior_class_add_class(self, [NSDictionaryNonCore class]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -244,13 +243,13 @@ static SEL objSel;
|
|||
|
||||
- (NSEnumerator*) keyEnumerator
|
||||
{
|
||||
return AUTORELEASE([[NSGDictionaryKeyEnumerator allocWithZone:
|
||||
return AUTORELEASE([[GSDictionaryKeyEnumerator allocWithZone:
|
||||
NSDefaultMallocZone()] initWithDictionary: self]);
|
||||
}
|
||||
|
||||
- (NSEnumerator*) objectEnumerator
|
||||
{
|
||||
return AUTORELEASE([[NSGDictionaryObjectEnumerator allocWithZone:
|
||||
return AUTORELEASE([[GSDictionaryObjectEnumerator allocWithZone:
|
||||
NSDefaultMallocZone()] initWithDictionary: self]);
|
||||
}
|
||||
|
||||
|
@ -270,14 +269,13 @@ static SEL objSel;
|
|||
|
||||
@end
|
||||
|
||||
@implementation NSGMutableDictionary
|
||||
@implementation GSMutableDictionary
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
if (self == [NSGMutableDictionary class])
|
||||
if (self == [GSMutableDictionary class])
|
||||
{
|
||||
behavior_class_add_class(self, [NSMutableDictionaryNonCore class]);
|
||||
behavior_class_add_class(self, [NSGDictionary class]);
|
||||
behavior_class_add_class(self, [GSDictionary class]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -332,12 +330,12 @@ static SEL objSel;
|
|||
|
||||
@end
|
||||
|
||||
@implementation NSGDictionaryKeyEnumerator
|
||||
@implementation GSDictionaryKeyEnumerator
|
||||
|
||||
- (id) initWithDictionary: (NSDictionary*)d
|
||||
{
|
||||
[super init];
|
||||
dictionary = (NSGDictionary*)RETAIN(d);
|
||||
dictionary = (GSDictionary*)RETAIN(d);
|
||||
enumerator = GSIMapEnumeratorForMap(&dictionary->map);
|
||||
return self;
|
||||
}
|
||||
|
@ -361,7 +359,7 @@ static SEL objSel;
|
|||
|
||||
@end
|
||||
|
||||
@implementation NSGDictionaryObjectEnumerator
|
||||
@implementation GSDictionaryObjectEnumerator
|
||||
|
||||
- (id) nextObject
|
||||
{
|
||||
|
@ -375,3 +373,32 @@ static SEL objSel;
|
|||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@interface NSGDictionary : NSDictionary
|
||||
@end
|
||||
@implementation NSGDictionary
|
||||
- (id) initWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
NSLog(@"Warning - decoding archive containing obsolete %@ object - please delete/replace this archive", NSStringFromClass([self class]));
|
||||
RELEASE(self);
|
||||
self = (id)NSAllocateObject([GSDictionary class], 0, NSDefaultMallocZone());
|
||||
self = [self initWithCoder: aCoder];
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface NSGMutableDictionary : NSMutableDictionary
|
||||
@end
|
||||
@implementation NSGMutableDictionary
|
||||
- (id) initWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
NSLog(@"Warning - decoding archive containing obsolete %@ object - please delete/replace this archive", NSStringFromClass([self class]));
|
||||
RELEASE(self);
|
||||
self = (id)NSAllocateObject([GSMutableDictionary class], 0, NSDefaultMallocZone());
|
||||
self = [self initWithCoder: aCoder];
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
|
||||
@class GSAttributedString;
|
||||
@class GSMutableAttributedString;
|
||||
@class NSGMutableDictionary;
|
||||
@class GSMutableDictionary;
|
||||
static Class dictionaryClass = 0;
|
||||
|
||||
static SEL eqSel;
|
||||
|
@ -100,7 +100,7 @@ static Class GSMutableAttributedStringClass;
|
|||
= [NSMutableAttributedString class];
|
||||
GSMutableAttributedStringClass
|
||||
= [GSMutableAttributedString class];
|
||||
dictionaryClass = [NSGMutableDictionary class];
|
||||
dictionaryClass = [GSMutableDictionary class];
|
||||
|
||||
eqSel = @selector(isEqual:);
|
||||
setSel = @selector(setAttributes:range:);
|
||||
|
|
|
@ -36,21 +36,16 @@
|
|||
#include <Foundation/NSDebug.h>
|
||||
#include <Foundation/NSObjCRuntime.h>
|
||||
|
||||
@interface NSDictionaryNonCore : NSDictionary
|
||||
@end
|
||||
@interface NSMutableDictionaryNonCore: NSMutableDictionary
|
||||
@end
|
||||
|
||||
@implementation NSDictionary
|
||||
|
||||
@class NSGDictionary;
|
||||
@class NSGMutableDictionary;
|
||||
@class GSDictionary;
|
||||
@class GSMutableDictionary;
|
||||
|
||||
static Class NSArray_class;
|
||||
static Class NSDictionary_abstract_class;
|
||||
static Class NSMutableDictionary_abstract_class;
|
||||
static Class NSDictionary_concrete_class;
|
||||
static Class NSMutableDictionary_concrete_class;
|
||||
static Class NSDictionaryClass;
|
||||
static Class NSMutableDictionaryClass;
|
||||
static Class GSDictionaryClass;
|
||||
static Class GSMutableDictionaryClass;
|
||||
|
||||
static SEL eqSel;
|
||||
static SEL nxtSel;
|
||||
|
@ -63,12 +58,11 @@ static SEL appSel;
|
|||
{
|
||||
if (self == [NSDictionary class])
|
||||
{
|
||||
behavior_class_add_class (self, [NSDictionaryNonCore class]);
|
||||
NSArray_class = [NSArray class];
|
||||
NSDictionary_abstract_class = [NSDictionary class];
|
||||
NSMutableDictionary_abstract_class = [NSMutableDictionary class];
|
||||
NSDictionary_concrete_class = [NSGDictionary class];
|
||||
NSMutableDictionary_concrete_class = [NSGMutableDictionary class];
|
||||
NSDictionaryClass = [NSDictionary class];
|
||||
NSMutableDictionaryClass = [NSMutableDictionary class];
|
||||
GSDictionaryClass = [GSDictionary class];
|
||||
GSMutableDictionaryClass = [GSMutableDictionary class];
|
||||
|
||||
eqSel = @selector(isEqual:);
|
||||
nxtSel = @selector(nextObject);
|
||||
|
@ -81,9 +75,9 @@ static SEL appSel;
|
|||
|
||||
+ (id) allocWithZone: (NSZone*)z
|
||||
{
|
||||
if (self == NSDictionary_abstract_class)
|
||||
if (self == NSDictionaryClass)
|
||||
{
|
||||
return NSAllocateObject(NSDictionary_concrete_class, 0, z);
|
||||
return NSAllocateObject(GSDictionaryClass, 0, z);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -131,13 +125,13 @@ static SEL appSel;
|
|||
|
||||
- (id) mutableCopyWithZone: (NSZone*)z
|
||||
{
|
||||
return [[NSMutableDictionary_concrete_class allocWithZone: z]
|
||||
return [[GSMutableDictionaryClass allocWithZone: z]
|
||||
initWithDictionary: self];
|
||||
}
|
||||
|
||||
- (Class) classForCoder
|
||||
{
|
||||
return NSDictionary_abstract_class;
|
||||
return NSDictionaryClass;
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||
|
@ -192,9 +186,6 @@ static SEL appSel;
|
|||
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation NSDictionaryNonCore
|
||||
|
||||
+ (id) dictionary
|
||||
{
|
||||
|
@ -431,7 +422,7 @@ static SEL appSel;
|
|||
}
|
||||
NS_ENDHANDLER
|
||||
RELEASE(myString);
|
||||
if ([result isKindOfClass: NSDictionary_abstract_class])
|
||||
if ([result isKindOfClass: NSDictionaryClass])
|
||||
{
|
||||
[self initWithDictionary: result];
|
||||
return self;
|
||||
|
@ -453,7 +444,7 @@ static SEL appSel;
|
|||
if (other == self)
|
||||
return YES;
|
||||
|
||||
if ([other isKindOfClass: NSDictionary_abstract_class])
|
||||
if ([other isKindOfClass: NSDictionaryClass])
|
||||
return [self isEqualToDictionary: other];
|
||||
|
||||
return NO;
|
||||
|
@ -904,16 +895,14 @@ static NSString *indentStrings[] = {
|
|||
{
|
||||
if (self == [NSMutableDictionary class])
|
||||
{
|
||||
behavior_class_add_class (self, [NSMutableDictionaryNonCore class]);
|
||||
behavior_class_add_class (self, [NSDictionaryNonCore class]);
|
||||
}
|
||||
}
|
||||
|
||||
+ (id) allocWithZone: (NSZone*)z
|
||||
{
|
||||
if (self == NSMutableDictionary_abstract_class)
|
||||
if (self == NSMutableDictionaryClass)
|
||||
{
|
||||
return NSAllocateObject(NSMutableDictionary_concrete_class, 0, z);
|
||||
return NSAllocateObject(GSMutableDictionaryClass, 0, z);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -940,7 +929,7 @@ static NSString *indentStrings[] = {
|
|||
objects[i] = (*objImp)(self, objSel, key);
|
||||
objects[i] = [objects[i] copyWithZone: z];
|
||||
}
|
||||
newDictionary = [[NSDictionary_concrete_class allocWithZone: z]
|
||||
newDictionary = [[GSDictionaryClass allocWithZone: z]
|
||||
initWithObjects: objects
|
||||
forKeys: keys
|
||||
count: count];
|
||||
|
@ -955,7 +944,7 @@ static NSString *indentStrings[] = {
|
|||
|
||||
- (Class) classForCoder
|
||||
{
|
||||
return NSMutableDictionary_abstract_class;
|
||||
return NSMutableDictionaryClass;
|
||||
}
|
||||
|
||||
/* This is the designated initializer */
|
||||
|
@ -975,10 +964,6 @@ static NSString *indentStrings[] = {
|
|||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSMutableDictionaryNonCore
|
||||
|
||||
+ (id) dictionaryWithCapacity: (unsigned)numItems
|
||||
{
|
||||
return AUTORELEASE([[self allocWithZone: NSDefaultMallocZone()]
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
#include <Foundation/NSNotificationQueue.h>
|
||||
#include <Foundation/NSObjCRuntime.h>
|
||||
|
||||
@class NSGDictionary;
|
||||
@class NSGMutableDictionary;
|
||||
@class GSDictionary;
|
||||
@class GSMutableDictionary;
|
||||
@class NSDataMalloc;
|
||||
@class GSInlineArray;
|
||||
@class GSMutableArray;
|
||||
|
@ -690,8 +690,8 @@ deserializeFromInfo(_NSDeserializerInfo* info)
|
|||
IACls = [GSInlineArray class];
|
||||
MACls = [GSMutableArray class];
|
||||
DCls = [NSDataMalloc class];
|
||||
IDCls = [NSGDictionary class];
|
||||
MDCls = [NSGMutableDictionary class];
|
||||
IDCls = [GSDictionary class];
|
||||
MDCls = [GSMutableDictionary class];
|
||||
USCls = [GSUnicodeString class];
|
||||
CSCls = [GSCString class];
|
||||
csInitImp = [CSCls instanceMethodForSelector: csInitSel];
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
@class GSMutableString;
|
||||
@class GSPlaceholderString;
|
||||
@class GSMutableArray;
|
||||
@class NSGMutableDictionary;
|
||||
@class GSMutableDictionary;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -4029,7 +4029,7 @@ setupPl()
|
|||
plAdd = (id (*)(id, SEL, id))
|
||||
[plArray instanceMethodForSelector: @selector(addObject:)];
|
||||
|
||||
plDictionary = [NSGMutableDictionary class];
|
||||
plDictionary = [GSMutableDictionary class];
|
||||
plSet = (id (*)(id, SEL, id, id))
|
||||
[plDictionary instanceMethodForSelector: @selector(setObject:forKey:)];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue