@@ -81,30 +81,30 @@ return [[[self alloc] initWithItemSize: itemSize capacity: capacity] autorelease]; } #ifdef OF_HAVE_FILES -+ (instancetype)dataArrayWithContentsOfFile: (OFString*)path ++ (instancetype)dataArrayWithContentsOfFile: (OFString *)path { return [[[self alloc] initWithContentsOfFile: path] autorelease]; } #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) -+ (instancetype)dataArrayWithContentsOfURL: (OFURL*)URL ++ (instancetype)dataArrayWithContentsOfURL: (OFURL *)URL { return [[[self alloc] initWithContentsOfURL: URL] autorelease]; } #endif -+ (instancetype)dataArrayWithStringRepresentation: (OFString*)string ++ (instancetype)dataArrayWithStringRepresentation: (OFString *)string { return [[[self alloc] initWithStringRepresentation: string] autorelease]; } -+ (instancetype)dataArrayWithBase64EncodedString: (OFString*)string ++ (instancetype)dataArrayWithBase64EncodedString: (OFString *)string { return [[[self alloc] initWithBase64EncodedString: string] autorelease]; } - init @@ -152,11 +152,11 @@ return self; } #ifdef OF_HAVE_FILES -- initWithContentsOfFile: (OFString*)path +- initWithContentsOfFile: (OFString *)path { @try { OFFile *file = [[OFFile alloc] initWithPath: path mode: @"rb"]; of_offset_t size = [[OFFileManager defaultManager] @@ -194,11 +194,11 @@ return self; } #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) -- initWithContentsOfURL: (OFURL*)URL +- initWithContentsOfURL: (OFURL *)URL { void *pool; OFString *scheme; pool = objc_autoreleasePoolPush(); @@ -274,11 +274,11 @@ return self; } #endif -- initWithStringRepresentation: (OFString*)string +- initWithStringRepresentation: (OFString *)string { @try { const char *cString; size_t count; @@ -326,11 +326,11 @@ } return self; } -- initWithBase64EncodedString: (OFString*)string +- initWithBase64EncodedString: (OFString *)string { self = [self initWithItemSize: 1 capacity: [string length] / 3]; @try { @@ -344,11 +344,11 @@ } return self; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { @try { void *pool = objc_autoreleasePoolPush(); OFString *stringValue; @@ -372,40 +372,40 @@ - (size_t)count { return _count; } -- (void*)items +- (void *)items { return _items; } -- (void*)itemAtIndex: (size_t)index +- (void *)itemAtIndex: (size_t)index { if (index >= _count) @throw [OFOutOfRangeException exception]; return _items + index * _itemSize; } -- (void*)firstItem +- (void *)firstItem { if (_items == NULL || _count == 0) return NULL; return _items; } -- (void*)lastItem +- (void *)lastItem { if (_items == NULL || _count == 0) return NULL; return _items + (_count - 1) * _itemSize; } -- (void)addItem: (const void*)item +- (void)addItem: (const void *)item { if (SIZE_MAX - _count < 1) @throw [OFOutOfRangeException exception]; if (_count + 1 > _capacity) { @@ -418,19 +418,19 @@ memcpy(_items + _count * _itemSize, item, _itemSize); _count++; } -- (void)insertItem: (const void*)item +- (void)insertItem: (const void *)item atIndex: (size_t)index { [self insertItems: item atIndex: index count: 1]; } -- (void)addItems: (const void*)items +- (void)addItems: (const void *)items count: (size_t)count { if (count > SIZE_MAX - _count) @throw [OFOutOfRangeException exception]; @@ -443,11 +443,11 @@ memcpy(_items + _count * _itemSize, items, count * _itemSize); _count += count; } -- (void)insertItems: (const void*)items +- (void)insertItems: (const void *)items atIndex: (size_t)index count: (size_t)count { if (count > SIZE_MAX - _count || index > _count) @throw [OFOutOfRangeException exception]; @@ -553,11 +553,11 @@ size_t count, minCount; if (![object isKindOfClass: [OFDataArray class]]) @throw [OFInvalidArgumentException exception]; - dataArray = (OFDataArray*)object; + dataArray = (OFDataArray *)object; if ([dataArray itemSize] != _itemSize) @throw [OFInvalidArgumentException exception]; count = [dataArray count]; @@ -584,18 +584,18 @@ uint32_t hash; OF_HASH_INIT(hash); for (size_t i = 0; i < _count * _itemSize; i++) - OF_HASH_ADD(hash, ((uint8_t*)_items)[i]); + OF_HASH_ADD(hash, ((uint8_t *)_items)[i]); OF_HASH_FINALIZE(hash); return hash; } -- (OFString*)description +- (OFString *)description { OFMutableString *ret = [OFMutableString stringWithString: @"<"]; for (size_t i = 0; i < _count; i++) { if (i > 0) @@ -609,11 +609,11 @@ [ret makeImmutable]; return ret; } -- (OFString*)stringRepresentation +- (OFString *)stringRepresentation { OFMutableString *ret = [OFMutableString string]; for (size_t i = 0; i < _count; i++) for (size_t j = 0; j < _itemSize; j++) @@ -621,17 +621,17 @@ [ret makeImmutable]; return ret; } -- (OFString*)stringByBase64Encoding +- (OFString *)stringByBase64Encoding { return of_base64_encode(_items, _count * _itemSize); } #ifdef OF_HAVE_FILES -- (void)writeToFile: (OFString*)path +- (void)writeToFile: (OFString *)path { OFFile *file = [[OFFile alloc] initWithPath: path mode: @"wb"]; @try { @@ -641,11 +641,11 @@ [file release]; } } #endif -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool; OFXMLElement *element; if (_itemSize != 1) @@ -662,11 +662,11 @@ objc_autoreleasePoolPop(pool); return [element autorelease]; } -- (OFDataArray*)messagePackRepresentation +- (OFDataArray *)messagePackRepresentation { OFDataArray *data; if (_itemSize != 1) @throw [OFInvalidArgumentException exception];