@@ -98,13 +98,13 @@ [_array release]; [super dealloc]; } -- (id)objectAtIndex: (size_t)index +- (id)objectAtIndex: (size_t)idx { - return [_array objectAtIndex: index]; + return [_array objectAtIndex: idx]; } - (size_t)count { return [_array count]; @@ -117,26 +117,26 @@ if (self == [SimpleMutableArray class]) [self inheritMethodsFromClass: [SimpleArray class]]; } - (void)insertObject: (id)object - atIndex: (size_t)index + atIndex: (size_t)idx { [_array insertObject: object - atIndex: index]; + atIndex: idx]; } -- (void)replaceObjectAtIndex: (size_t)index +- (void)replaceObjectAtIndex: (size_t)idx withObject: (id)object { - [_array replaceObjectAtIndex: index + [_array replaceObjectAtIndex: idx withObject: object]; } -- (void)removeObjectAtIndex: (size_t)index +- (void)removeObjectAtIndex: (size_t)idx { - [_array removeObjectAtIndex: index]; + [_array removeObjectAtIndex: idx]; } @end @implementation TestsAppDelegate (OFArrayTests) - (void)arrayTestsWithClass: (Class)arrayClass @@ -351,50 +351,50 @@ [m[0] removeLastObject]; #ifdef OF_HAVE_BLOCKS { - __block bool ok = true; + __block bool blockOk = true; __block size_t count = 0; OFArray *cmp = a[0]; OFMutableArray *a2; m[0] = [[a[0] mutableCopy] autorelease]; [m[0] enumerateObjectsUsingBlock: - ^ (id obj, size_t idx, bool *stop) { + ^ (id object, size_t idx, bool *stop) { count++; - if (![obj isEqual: [cmp objectAtIndex: idx]]) - ok = false; + if (![object isEqual: [cmp objectAtIndex: idx]]) + blockOk = false; }]; if (count != [cmp count]) - ok = false; + blockOk = false; - TEST(@"Enumeration using blocks", ok) + TEST(@"Enumeration using blocks", blockOk) - ok = false; + blockOk = false; a2 = m[0]; @try { [a2 enumerateObjectsUsingBlock: - ^ (id obj, size_t idx, bool *stop) { + ^ (id object, size_t idx, bool *stop) { [a2 removeObjectAtIndex: idx]; }]; } @catch (OFEnumerationMutationException *e) { - ok = true; + blockOk = true; } @catch (OFOutOfRangeException *e) { /* * Out of bounds access due to enumeration not being * detected. */ } TEST(@"Detection of mutation during enumeration using blocks", - ok) + blockOk) } TEST(@"-[replaceObjectsUsingBlock:]", - R([m[0] replaceObjectsUsingBlock: ^ id (id obj, size_t idx) { + R([m[0] replaceObjectsUsingBlock: ^ id (id object, size_t idx) { switch (idx) { case 0: return @"foo"; case 1: return @"bar"; @@ -402,11 +402,11 @@ return nil; }]) && [[m[0] description] isEqual: @"(\n\tfoo,\n\tbar\n)"]) TEST(@"-[mappedArrayUsingBlock:]", - [[[m[0] mappedArrayUsingBlock: ^ id (id obj, size_t idx) { + [[[m[0] mappedArrayUsingBlock: ^ id (id object, size_t idx) { switch (idx) { case 0: return @"foobar"; case 1: return @"qux"; @@ -414,12 +414,12 @@ return nil; }] description] isEqual: @"(\n\tfoobar,\n\tqux\n)"]) TEST(@"-[filteredArrayUsingBlock:]", - [[[m[0] filteredArrayUsingBlock: ^ bool (id obj, size_t idx) { - return [obj isEqual: @"foo"]; + [[[m[0] filteredArrayUsingBlock: ^ bool (id object, size_t idx) { + return [object isEqual: @"foo"]; }] description] isEqual: @"(\n\tfoo\n)"]) TEST(@"-[foldUsingBlock:]", [[arrayClass arrayWithObjects: [OFMutableString string], @"foo", @"bar", @"baz", nil] foldUsingBlock: ^ id (id left, id right) {