@@ -49,17 +49,17 @@ equal(void *object1, void *object2) { return [(id)object1 isEqual: (id)object2]; } -static const of_map_table_functions_t keyFunctions = { +static const OFMapTableFunctions keyFunctions = { .retain = retain, .release = release, .hash = hash, .equal = equal }; -static const of_map_table_functions_t objectFunctions = { NULL }; +static const OFMapTableFunctions objectFunctions = { NULL }; @implementation OFMapTableSet - (instancetype)init { return [self initWithCapacity: 0]; @@ -98,12 +98,11 @@ self = [self initWithCapacity: count]; @try { for (id object in set) - [_mapTable setObject: (void *)1 - forKey: object]; + [_mapTable setObject: (void *)1 forKey: object]; } @catch (id e) { [self release]; @throw e; } @@ -126,39 +125,35 @@ self = [self initWithCapacity: count]; @try { for (id object in array) - [_mapTable setObject: (void *)1 - forKey: object]; + [_mapTable setObject: (void *)1 forKey: object]; } @catch (id e) { [self release]; @throw e; } return self; } -- (instancetype)initWithObjects: (id const *)objects - count: (size_t)count +- (instancetype)initWithObjects: (id const *)objects count: (size_t)count { self = [self initWithCapacity: count]; @try { for (size_t i = 0; i < count; i++) - [_mapTable setObject: (void *)1 - forKey: objects[i]]; + [_mapTable setObject: (void *)1 forKey: objects[i]]; } @catch (id e) { [self release]; @throw e; } return self; } -- (instancetype)initWithObject: (id)firstObject - arguments: (va_list)arguments +- (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { self = [super init]; @try { id object; @@ -172,16 +167,14 @@ _mapTable = [[OFMapTable alloc] initWithKeyFunctions: keyFunctions objectFunctions: objectFunctions capacity: count]; - [_mapTable setObject: (void *)1 - forKey: firstObject]; + [_mapTable setObject: (void *)1 forKey: firstObject]; while ((object = va_arg(arguments, id)) != nil) - [_mapTable setObject: (void *)1 - forKey: object]; + [_mapTable setObject: (void *)1 forKey: object]; } @catch (id e) { [self release]; @throw e; } @@ -195,15 +188,15 @@ @try { void *pool = objc_autoreleasePoolPush(); if ((![element.name isEqual: @"OFSet"] && ![element.name isEqual: @"OFMutableSet"]) || - ![element.namespace isEqual: OF_SERIALIZATION_NS]) + ![element.namespace isEqual: OFSerializationNS]) @throw [OFInvalidArgumentException exception]; for (OFXMLElement *child in - [element elementsForNamespace: OF_SERIALIZATION_NS]) { + [element elementsForNamespace: OFSerializationNS]) { void *pool2 = objc_autoreleasePoolPush(); [_mapTable setObject: (void *)1 forKey: [child objectByDeserializing]]; @@ -281,21 +274,21 @@ return [[[OFMapTableEnumeratorWrapper alloc] initWithEnumerator: [_mapTable keyEnumerator] object: self] autorelease]; } -- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state +- (int)countByEnumeratingWithState: (OFFastEnumerationState *)state objects: (id *)objects count: (int)count { return [_mapTable countByEnumeratingWithState: state objects: objects count: count]; } #ifdef OF_HAVE_BLOCKS -- (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block +- (void)enumerateObjectsUsingBlock: (OFSetEnumerationBlock)block { @try { [_mapTable enumerateKeysAndObjectsUsingBlock: ^ (void *key, void *object, bool *stop) { block(key, stop);