Change id* -> id[] for OS X 10.7 compatibility in NSArray. This change is required for ARC: now, id* means pointer to a single object, id[] means array.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33607 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Chisnall 2011-07-22 16:07:23 +00:00
parent 2b6608b7fc
commit d323a291d8
3 changed files with 17 additions and 17 deletions

View file

@ -49,14 +49,14 @@ extern "C" {
#endif
+ (id) arrayWithObject: (id)anObject;
+ (id) arrayWithObjects: (id)firstObject, ...;
+ (id) arrayWithObjects: (const id*)objects count: (NSUInteger)count;
+ (id) arrayWithObjects: (const id[])objects count: (NSUInteger)count;
- (NSArray*) arrayByAddingObject: (id)anObject;
- (NSArray*) arrayByAddingObjectsFromArray: (NSArray*)anotherArray;
- (BOOL) containsObject: anObject;
- (NSUInteger) count; // Primitive
- (void) getObjects: (id*)aBuffer;
- (void) getObjects: (id*)aBuffer range: (NSRange)aRange;
- (void) getObjects: (id[])aBuffer;
- (void) getObjects: (id[])aBuffer range: (NSRange)aRange;
- (NSUInteger) indexOfObject: (id)anObject;
- (NSUInteger) indexOfObject: (id)anObject inRange: (NSRange)aRange;
- (NSUInteger) indexOfObjectIdenticalTo: (id)anObject;
@ -71,7 +71,7 @@ extern "C" {
- (id) initWithContentsOfURL: (NSURL*)aURL;
#endif
- (id) initWithObjects: firstObject, ...;
- (id) initWithObjects: (id*)objects count: (NSUInteger)count; // Primitive
- (id) initWithObjects: (const id[])objects count: (NSUInteger)count; // Primitive
- (id) lastObject;
- (id) objectAtIndex: (NSUInteger)index; // Primitive

View file

@ -148,7 +148,7 @@ static Class GSInlineArrayClass;
}
/* This is the designated initializer for NSArray. */
- (id) initWithObjects: (id*)objects count: (NSUInteger)count
- (id) initWithObjects: (const id[])objects count: (NSUInteger)count
{
if (count > 0)
{
@ -353,7 +353,7 @@ static Class GSInlineArrayClass;
}
}
- (void) getObjects: (id*)aBuffer
- (void) getObjects: (id[])aBuffer
{
NSUInteger i;
@ -363,7 +363,7 @@ static Class GSInlineArrayClass;
}
}
- (void) getObjects: (id*)aBuffer range: (NSRange)aRange
- (void) getObjects: (id[])aBuffer range: (NSRange)aRange
{
NSUInteger i, j = 0, e = aRange.location + aRange.length;
@ -408,7 +408,7 @@ static Class GSInlineArrayClass;
{
return [self initWithObjects: 0 count: 0];
}
- (id) initWithObjects: (id*)objects count: (NSUInteger)count
- (id) initWithObjects: (const id[])objects count: (NSUInteger)count
{
_contents_array
= (id*)(((void*)self) + class_getInstanceSize([self class]));
@ -559,7 +559,7 @@ static Class GSInlineArrayClass;
return self;
}
- (id) initWithObjects: (id*)objects count: (NSUInteger)count
- (id) initWithObjects: (const id[])objects count: (NSUInteger)count
{
self = [self initWithCapacity: count];
if (self != nil && count > 0)
@ -1123,7 +1123,7 @@ static Class GSInlineArrayClass;
@"NS.objects"];
if (array != nil)
{
return RETAIN(array);
return (GSPlaceholderArray*)RETAIN(array);
}
else
{
@ -1155,11 +1155,11 @@ static Class GSInlineArrayClass;
at: a->_contents_array];
}
a->_count = c;
return a;
return (GSPlaceholderArray*)a;
}
}
- (id) initWithObjects: (id*)objects count: (NSUInteger)count
- (id) initWithObjects: (const id[])objects count: (NSUInteger)count
{
#if GS_WITH_GC
self = (id)NSAllocateObject(GSArrayClass, 0, [self zone]);

View file

@ -271,7 +271,7 @@ static SEL rlSel;
* Returns an autoreleased array containing the specified
* objects, preserving order.
*/
+ (id) arrayWithObjects: (id*)objects count: (NSUInteger)count
+ (id) arrayWithObjects: (const id[])objects count: (NSUInteger)count
{
return AUTORELEASE([[self allocWithZone: NSDefaultMallocZone()]
initWithObjects: objects count: count]);
@ -479,7 +479,7 @@ static SEL rlSel;
* Copies the objects from the receiver to aBuffer, which must be
* an area of memory large enough to hold them.
*/
- (void) getObjects: (id*)aBuffer
- (void) getObjects: (id[])aBuffer
{
unsigned i, c = [self count];
IMP get = [self methodForSelector: oaiSel];
@ -492,7 +492,7 @@ static SEL rlSel;
* Copies the objects from the range aRange of the receiver to aBuffer,
* which must be an area of memory large enough to hold them.
*/
- (void) getObjects: (id*)aBuffer range: (NSRange)aRange
- (void) getObjects: (id[])aBuffer range: (NSRange)aRange
{
unsigned i, j = 0, c = [self count], e = aRange.location + aRange.length;
IMP get = [self methodForSelector: oaiSel];
@ -879,7 +879,7 @@ static SEL rlSel;
* and needs to be re-implemented in subclasses in order to have all
* other initialisers work.
*/
- (id) initWithObjects: (id*)objects count: (NSUInteger)count
- (id) initWithObjects: (const id[])objects count: (NSUInteger)count
{
self = [self init];
return self;
@ -1949,7 +1949,7 @@ compare(id elem1, id elem2, void* context)
/**
* Override our superclass's designated initializer to go our's
*/
- (id) initWithObjects: (id*)objects count: (NSUInteger)count
- (id) initWithObjects: (const id[])objects count: (NSUInteger)count
{
self = [self initWithCapacity: count];
if (count > 0)