Override -init to use our own initialiser

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20013 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2004-09-07 09:22:10 +00:00
parent e398188c18
commit 420c49dd17
4 changed files with 44 additions and 5 deletions

View file

@ -137,6 +137,11 @@ static Class GSInlineArrayClass;
NSDeallocateObject(self); NSDeallocateObject(self);
} }
- (id) init
{
return [self initWithObjects: 0 count: 0];
}
/* This is the designated initializer for NSArray. */ /* This is the designated initializer for NSArray. */
- (id) initWithObjects: (id*)objects count: (unsigned)count - (id) initWithObjects: (id*)objects count: (unsigned)count
{ {
@ -215,11 +220,6 @@ static Class GSInlineArrayClass;
return self; return self;
} }
- (id) init
{
return [self initWithObjects: 0 count: 0];
}
- (unsigned) count - (unsigned) count
{ {
return _count; return _count;
@ -377,6 +377,10 @@ static Class GSInlineArrayClass;
} }
NSDeallocateObject(self); NSDeallocateObject(self);
} }
- (id) init
{
return [self initWithObjects: 0 count: 0];
}
- (id) initWithObjects: (id*)objects count: (unsigned)count - (id) initWithObjects: (id*)objects count: (unsigned)count
{ {
_contents_array = (id*)&self[1]; _contents_array = (id*)&self[1];
@ -468,6 +472,11 @@ static Class GSInlineArrayClass;
} }
} }
- (id) init
{
return [self initWithCapacity: 0];
}
- (id) initWithCapacity: (unsigned)cap - (id) initWithCapacity: (unsigned)cap
{ {
if (cap == 0) if (cap == 0)
@ -1016,6 +1025,11 @@ static Class GSInlineArrayClass;
return; // placeholders never get deallocated. return; // placeholders never get deallocated.
} }
- (id) init
{
return [self initWithObjects: 0 count: 0];
}
- (id) initWithCoder: (NSCoder*)aCoder - (id) initWithCoder: (NSCoder*)aCoder
{ {
if ([aCoder allowsKeyedCoding]) if ([aCoder allowsKeyedCoding])

View file

@ -174,6 +174,11 @@
return map.nodeCount; return map.nodeCount;
} }
- (id) init
{
return [self initWithCapacity: 0];
}
/* Designated initialiser */ /* Designated initialiser */
- (id) initWithCapacity: (unsigned)cap - (id) initWithCapacity: (unsigned)cap
{ {

View file

@ -132,6 +132,11 @@ static SEL objSel;
return map.nodeCount; return map.nodeCount;
} }
- (id) init
{
return [self initWithObjects: 0 forKeys: 0 count: 0];
}
- (id) initWithCoder: (NSCoder*)aCoder - (id) initWithCoder: (NSCoder*)aCoder
{ {
if ([aCoder allowsKeyedCoding]) if ([aCoder allowsKeyedCoding])
@ -352,6 +357,11 @@ static SEL objSel;
return [copy initWithDictionary: self copyItems: NO]; return [copy initWithDictionary: self copyItems: NO];
} }
- (id) init
{
return [self initWithCapacity: 0];
}
/* Designated initialiser */ /* Designated initialiser */
- (id) initWithCapacity: (unsigned)cap - (id) initWithCapacity: (unsigned)cap
{ {

View file

@ -194,6 +194,11 @@ static Class mutableSetClass;
return map.nodeCount; return map.nodeCount;
} }
- (id) init
{
return [self initWithObjects: 0 count: 0];
}
- (id) initWithCoder: (NSCoder*)aCoder - (id) initWithCoder: (NSCoder*)aCoder
{ {
if ([aCoder allowsKeyedCoding]) if ([aCoder allowsKeyedCoding])
@ -551,6 +556,11 @@ static Class mutableSetClass;
return [copy initWithSet: self copyItems: NO]; return [copy initWithSet: self copyItems: NO];
} }
- (id) init
{
return [self initWithCapacity: 0];
}
/* Designated initialiser */ /* Designated initialiser */
- (id) initWithCapacity: (unsigned)cap - (id) initWithCapacity: (unsigned)cap
{ {