mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Changed keys argument type to (const id <NSCopying>[]) in
-[NSDictionary initWithObjects:forKeys:count:] and +dictionaryWithObjects:forKeys:count:, to follow the current Cocoa API. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37431 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
027b437d5a
commit
cf71a18895
6 changed files with 24 additions and 13 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2013-12-05 Quentin Mathe <quentin.mathe@gmail.com>
|
||||
|
||||
* Headers/Foundation/NSDictionary.h:
|
||||
* Source/NSDictionary.m:
|
||||
* Source/Additions/GCDictionary.m:
|
||||
* Source/Additions/GSInsensitiveDictionary.m:
|
||||
* Source/GSDictionary.m:
|
||||
Changed keys argument type to (const id <NSCopying>[]) in
|
||||
-initWithObjects:forKeys:count: and +dictionaryWithObjects:forKeys:count:,
|
||||
to follow the current Cocoa API.
|
||||
|
||||
2013-12-04 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSURLCredential.m: ([-isEqual:]) needs to take the password
|
||||
|
|
|
@ -45,7 +45,7 @@ extern "C" {
|
|||
+ (id) dictionaryWithObject: (id)object forKey: (id)key;
|
||||
+ (id) dictionaryWithObjects: (NSArray*)objects forKeys: (NSArray*)keys;
|
||||
+ (id) dictionaryWithObjects: (const id[])objects
|
||||
forKeys: (const id[])keys
|
||||
forKeys: (const id <NSCopying>[])keys
|
||||
count: (NSUInteger)count;
|
||||
+ (id) dictionaryWithObjectsAndKeys: (id)firstObject, ...;
|
||||
|
||||
|
@ -81,7 +81,7 @@ DEFINE_BLOCK_TYPE(GSKeysAndObjectsEnumeratorBlock, void, id, id, BOOL*);
|
|||
- (id) initWithObjects: (NSArray*)objects forKeys: (NSArray*)keys;
|
||||
- (id) initWithObjectsAndKeys: (id)firstObject, ...;
|
||||
- (id) initWithObjects: (const id[])objects
|
||||
forKeys: (const id[])keys
|
||||
forKeys: (const id <NSCopying>[])keys
|
||||
count: (NSUInteger)count; // Primitive
|
||||
- (BOOL) isEqualToDictionary: (NSDictionary*)other;
|
||||
|
||||
|
|
|
@ -261,7 +261,7 @@ static Class gcClass = 0;
|
|||
}
|
||||
|
||||
- (id) initWithObjects: (const id[])objects
|
||||
forKeys: (const id[])keys
|
||||
forKeys: (const id <NSCopying>[])keys
|
||||
count: (NSUInteger)count
|
||||
{
|
||||
NSUInteger size = (count * 4) / 3;
|
||||
|
@ -284,7 +284,7 @@ static Class gcClass = 0;
|
|||
keyStruct = NSZoneMalloc(z, sizeof(GCInfo));
|
||||
valueStruct = NSZoneMalloc(z, sizeof(GCInfo));
|
||||
keyStruct->object = keys[count];
|
||||
keyStruct->isGCObject = [keys[count] isKindOfClass: gcClass];
|
||||
keyStruct->isGCObject = [(id <NSObject>)keys[count] isKindOfClass: gcClass];
|
||||
valueStruct->object = objects[count];
|
||||
valueStruct->isGCObject
|
||||
= [objects[count] isKindOfClass: gcClass];
|
||||
|
|
|
@ -170,7 +170,7 @@ static SEL objSel;
|
|||
}
|
||||
|
||||
/* Designated initialiser */
|
||||
- (id) initWithObjects: (const id[])objs forKeys: (const id[])keys count: (NSUInteger)c
|
||||
- (id) initWithObjects: (const id[])objs forKeys: (const id <NSCopying>[])keys count: (NSUInteger)c
|
||||
{
|
||||
NSUInteger i;
|
||||
|
||||
|
@ -192,7 +192,7 @@ static SEL objSel;
|
|||
format: @"Tried to init dictionary with nil value"];
|
||||
}
|
||||
|
||||
node = GSIMapNodeForKey(&map, (GSIMapKey)keys[i]);
|
||||
node = GSIMapNodeForKey(&map, (GSIMapKey)(id)keys[i]);
|
||||
if (node)
|
||||
{
|
||||
IF_NO_GC(RETAIN(objs[i]));
|
||||
|
@ -201,7 +201,7 @@ static SEL objSel;
|
|||
}
|
||||
else
|
||||
{
|
||||
GSIMapAddPair(&map, (GSIMapKey)keys[i], (GSIMapVal)objs[i]);
|
||||
GSIMapAddPair(&map, (GSIMapKey)(id)keys[i], (GSIMapVal)objs[i]);
|
||||
}
|
||||
}
|
||||
return self;
|
||||
|
|
|
@ -185,7 +185,7 @@ static SEL objSel;
|
|||
|
||||
/* Designated initialiser */
|
||||
- (id) initWithObjects: (const id[])objs
|
||||
forKeys: (const id[])keys
|
||||
forKeys: (const id <NSCopying>[])keys
|
||||
count: (NSUInteger)c
|
||||
{
|
||||
NSUInteger i;
|
||||
|
@ -208,7 +208,7 @@ static SEL objSel;
|
|||
format: @"Tried to init dictionary with nil value"];
|
||||
}
|
||||
|
||||
node = GSIMapNodeForKey(&map, (GSIMapKey)keys[i]);
|
||||
node = GSIMapNodeForKey(&map, (GSIMapKey)(id)keys[i]);
|
||||
if (node)
|
||||
{
|
||||
IF_NO_GC(RETAIN(objs[i]));
|
||||
|
@ -217,7 +217,7 @@ static SEL objSel;
|
|||
}
|
||||
else
|
||||
{
|
||||
GSIMapAddPair(&map, (GSIMapKey)keys[i], (GSIMapVal)objs[i]);
|
||||
GSIMapAddPair(&map, (GSIMapKey)(id)keys[i], (GSIMapVal)objs[i]);
|
||||
}
|
||||
}
|
||||
return self;
|
||||
|
|
|
@ -225,7 +225,7 @@ static SEL appSel;
|
|||
* other initialisers work.
|
||||
*/
|
||||
- (id) initWithObjects: (const id[])objects
|
||||
forKeys: (const id[])keys
|
||||
forKeys: (const id <NSCopying>[])keys
|
||||
count: (NSUInteger)count
|
||||
{
|
||||
self = [self init];
|
||||
|
@ -444,7 +444,7 @@ static SEL appSel;
|
|||
* element of the keys array.
|
||||
*/
|
||||
+ (id) dictionaryWithObjects: (const id[])objects
|
||||
forKeys: (const id[])keys
|
||||
forKeys: (const id <NSCopying>[])keys
|
||||
count: (NSUInteger)count
|
||||
{
|
||||
return AUTORELEASE([[self allocWithZone: NSDefaultMallocZone()]
|
||||
|
@ -1357,7 +1357,7 @@ compareIt(id o1, id o2, void* context)
|
|||
* element of the keys array.
|
||||
*/
|
||||
- (id) initWithObjects: (const id[])objects
|
||||
forKeys: (const id[])keys
|
||||
forKeys: (const id <NSCopying>[])keys
|
||||
count: (NSUInteger)count
|
||||
{
|
||||
self = [self initWithCapacity: count];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue