@@ -82,11 +82,11 @@ - initWithItemSize: (size_t)itemSize_ { self = [super init]; if (itemSize_ == 0) { - Class c = isa; + Class c = [self class]; [self release]; @throw [OFInvalidArgumentException exceptionWithClass: c selector: _cmd]; } @@ -134,11 +134,11 @@ OFAutoreleasePool *pool; OFHTTPRequest *request; OFHTTPRequestResult *result; Class c; - c = isa; + c = [self class]; [self release]; pool = [[OFAutoreleasePool alloc] init]; if ([[URL scheme] isEqual: @"file"]) { @@ -168,11 +168,11 @@ itemSize = 1; if (!of_base64_decode(self, [string cStringWithEncoding: OF_STRING_ENCODING_ASCII], [string cStringLengthWithEncoding: OF_STRING_ENCODING_ASCII])) { - Class c = isa; + Class c = [self class]; [self release]; @throw [OFInvalidEncodingException exceptionWithClass: c]; } return self; @@ -189,21 +189,21 @@ OFString *stringValue; if (![[element name] isEqual: [self className]] || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) @throw [OFInvalidArgumentException - exceptionWithClass: isa + exceptionWithClass: [self class] selector: _cmd]; stringValue = [element stringValue]; if (!of_base64_decode(self, [stringValue cStringWithEncoding: OF_STRING_ENCODING_ASCII], [stringValue cStringLengthWithEncoding: OF_STRING_ENCODING_ASCII])) @throw [OFInvalidEncodingException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; [pool release]; } @catch (id e) { [self release]; @throw e; @@ -228,11 +228,11 @@ } - (void*)itemAtIndex: (size_t)index { if (index >= count) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException exceptionWithClass: [self class]]; return data + index * itemSize; } - (void*)firstItem @@ -252,11 +252,11 @@ } - (void)addItem: (const void*)item { if (SIZE_MAX - count < 1) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException exceptionWithClass: [self class]]; data = [self resizeMemory: data size: itemSize count: count + 1]; @@ -275,11 +275,11 @@ - (void)addItemsFromCArray: (const void*)cArray count: (size_t)nItems { if (nItems > SIZE_MAX - count) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException exceptionWithClass: [self class]]; data = [self resizeMemory: data size: itemSize count: count + nItems]; @@ -290,11 +290,11 @@ - (void)insertItemsFromCArray: (const void*)cArray atIndex: (size_t)index count: (size_t)nItems { if (nItems > SIZE_MAX - count || index > count) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException exceptionWithClass: [self class]]; data = [self resizeMemory: data size: itemSize count: count + nItems]; @@ -311,11 +311,11 @@ } - (void)removeItemsInRange: (of_range_t)range { if (range.start + range.length > count) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException exceptionWithClass: [self class]]; memmove(data + range.start * itemSize, data + (range.start + range.length) * itemSize, (count - range.start - range.length) * itemSize); @@ -330,11 +330,11 @@ } - (void)removeLastItem { if (count < 1) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException exceptionWithClass: [self class]]; count--; @try { data = [self resizeMemory: data size: itemSize @@ -352,11 +352,11 @@ count = 0; } - copy { - OFDataArray *copy = [[isa alloc] initWithItemSize: itemSize]; + OFDataArray *copy = [[[self class] alloc] initWithItemSize: itemSize]; [copy addItemsFromCArray: data count: count]; return copy; @@ -385,17 +385,19 @@ OFDataArray *otherDataArray; int comparison; size_t otherCount, minimumCount; if (![object isKindOfClass: [OFDataArray class]]) - @throw [OFInvalidArgumentException exceptionWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException + exceptionWithClass: [self class] + selector: _cmd]; otherDataArray = object; if ([otherDataArray itemSize] != itemSize) - @throw [OFInvalidArgumentException exceptionWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException + exceptionWithClass: [self class] + selector: _cmd]; otherCount = [otherDataArray count]; minimumCount = (count > otherCount ? otherCount : count); if ((comparison = memcmp(data, [otherDataArray cArray], @@ -448,12 +450,13 @@ { OFAutoreleasePool *pool; OFXMLElement *element; if (itemSize != 1) - @throw [OFNotImplementedException exceptionWithClass: isa - selector: _cmd]; + @throw [OFNotImplementedException + exceptionWithClass: [self class] + selector: _cmd]; pool = [[OFAutoreleasePool alloc] init]; element = [OFXMLElement elementWithName: [self className] namespace: OF_SERIALIZATION_NS @@ -471,11 +474,11 @@ - (void)addItem: (const void*)item { size_t newSize, lastPageByte; if (SIZE_MAX - count < 1 || count + 1 > SIZE_MAX / itemSize) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException exceptionWithClass: [self class]]; lastPageByte = of_pagesize - 1; newSize = ((count + 1) * itemSize + lastPageByte) & ~lastPageByte; if (size != newSize) @@ -492,11 +495,11 @@ count: (size_t)nItems { size_t newSize, lastPageByte; if (nItems > SIZE_MAX - count || count + nItems > SIZE_MAX / itemSize) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException exceptionWithClass: [self class]]; lastPageByte = of_pagesize - 1; newSize = ((count + nItems) * itemSize + lastPageByte) & ~lastPageByte; if (size != newSize) @@ -515,11 +518,11 @@ { size_t newSize, lastPageByte; if (nItems > SIZE_MAX - count || index > count || count + nItems > SIZE_MAX / itemSize) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException exceptionWithClass: [self class]]; lastPageByte = of_pagesize - 1; newSize = ((count + nItems) * itemSize + lastPageByte) & ~lastPageByte; if (size != newSize) @@ -537,11 +540,11 @@ - (void)removeItemsInRange: (of_range_t)range { size_t newSize, lastPageByte; if (range.start + range.length > count) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException exceptionWithClass: [self class]]; memmove(data + range.start * itemSize, data + (range.start + range.length) * itemSize, (count - range.start - range.length) * itemSize); @@ -558,11 +561,11 @@ - (void)removeLastItem { size_t newSize, lastPageByte; if (count < 1) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException exceptionWithClass: [self class]]; count--; lastPageByte = of_pagesize - 1; newSize = (count * itemSize + lastPageByte) & ~lastPageByte;