@@ -112,31 +112,31 @@ + (instancetype)dataWithBase64EncodedString: (OFString *)string { return [[[self alloc] initWithBase64EncodedString: string] autorelease]; } -- init +- (instancetype)init { OF_INVALID_INIT_METHOD } - (instancetype)of_init { return [super init]; } -- initWithItems: (const void *)items - count: (size_t)count +- (instancetype)initWithItems: (const void *)items + count: (size_t)count { return [self initWithItems: items itemSize: 1 count: count]; } -- initWithItems: (const void *)items - itemSize: (size_t)itemSize - count: (size_t)count +- (instancetype)initWithItems: (const void *)items + itemSize: (size_t)itemSize + count: (size_t)count { self = [super init]; @try { if (itemSize == 0) @@ -154,24 +154,24 @@ } return self; } -- initWithItemsNoCopy: (const void *)items - count: (size_t)count - freeWhenDone: (bool)freeWhenDone +- (instancetype)initWithItemsNoCopy: (const void *)items + count: (size_t)count + freeWhenDone: (bool)freeWhenDone { return [self initWithItemsNoCopy: items itemSize: 1 count: count freeWhenDone: freeWhenDone]; } -- initWithItemsNoCopy: (const void *)items - itemSize: (size_t)itemSize - count: (size_t)count - freeWhenDone: (bool)freeWhenDone +- (instancetype)initWithItemsNoCopy: (const void *)items + itemSize: (size_t)itemSize + count: (size_t)count + freeWhenDone: (bool)freeWhenDone { self = [super init]; @try { if (itemSize == 0) @@ -188,11 +188,11 @@ return self; } #ifdef OF_HAVE_FILES -- initWithContentsOfFile: (OFString *)path +- (instancetype)initWithContentsOfFile: (OFString *)path { @try { of_offset_t size = [[OFFileManager defaultManager] sizeOfFileAtPath: path]; char *buffer; @@ -231,11 +231,11 @@ return self; } #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) -- initWithContentsOfURL: (OFURL *)URL +- (instancetype)initWithContentsOfURL: (OFURL *)URL { void *pool; OFString *scheme; pool = objc_autoreleasePoolPush(); @@ -253,11 +253,11 @@ return self; } #endif -- initWithStringRepresentation: (OFString *)string +- (instancetype)initWithStringRepresentation: (OFString *)string { self = [super init]; @try { size_t count = [string @@ -307,11 +307,11 @@ } return self; } -- initWithBase64EncodedString: (OFString *)string +- (instancetype)initWithBase64EncodedString: (OFString *)string { bool mutable = [self isKindOfClass: [OFMutableData class]]; if (!mutable) { [self release]; @@ -335,11 +335,11 @@ [(OFMutableData *)self makeImmutable]; return self; } -- initWithSerialization: (OFXMLElement *)element +- (instancetype)initWithSerialization: (OFXMLElement *)element { @try { void *pool = objc_autoreleasePoolPush(); OFString *stringValue; @@ -400,16 +400,16 @@ return NULL; return _items + (_count - 1) * _itemSize; } -- copy +- (id)copy { return [self retain]; } -- mutableCopy +- (id)mutableCopy { return [[OFMutableData alloc] initWithItems: _items itemSize: _itemSize count: _count]; }