mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 17:51:01 +00:00
([NSGArray +initialize]): Add the NSArrayNonCore behavior, so we can,
once and for all, avoid the need for those odd [super ...] calls, and can remove many methods. ([NSGArray -initWithObjects:count:]): Method removed. ([NSGArray -indexOfObject:]): Method removed. ([NSGArray -objectAtIndex:]): Method removed. ([NSGMutableArray +initialize]): Add the NSMutableArrayNonCore behavior, as above. ([NSGMutableArray -replaceObjectAtIndex:withObject:]): Method removed. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1324 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
379fe835f5
commit
c8954cfab5
1 changed files with 15 additions and 13 deletions
|
@ -21,28 +21,29 @@
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <objects/stdobjects.h>
|
||||||
#include <Foundation/NSGArray.h>
|
#include <Foundation/NSGArray.h>
|
||||||
|
#include <Foundation/NSArray.h>
|
||||||
#include <objects/NSArray.h>
|
#include <objects/NSArray.h>
|
||||||
#include <objects/behavior.h>
|
#include <objects/behavior.h>
|
||||||
#include <objects/Array.h>
|
#include <objects/Array.h>
|
||||||
#include <objects/ArrayPrivate.h>
|
#include <objects/ArrayPrivate.h>
|
||||||
#include <Foundation/NSException.h>
|
#include <Foundation/NSException.h>
|
||||||
|
|
||||||
#define self ((Array*)self)
|
|
||||||
|
|
||||||
@implementation NSGArray
|
@implementation NSGArray
|
||||||
|
|
||||||
+ (void) initialize
|
+ (void) initialize
|
||||||
{
|
{
|
||||||
static int done = 0;
|
if (self == [NSGArray class])
|
||||||
assert(!done); /* xxx see what the runtime is up to. */
|
|
||||||
if (!done)
|
|
||||||
{
|
{
|
||||||
done = 1;
|
behavior_class_add_class (self, [NSArrayNonCore class]);
|
||||||
class_add_behavior([NSGArray class], [Array class]);
|
behavior_class_add_class (self, [Array class]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* #define self ((Array*)self) */
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* This is the designated initializer for NSArray. */
|
/* This is the designated initializer for NSArray. */
|
||||||
- initWithObjects: (id*)objects count: (unsigned)count
|
- initWithObjects: (id*)objects count: (unsigned)count
|
||||||
{
|
{
|
||||||
|
@ -71,7 +72,7 @@
|
||||||
format: @"Index out of bounds"];
|
format: @"Index out of bounds"];
|
||||||
return self->_contents_array[index];
|
return self->_contents_array[index];
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -79,15 +80,15 @@
|
||||||
|
|
||||||
+ (void) initialize
|
+ (void) initialize
|
||||||
{
|
{
|
||||||
static int done = 0;
|
if (self == [NSGMutableArray class])
|
||||||
if (!done)
|
|
||||||
{
|
{
|
||||||
done = 1;
|
behavior_class_add_class (self, [NSMutableArrayNonCore class]);
|
||||||
class_add_behavior([NSGMutableArray class], [NSGArray class]);
|
behavior_class_add_class (self, [NSGArray class]);
|
||||||
class_add_behavior([NSGMutableArray class], [Array class]);
|
behavior_class_add_class (self, [Array class]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* Comes in from Array behavior
|
/* Comes in from Array behavior
|
||||||
- initWithCapacity:
|
- initWithCapacity:
|
||||||
- (void) addObject: anObject
|
- (void) addObject: anObject
|
||||||
|
@ -98,5 +99,6 @@
|
||||||
{
|
{
|
||||||
[self replaceObjectAtIndex: index with: anObject];
|
[self replaceObjectAtIndex: index with: anObject];
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in a new issue