@@ -36,12 +36,12 @@ static struct { Class isa; } placeholder; @interface OFArray () -- (OFString*)OF_JSONRepresentationWithOptions: (int)options - depth: (size_t)depth; +- (OFString *)OF_JSONRepresentationWithOptions: (int)options + depth: (size_t)depth; @end @interface OFArray_placeholder: OFArray @end @@ -74,23 +74,23 @@ { return (id)[[OFArray_adjacent alloc] initWithObject: firstObject arguments: arguments]; } -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array { return (id)[[OFArray_adjacent alloc] initWithArray: array]; } -- initWithObjects: (id const*)objects +- initWithObjects: (id const *)objects count: (size_t)count { return (id)[[OFArray_adjacent alloc] initWithObjects: objects count: count]; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { return (id)[[OFArray_adjacent alloc] initWithSerialization: element]; } - retain @@ -149,16 +149,16 @@ va_end(arguments); return ret; } -+ (instancetype)arrayWithArray: (OFArray*)array ++ (instancetype)arrayWithArray: (OFArray *)array { return [[[self alloc] initWithArray: array] autorelease]; } -+ (instancetype)arrayWithObjects: (id const*)objects ++ (instancetype)arrayWithObjects: (id const *)objects count: (size_t)count { return [[[self alloc] initWithObjects: objects count: count] autorelease]; } @@ -206,39 +206,39 @@ arguments: (va_list)arguments { OF_INVALID_INIT_METHOD } -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array { OF_INVALID_INIT_METHOD } -- initWithObjects: (id const*)objects +- initWithObjects: (id const *)objects count: (size_t)count { OF_INVALID_INIT_METHOD } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { OF_INVALID_INIT_METHOD } - (size_t)count { OF_UNRECOGNIZED_SELECTOR } -- (void)getObjects: (id*)buffer +- (void)getObjects: (id *)buffer inRange: (of_range_t)range { for (size_t i = 0; i < range.length; i++) buffer[i] = [self objectAtIndex: range.location + i]; } -- (id const*)objects +- (id const *)objects { OFObject *container; size_t count; id *buffer; @@ -271,11 +271,11 @@ - (id)objectAtIndexedSubscript: (size_t)index { return [self objectAtIndex: index]; } -- (id)valueForKey: (OFString*)key +- (id)valueForKey: (OFString *)key { OFMutableArray *ret; if ([key hasPrefix: @"@"]) { void *pool = objc_autoreleasePoolPush(); @@ -304,11 +304,11 @@ return ret; } - (void)setValue: (id)value - forKey: (OFString*)key + forKey: (OFString *)key { if ([key hasPrefix: @"@"]) { void *pool = objc_autoreleasePoolPush(); key = [key substringWithRange: of_range(1, [key length] - 1)]; @@ -387,11 +387,11 @@ return [self objectAtIndex: count - 1]; return nil; } -- (OFArray*)objectsInRange: (of_range_t)range +- (OFArray *)objectsInRange: (of_range_t)range { OFArray *ret; id *buffer; if (range.length > SIZE_MAX - range.location || @@ -416,36 +416,36 @@ } return ret; } -- (OFString*)componentsJoinedByString: (OFString*)separator +- (OFString *)componentsJoinedByString: (OFString *)separator { return [self componentsJoinedByString: separator usingSelector: @selector(description) options: 0]; } -- (OFString*)componentsJoinedByString: (OFString*)separator - options: (int)options +- (OFString *)componentsJoinedByString: (OFString *)separator + options: (int)options { return [self componentsJoinedByString: separator usingSelector: @selector(description) options: options]; } -- (OFString*)componentsJoinedByString: (OFString*)separator - usingSelector: (SEL)selector +- (OFString *)componentsJoinedByString: (OFString *)separator + usingSelector: (SEL)selector { return [self componentsJoinedByString: separator usingSelector: selector options: 0]; } -- (OFString*)componentsJoinedByString: (OFString*)separator - usingSelector: (SEL)selector - options: (int)options +- (OFString *)componentsJoinedByString: (OFString *)separator + usingSelector: (SEL)selector + options: (int)options { OFMutableString *ret; if (separator == nil) @throw [OFInvalidArgumentException exception]; @@ -529,11 +529,11 @@ OF_HASH_FINALIZE(hash); return hash; } -- (OFString*)description +- (OFString *)description { void *pool; OFMutableString *ret; if ([self count] == 0) @@ -557,11 +557,11 @@ [ret makeImmutable]; return [ret autorelease]; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; if ([self isKindOfClass: [OFMutableArray class]]) @@ -584,24 +584,24 @@ objc_autoreleasePoolPop(pool); return [element autorelease]; } -- (OFString*)JSONRepresentation +- (OFString *)JSONRepresentation { return [self OF_JSONRepresentationWithOptions: 0 depth: 0]; } -- (OFString*)JSONRepresentationWithOptions: (int)options +- (OFString *)JSONRepresentationWithOptions: (int)options { return [self OF_JSONRepresentationWithOptions: options depth: 0]; } -- (OFString*)OF_JSONRepresentationWithOptions: (int)options - depth: (size_t)depth +- (OFString *)OF_JSONRepresentationWithOptions: (int)options + depth: (size_t)depth { OFMutableString *JSON = [OFMutableString stringWithString: @"["]; void *pool = objc_autoreleasePoolPush(); size_t i, count = [self count]; @@ -654,11 +654,11 @@ objc_autoreleasePoolPop(pool); return JSON; } -- (OFDataArray*)messagePackRepresentation +- (OFDataArray *)messagePackRepresentation { OFDataArray *data; size_t i, count; void *pool; @@ -720,11 +720,11 @@ for (id object in self) [object performSelector: selector withObject: object]; } -- (OFArray*)sortedArray +- (OFArray *)sortedArray { OFMutableArray *new = [[self mutableCopy] autorelease]; [new sort]; @@ -731,11 +731,11 @@ [new makeImmutable]; return new; } -- (OFArray*)sortedArrayWithOptions: (int)options +- (OFArray *)sortedArrayWithOptions: (int)options { OFMutableArray *new = [[self mutableCopy] autorelease]; [new sortWithOptions: options]; @@ -742,11 +742,11 @@ [new makeImmutable]; return new; } -- (OFArray*)reversedArray +- (OFArray *)reversedArray { OFMutableArray *new = [[self mutableCopy] autorelease]; [new reverse]; @@ -753,12 +753,12 @@ [new makeImmutable]; return new; } -- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state - objects: (id*)objects +- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state + objects: (id *)objects count: (int)count { of_range_t range = of_range(state->state, count); if (range.length > SIZE_MAX - range.location) @@ -773,16 +773,16 @@ if (range.location + range.length > ULONG_MAX) @throw [OFOutOfRangeException exception]; state->state = (unsigned long)(range.location + range.length); state->itemsPtr = objects; - state->mutationsPtr = (unsigned long*)self; + state->mutationsPtr = (unsigned long *)self; return (int)range.length; } -- (OFEnumerator*)objectEnumerator +- (OFEnumerator *)objectEnumerator { return [[[OFArrayEnumerator alloc] initWithArray: self mutationsPtr: NULL] autorelease]; } @@ -799,11 +799,11 @@ break; } } #endif -- (OFArray*)arrayByAddingObject: (id)object +- (OFArray *)arrayByAddingObject: (id)object { OFMutableArray *ret; if (object == nil) @throw [OFInvalidArgumentException exception]; @@ -814,21 +814,21 @@ [ret makeImmutable]; return ret; } -- (OFArray*)arrayByAddingObjectsFromArray: (OFArray*)array +- (OFArray *)arrayByAddingObjectsFromArray: (OFArray *)array { OFMutableArray *ret = [[self mutableCopy] autorelease]; [ret addObjectsFromArray: array]; [ret makeImmutable]; return ret; } -- (OFArray*)arrayByRemovingObject: (id)object +- (OFArray *)arrayByRemovingObject: (id)object { OFMutableArray *ret = [[self mutableCopy] autorelease]; [ret removeObject: object]; [ret makeImmutable]; @@ -835,11 +835,11 @@ return ret; } #ifdef OF_HAVE_BLOCKS -- (OFArray*)mappedArrayUsingBlock: (of_array_map_block_t)block +- (OFArray *)mappedArrayUsingBlock: (of_array_map_block_t)block { OFArray *ret; size_t count = [self count]; id *tmp = [self allocMemoryWithSize: sizeof(id) count: count]; @@ -857,11 +857,11 @@ } return ret; } -- (OFArray*)filteredArrayUsingBlock: (of_array_filter_block_t)block +- (OFArray *)filteredArrayUsingBlock: (of_array_filter_block_t)block { OFArray *ret; size_t count = [self count]; id *tmp = [self allocMemoryWithSize: sizeof(id) count: count]; @@ -915,12 +915,12 @@ } #endif @end @implementation OFArrayEnumerator -- initWithArray: (OFArray*)array - mutationsPtr: (unsigned long*)mutationsPtr +- initWithArray: (OFArray *)array + mutationsPtr: (unsigned long *)mutationsPtr { self = [super init]; _array = [array retain]; _count = [array count];