Index: src/OFApplication.h ================================================================== --- src/OFApplication.h +++ src/OFApplication.h @@ -130,11 +130,11 @@ /** * \brief Returns the only OFApplication instance in the application. * * \return The only OFApplication instance in the application */ -+ sharedApplication; ++ (OFApplication*)sharedApplication; /** * \brief Returns the name of the program (argv[0]). * * \return The name of the program (argv[0]) Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -83,11 +83,11 @@ return 0; } @implementation OFApplication -+ sharedApplication ++ (OFApplication*)sharedApplication { if (app == nil) app = [[self alloc] init]; return app; Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -51,46 +51,46 @@ /** * \brief Creates a new OFArray. * * \return A new autoreleased OFArray */ -+ array; ++ (instancetype)array; /** * \brief Creates a new OFArray with the specified object. * * \param object An object * \return A new autoreleased OFArray */ -+ arrayWithObject: (id)object; ++ (instancetype)arrayWithObject: (id)object; /** * \brief Creates a new OFArray with the specified objects, terminated by nil. * * \param firstObject The first object in the array * \return A new autoreleased OFArray */ -+ arrayWithObjects: (id)firstObject, ...; ++ (instancetype)arrayWithObjects: (id)firstObject, ...; /** * \brief Creates a new OFArray with the objects from the specified array. * * \param array An array * \return A new autoreleased OFArray */ -+ arrayWithArray: (OFArray*)array; ++ (instancetype)arrayWithArray: (OFArray*)array; /** * \brief Creates a new OFArray with the objects from the specified C array of * the specified length. * * \param objects A C array of objects * \param length The length of the C array * \return A new autoreleased OFArray */ -+ arrayWithObjects: (id const*)objects - count: (size_t)count; ++ (instancetype)arrayWithObjects: (id const*)objects + count: (size_t)count; /** * \brief Initializes an OFArray with the specified object. * * \param object An object Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -122,21 +122,21 @@ return (id)&placeholder; return [super alloc]; } -+ array ++ (instancetype)array { return [[[self alloc] init] autorelease]; } -+ arrayWithObject: (id)object ++ (instancetype)arrayWithObject: (id)object { return [[[self alloc] initWithObject: object] autorelease]; } -+ arrayWithObjects: (id)firstObject, ... ++ (instancetype)arrayWithObjects: (id)firstObject, ... { id ret; va_list arguments; va_start(arguments, firstObject); @@ -145,17 +145,17 @@ va_end(arguments); return ret; } -+ arrayWithArray: (OFArray*)array ++ (instancetype)arrayWithArray: (OFArray*)array { return [[[self alloc] initWithArray: array] autorelease]; } -+ arrayWithObjects: (id const*)objects - count: (size_t)count ++ (instancetype)arrayWithObjects: (id const*)objects + count: (size_t)count { return [[[self alloc] initWithObjects: objects count: count] autorelease]; } Index: src/OFArray_subarray.h ================================================================== --- src/OFArray_subarray.h +++ src/OFArray_subarray.h @@ -20,10 +20,10 @@ { OFArray *array; of_range_t range; } -+ arrayWithArray: (OFArray*)array - range: (of_range_t)range; ++ (instancetype)arrayWithArray: (OFArray*)array + range: (of_range_t)range; - initWithArray: (OFArray*)array range: (of_range_t)range; @end Index: src/OFArray_subarray.m ================================================================== --- src/OFArray_subarray.m +++ src/OFArray_subarray.m @@ -19,12 +19,12 @@ #import "OFArray_subarray.h" #import "OFOutOfRangeException.h" @implementation OFArray_subarray -+ arrayWithArray: (OFArray*)array - range: (of_range_t)range ++ (instancetype)arrayWithArray: (OFArray*)array + range: (of_range_t)range { return [[[self alloc] initWithArray: array range: range] autorelease]; } Index: src/OFDataArray+Hashing.m ================================================================== --- src/OFDataArray+Hashing.m +++ src/OFDataArray+Hashing.m @@ -56,11 +56,11 @@ } - (OFString*)SHA1Hash { void *pool = objc_autoreleasePoolPush(); - OFMD5Hash *hash = [OFSHA1Hash hash]; + OFSHA1Hash *hash = [OFSHA1Hash hash]; uint8_t *digest; char cString[OF_SHA1_DIGEST_SIZE * 2]; size_t i; [hash updateWithBuffer: data Index: src/OFDataArray.h ================================================================== --- src/OFDataArray.h +++ src/OFDataArray.h @@ -45,55 +45,55 @@ /** * \brief Creates a new OFDataArray with an item size of 1. * * \return A new autoreleased OFDataArray */ -+ dataArray; ++ (instancetype)dataArray; /** * \brief Creates a new OFDataArray whose items all have the same size. * * \param itemSize The size of each element in the OFDataArray * \return A new autoreleased OFDataArray */ -+ dataArrayWithItemSize: (size_t)itemSize; ++ (instancetype)dataArrayWithItemSize: (size_t)itemSize; /** * \brief Creates a new OFDataArary with an item size of 1, containing the data * of the specified file. * * \param path The path of the file * \return A new autoreleased OFDataArray */ -+ dataArrayWithContentsOfFile: (OFString*)path; ++ (instancetype)dataArrayWithContentsOfFile: (OFString*)path; /** * \brief Creates a new OFDataArray with an item size of 1, containing the data * of the specified URL. * * \param URL The URL to the contents for the OFDataArray * \return A new autoreleased OFDataArray */ -+ dataArrayWithContentsOfURL: (OFURL*)URL; ++ (instancetype)dataArrayWithContentsOfURL: (OFURL*)URL; /** * \brief Creates a new OFDataArray with an item size of 1, containing the data * of the string representation. * * \param string The string representation of the data * \return A new autoreleased OFDataArray */ -+ dataArrayWithStringRepresentation: (OFString*)string; ++ (instancetype)dataArrayWithStringRepresentation: (OFString*)string; /** * \brief Creates a new OFDataArray with an item size of 1, containing the data * of the Base64-encoded string. * * \param string The string with the Base64-encoded data * \return A new autoreleased OFDataArray */ -+ dataArrayWithBase64EncodedString: (OFString*)string; ++ (instancetype)dataArrayWithBase64EncodedString: (OFString*)string; /** * \brief Initializes an already allocated OFDataArray with an item size of 1. * * \return A initialized OFDataArray Index: src/OFDataArray.m ================================================================== --- src/OFDataArray.m +++ src/OFDataArray.m @@ -43,37 +43,37 @@ { _OFDataArray_Hashing_reference = 1; } @implementation OFDataArray -+ dataArray ++ (instancetype)dataArray { return [[[self alloc] init] autorelease]; } -+ dataArrayWithItemSize: (size_t)itemSize ++ (instancetype)dataArrayWithItemSize: (size_t)itemSize { return [[[self alloc] initWithItemSize: itemSize] autorelease]; } -+ dataArrayWithContentsOfFile: (OFString*)path ++ (instancetype)dataArrayWithContentsOfFile: (OFString*)path { return [[[self alloc] initWithContentsOfFile: path] autorelease]; } -+ dataArrayWithContentsOfURL: (OFURL*)URL ++ (instancetype)dataArrayWithContentsOfURL: (OFURL*)URL { return [[[self alloc] initWithContentsOfURL: URL] autorelease]; } -+ dataArrayWithStringRepresentation: (OFString*)string ++ (instancetype)dataArrayWithStringRepresentation: (OFString*)string { return [[[self alloc] initWithStringRepresentation: string] autorelease]; } -+ dataArrayWithBase64EncodedString: (OFString*)string ++ (instancetype)dataArrayWithBase64EncodedString: (OFString*)string { return [[[self alloc] initWithBase64EncodedString: string] autorelease]; } - init Index: src/OFDate.h ================================================================== --- src/OFDate.h +++ src/OFDate.h @@ -31,28 +31,28 @@ /** * \brief Creates a new OFDate with the current date and time. * * \return A new, autoreleased OFDate with the current date and time */ -+ date; ++ (instancetype)date; /** * \brief Creates a new OFDate with the specified date and time since * 1970-01-01T00:00:00Z. * * \param seconds The seconds since 1970-01-01T00:00:00Z * \return A new, autoreleased OFDate with the specified date and time */ -+ dateWithTimeIntervalSince1970: (double)seconds; ++ (instancetype)dateWithTimeIntervalSince1970: (double)seconds; /** * \brief Creates a new OFDate with the specified date and time since now. * * \param seconds The seconds since now * \return A new, autoreleased OFDate with the specified date and time */ -+ dateWithTimeIntervalSinceNow: (double)seconds; ++ (instancetype)dateWithTimeIntervalSinceNow: (double)seconds; /** * \brief Creates a new OFDate with the specified string in the specified * format. * @@ -66,12 +66,12 @@ * * \param string The string describing the date * \param format The format of the string describing the date * \return A new, autoreleased OFDate with the specified date and time */ -+ dateWithDateString: (OFString*)string - format: (OFString*)format; ++ (instancetype)dateWithDateString: (OFString*)string + format: (OFString*)format; /** * \brief Creates a new OFDate with the specified string in the specified * format. * @@ -82,30 +82,30 @@ * * \param string The string describing the date * \param format The format of the string describing the date * \return A new, autoreleased OFDate with the specified date and time */ -+ dateWithLocalDateString: (OFString*)string - format: (OFString*)format; ++ (instancetype)dateWithLocalDateString: (OFString*)string + format: (OFString*)format; /** * \brief Returns a date in the distant future. * * The date is system-dependant. * * \return A date in the distant future */ -+ distantFuture; ++ (instancetype)distantFuture; /** * \brief Returns a date in the distant past. * * The date is system-dependant. * * \return A date in the distant past */ -+ distantPast; ++ (instancetype)distantPast; /** * \brief Initializes an already allocated OFDate with the specified date and * time since 1970-01-01T00:00:00Z. * Index: src/OFDate.m ================================================================== --- src/OFDate.m +++ src/OFDate.m @@ -167,48 +167,48 @@ if (self == [OFDate class]) mutex = [[OFMutex alloc] init]; } #endif -+ date ++ (instancetype)date { return [[[self alloc] init] autorelease]; } -+ dateWithTimeIntervalSince1970: (double)seconds ++ (instancetype)dateWithTimeIntervalSince1970: (double)seconds { return [[[self alloc] initWithTimeIntervalSince1970: seconds] autorelease]; } -+ dateWithTimeIntervalSinceNow: (double)seconds ++ (instancetype)dateWithTimeIntervalSinceNow: (double)seconds { return [[[self alloc] initWithTimeIntervalSinceNow: seconds] autorelease]; } -+ dateWithDateString: (OFString*)string - format: (OFString*)format ++ (instancetype)dateWithDateString: (OFString*)string + format: (OFString*)format { return [[[self alloc] initWithDateString: string format: format] autorelease]; } -+ dateWithLocalDateString: (OFString*)string - format: (OFString*)format ++ (instancetype)dateWithLocalDateString: (OFString*)string + format: (OFString*)format { return [[[self alloc] initWithLocalDateString: string format: format] autorelease]; } -+ distantFuture ++ (instancetype)distantFuture { return [[[self alloc] initWithTimeIntervalSince1970: DBL_MAX] autorelease]; } -+ distantPast ++ (instancetype)distantPast { return [[[self alloc] initWithTimeIntervalSince1970: DBL_MIN] autorelease]; } Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -51,59 +51,59 @@ /** * \brief Creates a new OFDictionary. * * \return A new autoreleased OFDictionary */ -+ dictionary; ++ (instancetype)dictionary; /** * \brief Creates a new OFDictionary with the specified dictionary. * * \param dictionary An OFDictionary * \return A new autoreleased OFDictionary */ -+ dictionaryWithDictionary: (OFDictionary*)dictionary; ++ (instancetype)dictionaryWithDictionary: (OFDictionary*)dictionary; /** * \brief Creates a new OFDictionary with the specified key and object. * * \param key The key * \param object The object * \return A new autoreleased OFDictionary */ -+ dictionaryWithObject: (id)object - forKey: (id)key; ++ (instancetype)dictionaryWithObject: (id)object + forKey: (id)key; /** * \brief Creates a new OFDictionary with the specified keys and objects. * * \param keys An array of keys * \param objects An array of objects * \return A new autoreleased OFDictionary */ -+ dictionaryWithObjects: (OFArray*)objects - forKeys: (OFArray*)keys; ++ (instancetype)dictionaryWithObjects: (OFArray*)objects + forKeys: (OFArray*)keys; /** * \brief Creates a new OFDictionary with the specified keys and objects. * * \param keys An array of keys * \param objects An array of objects * \param count The number of objects in the arrays * \return A new autoreleased OFDictionary */ -+ dictionaryWithObjects: (id const*)objects - forKeys: (id const*)keys ++ (instancetype)dictionaryWithObjects: (id const*)objects + forKeys: (id const*)keys count: (size_t)count; /** * \brief Creates a new OFDictionary with the specified keys objects. * * \param firstKey The first key * \return A new autoreleased OFDictionary */ -+ dictionaryWithKeysAndObjects: (id)firstKey, ...; ++ (instancetype)dictionaryWithKeysAndObjects: (id)firstKey, ...; /** * \brief Initializes an already allocated OFDictionary. * * \return An initialized OFDictionary Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -132,44 +132,44 @@ return (id)&placeholder; return [super alloc]; } -+ dictionary ++ (instancetype)dictionary { return [[[self alloc] init] autorelease]; } -+ dictionaryWithDictionary: (OFDictionary*)dictionary ++ (instancetype)dictionaryWithDictionary: (OFDictionary*)dictionary { return [[[self alloc] initWithDictionary: dictionary] autorelease]; } -+ dictionaryWithObject: (id)object - forKey: (id)key ++ (instancetype)dictionaryWithObject: (id)object + forKey: (id)key { return [[[self alloc] initWithObject: object forKey: key] autorelease]; } -+ dictionaryWithObjects: (OFArray*)objects - forKeys: (OFArray*)keys ++ (instancetype)dictionaryWithObjects: (OFArray*)objects + forKeys: (OFArray*)keys { return [[[self alloc] initWithObjects: objects forKeys: keys] autorelease]; } -+ dictionaryWithObjects: (id const*)objects - forKeys: (id const*)keys ++ (instancetype)dictionaryWithObjects: (id const*)objects + forKeys: (id const*)keys count: (size_t)count { return [[[self alloc] initWithObjects: objects forKeys: keys count: count] autorelease]; } -+ dictionaryWithKeysAndObjects: (id)firstKey, ... ++ (instancetype)dictionaryWithKeysAndObjects: (id)firstKey, ... { id ret; va_list arguments; va_start(arguments, firstKey); Index: src/OFFile.h ================================================================== --- src/OFFile.h +++ src/OFFile.h @@ -51,21 +51,21 @@ * * \param path The path to the file to open as a string * \param mode The mode in which the file should be opened as a string * \return A new autoreleased OFFile */ -+ fileWithPath: (OFString*)path - mode: (OFString*)mode; ++ (instancetype)fileWithPath: (OFString*)path + mode: (OFString*)mode; /** * \brief Creates a new OFFile with the specified file descriptor. * * \param fileDescriptor A file descriptor, returned from for example open(). * It is not closed when the OFFile object is deallocated! * \return A new autoreleased OFFile */ -+ fileWithFileDescriptor: (int)fileDescriptor; ++ (instancetype)fileWithFileDescriptor: (int)fileDescriptor; /** * \brief Returns the path fo the current working directory. * * \return The path of the current working directory Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -171,18 +171,18 @@ @throw [OFInitializationFailedException exceptionWithClass: self]; } #endif -+ fileWithPath: (OFString*)path - mode: (OFString*)mode ++ (instancetype)fileWithPath: (OFString*)path + mode: (OFString*)mode { return [[[self alloc] initWithPath: path mode: mode] autorelease]; } -+ fileWithFileDescriptor: (int)filedescriptor ++ (instancetype)fileWithFileDescriptor: (int)filedescriptor { return [[[self alloc] initWithFileDescriptor: filedescriptor] autorelease]; } Index: src/OFHTTPRequest.h ================================================================== --- src/OFHTTPRequest.h +++ src/OFHTTPRequest.h @@ -127,19 +127,19 @@ /** * \brief Creates a new OFHTTPRequest. * * \return A new, autoreleased OFHTTPRequest */ -+ request; ++ (instancetype)request; /** * \brief Creates a new OFHTTPRequest with the specified URL. * * \param URL The URL for the request * \return A new, autoreleased OFHTTPRequest */ -+ requestWithURL: (OFURL*)URL; ++ (instancetype)requestWithURL: (OFURL*)URL; /** * \brief Initializes an already allocated OFHTTPRequest with the specified URL. * * \param URL The URL for the request Index: src/OFHTTPRequest.m ================================================================== --- src/OFHTTPRequest.m +++ src/OFHTTPRequest.m @@ -61,16 +61,16 @@ str++; } } @implementation OFHTTPRequest -+ request ++ (instancetype)request { return [[[self alloc] init] autorelease]; } -+ requestWithURL: (OFURL*)URL ++ (instancetype)requestWithURL: (OFURL*)URL { return [[[self alloc] initWithURL: URL] autorelease]; } - init Index: src/OFHash.h ================================================================== --- src/OFHash.h +++ src/OFHash.h @@ -31,11 +31,11 @@ /** * \brief Creates a new hash. * * \return A new autoreleased OFHash */ -+ hash; ++ (instancetype)hash; /** * \brief Returns the digest size of the hash, in bytes. * * \return The digest size of the hash, in bytes Index: src/OFHash.m ================================================================== --- src/OFHash.m +++ src/OFHash.m @@ -19,11 +19,11 @@ #import "OFHash.h" #import "OFNotImplementedException.h" @implementation OFHash -+ hash ++ (instancetype)hash { return [[[self alloc] init] autorelease]; } + (size_t)digestSize Index: src/OFIntrospection.h ================================================================== --- src/OFIntrospection.h +++ src/OFIntrospection.h @@ -118,11 +118,11 @@ /** * \brief Creates a new introspection for the specified class. * * \return A new, autoreleased introspection for the specified class */ -+ introspectionWithClass: (Class)class_; ++ (instancetype)introspectionWithClass: (Class)class_; /** * \brief Initializes an already allocated OFIntrospection with the specified * class. * Index: src/OFIntrospection.m ================================================================== --- src/OFIntrospection.m +++ src/OFIntrospection.m @@ -165,11 +165,11 @@ name, typeEncoding, offset]; } @end @implementation OFIntrospection -+ introspectionWithClass: (Class)class ++ (instancetype)introspectionWithClass: (Class)class { return [[[self alloc] initWithClass: class] autorelease]; } - initWithClass: (Class)class Index: src/OFList.h ================================================================== --- src/OFList.h +++ src/OFList.h @@ -54,11 +54,11 @@ /** * \brief Creates a new OFList. * * \return A new autoreleased OFList */ -+ list; ++ (instancetype)list; /** * \brief Returns the first list object of the list. * * \return The first list object of the list Index: src/OFList.m ================================================================== --- src/OFList.m +++ src/OFList.m @@ -28,11 +28,11 @@ #import "autorelease.h" #import "macros.h" @implementation OFList -+ list ++ (instancetype)list { return [[[self alloc] init] autorelease]; } - initWithSerialization: (OFXMLElement*)element Index: src/OFNull.h ================================================================== --- src/OFNull.h +++ src/OFNull.h @@ -25,7 +25,7 @@ /** * \brief Returns an OFNull singleton. * * \return An OFNull singleton */ -+ null; ++ (OFNull*)null; @end Index: src/OFNull.m ================================================================== --- src/OFNull.m +++ src/OFNull.m @@ -26,11 +26,11 @@ #import "autorelease.h" static OFNull *null = nil; @implementation OFNull -+ null ++ (OFNull*)null { if (null != nil) return null; null = [[self alloc] init]; Index: src/OFNumber.h ================================================================== --- src/OFNumber.h +++ src/OFNumber.h @@ -105,211 +105,211 @@ * \brief Creates a new OFNumber with the specified BOOL. * * \param bool_ A BOOL which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithBool: (BOOL)bool_; ++ (instancetype)numberWithBool: (BOOL)bool_; /** * \brief Creates a new OFNumber with the specified signed char. * * \param char_ A signed char which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithChar: (signed char)char_; ++ (instancetype)numberWithChar: (signed char)char_; /** * \brief Creates a new OFNumber with the specified signed short. * * \param short_ A signed short which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithShort: (signed short)short_; ++ (instancetype)numberWithShort: (signed short)short_; /** * \brief Creates a new OFNumber with the specified signed int. * * \param int_ A signed int which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithInt: (signed int)int_; ++ (instancetype)numberWithInt: (signed int)int_; /** * \brief Creates a new OFNumber with the specified signed long. * * \param long_ A signed long which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithLong: (signed long)long_; ++ (instancetype)numberWithLong: (signed long)long_; /** * \brief Creates a new OFNumber with the specified unsigned char. * * \param uchar An unsigned char which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithUnsignedChar: (unsigned char)uchar; ++ (instancetype)numberWithUnsignedChar: (unsigned char)uchar; /** * \brief Creates a new OFNumber with the specified unsigned short. * * \param ushort An unsigned short which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithUnsignedShort: (unsigned short)ushort; ++ (instancetype)numberWithUnsignedShort: (unsigned short)ushort; /** * \brief Creates a new OFNumber with the specified unsigned int. * * \param uint An unsigned int which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithUnsignedInt: (unsigned int)uint; ++ (instancetype)numberWithUnsignedInt: (unsigned int)uint; /** * \brief Creates a new OFNumber with the specified unsigned long. * * \param ulong An unsigned long which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithUnsignedLong: (unsigned long)ulong; ++ (instancetype)numberWithUnsignedLong: (unsigned long)ulong; /** * \brief Creates a new OFNumber with the specified int8_t. * * \param int8 An int8_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithInt8: (int8_t)int8; ++ (instancetype)numberWithInt8: (int8_t)int8; /** * \brief Creates a new OFNumber with the specified int16_t. * * \param int16 An int16_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithInt16: (int16_t)int16; ++ (instancetype)numberWithInt16: (int16_t)int16; /** * \brief Creates a new OFNumber with the specified int32_t. * * \param int32 An int32_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithInt32: (int32_t)int32; ++ (instancetype)numberWithInt32: (int32_t)int32; /** * \brief Creates a new OFNumber with the specified int64_t. * * \param int64 An int64_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithInt64: (int64_t)int64; ++ (instancetype)numberWithInt64: (int64_t)int64; /** * \brief Creates a new OFNumber with the specified uint8_t. * * \param uint8 A uint8_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithUInt8: (uint8_t)uint8; ++ (instancetype)numberWithUInt8: (uint8_t)uint8; /** * \brief Creates a new OFNumber with the specified uint16_t. * * \param uint16 A uint16_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithUInt16: (uint16_t)uint16; ++ (instancetype)numberWithUInt16: (uint16_t)uint16; /** * \brief Creates a new OFNumber with the specified uint32_t. * * \param uint32 A uint32_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithUInt32: (uint32_t)uint32; ++ (instancetype)numberWithUInt32: (uint32_t)uint32; /** * \brief Creates a new OFNumber with the specified uint64_t. * * \param uint64 A uint64_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithUInt64: (uint64_t)uint64; ++ (instancetype)numberWithUInt64: (uint64_t)uint64; /** * \brief Creates a new OFNumber with the specified size_t. * * \param size A size_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithSize: (size_t)size; ++ (instancetype)numberWithSize: (size_t)size; /** * \brief Creates a new OFNumber with the specified ssize_t. * * \param ssize An ssize_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithSSize: (ssize_t)ssize; ++ (instancetype)numberWithSSize: (ssize_t)ssize; /** * \brief Creates a new OFNumber with the specified intmax_t. * * \param intmax An intmax_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithIntMax: (intmax_t)intmax; ++ (instancetype)numberWithIntMax: (intmax_t)intmax; /** * \brief Creates a new OFNumber with the specified uintmax_t. * * \param uintmax A uintmax_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithUIntMax: (uintmax_t)uintmax; ++ (instancetype)numberWithUIntMax: (uintmax_t)uintmax; /** * \brief Creates a new OFNumber with the specified ptrdiff_t. * * \param ptrdiff A ptrdiff_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithPtrDiff: (ptrdiff_t)ptrdiff; ++ (instancetype)numberWithPtrDiff: (ptrdiff_t)ptrdiff; /** * \brief Creates a new OFNumber with the specified intptr_t. * * \param intptr An intptr_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithIntPtr: (intptr_t)intptr; ++ (instancetype)numberWithIntPtr: (intptr_t)intptr; /** * \brief Creates a new OFNumber with the specified uintptr_t. * * \param uintptr A uintptr_t which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithUIntPtr: (uintptr_t)uintptr; ++ (instancetype)numberWithUIntPtr: (uintptr_t)uintptr; /** * \brief Creates a new OFNumber with the specified float. * * \param float_ A float which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithFloat: (float)float_; ++ (instancetype)numberWithFloat: (float)float_; /** * \brief Creates a new OFNumber with the specified double. * * \param double_ A double which the OFNumber should contain * \return A new autoreleased OFNumber */ -+ numberWithDouble: (double)double_; ++ (instancetype)numberWithDouble: (double)double_; /** * \brief Initializes an already allocated OFNumber with the specified BOOL. * * \param bool_ A BOOL which the OFNumber should contain Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -316,136 +316,136 @@ @throw [OFInvalidFormatException \ exceptionWithClass: [self class]]; \ } @implementation OFNumber -+ numberWithBool: (BOOL)bool_ ++ (instancetype)numberWithBool: (BOOL)bool_ { return [[[self alloc] initWithBool: bool_] autorelease]; } -+ numberWithChar: (signed char)char_ ++ (instancetype)numberWithChar: (signed char)char_ { return [[[self alloc] initWithChar: char_] autorelease]; } -+ numberWithShort: (signed short)short_ ++ (instancetype)numberWithShort: (signed short)short_ { return [[[self alloc] initWithShort: short_] autorelease]; } -+ numberWithInt: (signed int)int_ ++ (instancetype)numberWithInt: (signed int)int_ { return [[[self alloc] initWithInt: int_] autorelease]; } -+ numberWithLong: (signed long)long_ ++ (instancetype)numberWithLong: (signed long)long_ { return [[[self alloc] initWithLong: long_] autorelease]; } -+ numberWithUnsignedChar: (unsigned char)uchar ++ (instancetype)numberWithUnsignedChar: (unsigned char)uchar { return [[[self alloc] initWithUnsignedChar: uchar] autorelease]; } -+ numberWithUnsignedShort: (unsigned short)ushort ++ (instancetype)numberWithUnsignedShort: (unsigned short)ushort { return [[[self alloc] initWithUnsignedShort: ushort] autorelease]; } -+ numberWithUnsignedInt: (unsigned int)uint ++ (instancetype)numberWithUnsignedInt: (unsigned int)uint { return [[[self alloc] initWithUnsignedInt: uint] autorelease]; } -+ numberWithUnsignedLong: (unsigned long)ulong ++ (instancetype)numberWithUnsignedLong: (unsigned long)ulong { return [[[self alloc] initWithUnsignedLong: ulong] autorelease]; } -+ numberWithInt8: (int8_t)int8 ++ (instancetype)numberWithInt8: (int8_t)int8 { return [[[self alloc] initWithInt8: int8] autorelease]; } -+ numberWithInt16: (int16_t)int16 ++ (instancetype)numberWithInt16: (int16_t)int16 { return [[[self alloc] initWithInt16: int16] autorelease]; } -+ numberWithInt32: (int32_t)int32 ++ (instancetype)numberWithInt32: (int32_t)int32 { return [[[self alloc] initWithInt32: int32] autorelease]; } -+ numberWithInt64: (int64_t)int64 ++ (instancetype)numberWithInt64: (int64_t)int64 { return [[[self alloc] initWithInt64: int64] autorelease]; } -+ numberWithUInt8: (uint8_t)uint8 ++ (instancetype)numberWithUInt8: (uint8_t)uint8 { return [[[self alloc] initWithUInt8: uint8] autorelease]; } -+ numberWithUInt16: (uint16_t)uint16 ++ (instancetype)numberWithUInt16: (uint16_t)uint16 { return [[[self alloc] initWithUInt16: uint16] autorelease]; } -+ numberWithUInt32: (uint32_t)uint32 ++ (instancetype)numberWithUInt32: (uint32_t)uint32 { return [[[self alloc] initWithUInt32: uint32] autorelease]; } -+ numberWithUInt64: (uint64_t)uint64 ++ (instancetype)numberWithUInt64: (uint64_t)uint64 { return [[[self alloc] initWithUInt64: uint64] autorelease]; } -+ numberWithSize: (size_t)size ++ (instancetype)numberWithSize: (size_t)size { return [[[self alloc] initWithSize: size] autorelease]; } -+ numberWithSSize: (ssize_t)ssize ++ (instancetype)numberWithSSize: (ssize_t)ssize { return [[[self alloc] initWithSSize: ssize] autorelease]; } -+ numberWithIntMax: (intmax_t)intmax ++ (instancetype)numberWithIntMax: (intmax_t)intmax { return [[[self alloc] initWithIntMax: intmax] autorelease]; } -+ numberWithUIntMax: (uintmax_t)uintmax ++ (instancetype)numberWithUIntMax: (uintmax_t)uintmax { return [[[self alloc] initWithUIntMax: uintmax] autorelease]; } -+ numberWithPtrDiff: (ptrdiff_t)ptrdiff ++ (instancetype)numberWithPtrDiff: (ptrdiff_t)ptrdiff { return [[[self alloc] initWithPtrDiff: ptrdiff] autorelease]; } -+ numberWithIntPtr: (intptr_t)intptr ++ (instancetype)numberWithIntPtr: (intptr_t)intptr { return [[[self alloc] initWithIntPtr: intptr] autorelease]; } -+ numberWithUIntPtr: (uintptr_t)uintptr ++ (instancetype)numberWithUIntPtr: (uintptr_t)uintptr { return [[[self alloc] initWithUIntPtr: uintptr] autorelease]; } -+ numberWithFloat: (float)float_ ++ (instancetype)numberWithFloat: (float)float_ { return [[[self alloc] initWithFloat: float_] autorelease]; } -+ numberWithDouble: (double)double_ ++ (instancetype)numberWithDouble: (double)double_ { return [[[self alloc] initWithDouble: double_] autorelease]; } - init Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -49,16 +49,18 @@ #if defined(__clang__) # define OF_HAVE_PROPERTIES # define OF_HAVE_OPTIONAL_PROTOCOLS # define OF_HAVE_FAST_ENUMERATION -#elif defined(__GNUC__) -# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -# define OF_HAVE_PROPERTIES -# define OF_HAVE_OPTIONAL_PROTOCOLS -# define OF_HAVE_FAST_ENUMERATION -# endif +#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC__) >= 406 +# define OF_HAVE_PROPERTIES +# define OF_HAVE_OPTIONAL_PROTOCOLS +# define OF_HAVE_FAST_ENUMERATION +#endif + +#if !__has_feature(objc_instancetype) +# define instancetype id #endif #if __has_feature(blocks) # define OF_HAVE_BLOCKS #endif Index: src/OFProcess.h ================================================================== --- src/OFProcess.h +++ src/OFProcess.h @@ -50,11 +50,11 @@ * * \param program The program to execute. If it does not start with a slash, the * search path specified in PATH is used. * \return A new, autoreleased OFProcess. */ -+ processWithProgram: (OFString*)program; ++ (instancetype)processWithProgram: (OFString*)program; /** * \brief Creates a new OFProcess with the specified program and arguments and * invokes the program. * @@ -61,12 +61,12 @@ * \param program The program to execute. If it does not start with a slash, the * search path specified in PATH is used. * \param arguments The arguments to pass to the program, or nil * \return A new, autoreleased OFProcess. */ -+ processWithProgram: (OFString*)program - arguments: (OFArray*)arguments; ++ (instancetype)processWithProgram: (OFString*)program + arguments: (OFArray*)arguments; /** * \brief Creates a new OFProcess with the specified program, program name and * arguments and invokes the program. * @@ -75,13 +75,13 @@ * \param programName The program name for the program to invoke (argv[0]). * Usually, this is equal to program. * \param arguments The arguments to pass to the program, or nil * \return A new, autoreleased OFProcess. */ -+ processWithProgram: (OFString*)program - programName: (OFString*)programName - arguments: (OFArray*)arguments; ++ (instancetype)processWithProgram: (OFString*)program + programName: (OFString*)programName + arguments: (OFArray*)arguments; /** * \brief Initializes an already allocated OFProcess with the specified program * and invokes the program. * Index: src/OFProcess.m ================================================================== --- src/OFProcess.m +++ src/OFProcess.m @@ -36,25 +36,25 @@ #endif #import "autorelease.h" @implementation OFProcess -+ processWithProgram: (OFString*)program ++ (instancetype)processWithProgram: (OFString*)program { return [[[self alloc] initWithProgram: program] autorelease]; } -+ processWithProgram: (OFString*)program - arguments: (OFArray*)arguments ++ (instancetype)processWithProgram: (OFString*)program + arguments: (OFArray*)arguments { return [[[self alloc] initWithProgram: program arguments: arguments] autorelease]; } -+ processWithProgram: (OFString*)program - programName: (OFString*)programName - arguments: (OFArray*)arguments ++ (instancetype)processWithProgram: (OFString*)program + programName: (OFString*)programName + arguments: (OFArray*)arguments { return [[[self alloc] initWithProgram: program programName: programName arguments: arguments] autorelease]; } Index: src/OFSet.h ================================================================== --- src/OFSet.h +++ src/OFSet.h @@ -42,45 +42,45 @@ /** * \brief Creates a new set. * * \return A new, autoreleased set */ -+ set; ++ (instancetype)set; /** * \brief Creates a new set with the specified set. * * \param set The set to initialize the set with * \return A new, autoreleased set with the specified set */ -+ setWithSet: (OFSet*)set; ++ (instancetype)setWithSet: (OFSet*)set; /** * \brief Creates a new set with the specified array. * * \param array The array to initialize the set with * \return A new, autoreleased set with the specified array */ -+ setWithArray: (OFArray*)array; ++ (instancetype)setWithArray: (OFArray*)array; /** * \brief Creates a new set with the specified objects. * * \param firstObject The first object for the set * \return A new, autoreleased set with the specified objects */ -+ setWithObjects: (id)firstObject, ...; ++ (instancetype)setWithObjects: (id)firstObject, ...; /** * \brief Creates a new set with the specified objects. * * \param objects An array of objects for the set * \param count The number of objects in the specified array * \return A new, autoreleased set with the specified objects */ -+ setWithObjects: (id const*)objects - count: (size_t)count; ++ (instancetype)setWithObjects: (id const*)objects + count: (size_t)count; /** * \brief Initializes an already allocated set with the specified set. * * \param set The set to initialize the set with Index: src/OFSet.m ================================================================== --- src/OFSet.m +++ src/OFSet.m @@ -115,26 +115,26 @@ return (id)&placeholder; return [super alloc]; } -+ set ++ (instancetype)set { return [[[self alloc] init] autorelease]; } -+ setWithSet: (OFSet*)set ++ (instancetype)setWithSet: (OFSet*)set { return [[[self alloc] initWithSet: set] autorelease]; } -+ setWithArray: (OFArray*)array ++ (instancetype)setWithArray: (OFArray*)array { return [[[self alloc] initWithArray: array] autorelease]; } -+ setWithObjects: (id)firstObject, ... ++ (instancetype)setWithObjects: (id)firstObject, ... { id ret; va_list arguments; va_start(arguments, firstObject); @@ -143,12 +143,12 @@ va_end(arguments); return ret; } -+ setWithObjects: (id const*)objects - count: (size_t)count ++ (instancetype)setWithObjects: (id const*)objects + count: (size_t)count { return [[[self alloc] initWithObjects: objects count: count] autorelease]; } Index: src/OFStreamObserver.h ================================================================== --- src/OFStreamObserver.h +++ src/OFStreamObserver.h @@ -99,11 +99,11 @@ /** * \brief Creates a new OFStreamObserver. * * \return A new, autoreleased OFStreamObserver */ -+ observer; ++ (instancetype)observer; /** * \brief Returns the delegate for the OFStreamObserver. * * \return The delegate for the OFStreamObserver Index: src/OFStreamObserver.m ================================================================== --- src/OFStreamObserver.m +++ src/OFStreamObserver.m @@ -57,11 +57,11 @@ QUEUE_WRITE = 2 }; #define QUEUE_ACTION (QUEUE_ADD | QUEUE_REMOVE) @implementation OFStreamObserver -+ observer ++ (instancetype)observer { return [[[self alloc] init] autorelease]; } #if defined(HAVE_KQUEUE) Index: src/OFStreamSocket.h ================================================================== --- src/OFStreamSocket.h +++ src/OFStreamSocket.h @@ -35,7 +35,7 @@ /** * \brief Returns a new, autoreleased OFTCPSocket. * * \return A new, autoreleased OFTCPSocket */ -+ socket; ++ (instancetype)socket; @end Index: src/OFStreamSocket.m ================================================================== --- src/OFStreamSocket.m +++ src/OFStreamSocket.m @@ -58,11 +58,11 @@ @throw [OFInitializationFailedException exceptionWithClass: self]; } #endif -+ socket ++ (instancetype)socket { return [[[self alloc] init] autorelease]; } - (BOOL)lowlevelIsAtEndOfStream Index: src/OFString+Hashing.m ================================================================== --- src/OFString+Hashing.m +++ src/OFString+Hashing.m @@ -55,11 +55,11 @@ } - (OFString*)SHA1Hash { void *pool = objc_autoreleasePoolPush(); - OFMD5Hash *hash = [OFSHA1Hash hash]; + OFSHA1Hash *hash = [OFSHA1Hash hash]; uint8_t *digest; char ret[OF_SHA1_DIGEST_SIZE * 2]; size_t i; [hash updateWithBuffer: [self UTF8String] Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -86,40 +86,40 @@ /** * \brief Creates a new OFString. * * \return A new, autoreleased OFString */ -+ string; ++ (instancetype)string; /** * \brief Creates a new OFString from a UTF-8 encoded C string. * * \param UTF8String A UTF-8 encoded C string to initialize the OFString with * \return A new autoreleased OFString */ -+ stringWithUTF8String: (const char*)UTF8String; ++ (instancetype)stringWithUTF8String: (const char*)UTF8String; /** * \brief Creates a new OFString from a UTF-8 encoded C string with the * specified length. * * \param UTF8String A UTF-8 encoded C string to initialize the OFString with * \param UTF8StringLength The length of the UTF-8 encoded C string * \return A new autoreleased OFString */ -+ stringWithUTF8String: (const char*)UTF8String - length: (size_t)UTF8StringLength; ++ (instancetype)stringWithUTF8String: (const char*)UTF8String + length: (size_t)UTF8StringLength; /** * \brief Creates a new OFString from a C string with the specified encoding. * * \param string A C string to initialize the OFString with * \param encoding The encoding of the C string * \return A new autoreleased OFString */ -+ stringWithCString: (const char*)cString - encoding: (of_string_encoding_t)encoding; ++ (instancetype)stringWithCString: (const char*)cString + encoding: (of_string_encoding_t)encoding; /** * \brief Creates a new OFString from a C string with the specified encoding * and length. * @@ -126,51 +126,51 @@ * \param cString A C string to initialize the OFString with * \param encoding The encoding of the C string * \param cStringLength The length of the C string * \return A new autoreleased OFString */ -+ stringWithCString: (const char*)cString - encoding: (of_string_encoding_t)encoding - length: (size_t)cStringLength; ++ (instancetype)stringWithCString: (const char*)cString + encoding: (of_string_encoding_t)encoding + length: (size_t)cStringLength; /** * \brief Creates a new OFString from another string. * * \param string A string to initialize the OFString with * \return A new autoreleased OFString */ -+ stringWithString: (OFString*)string; ++ (instancetype)stringWithString: (OFString*)string; /** * \brief Creates a new OFString from a unicode string. * * \param string The unicode string * \return A new autoreleased OFString */ -+ stringWithUnicodeString: (const of_unichar_t*)string; ++ (instancetype)stringWithUnicodeString: (const of_unichar_t*)string; /** * \brief Creates a new OFString from a unicode string, assuming the specified * byte order if no BOM is found. * * \param string The unicode string * \param byteOrder The byte order to assume if there is no BOM * \return A new autoreleased OFString */ -+ stringWithUnicodeString: (const of_unichar_t*)string - byteOrder: (of_endianess_t)byteOrder; ++ (instancetype)stringWithUnicodeString: (const of_unichar_t*)string + byteOrder: (of_endianess_t)byteOrder; /** * \brief Creates a new OFString from a unicode string with the specified * length. * * \param string The unicode string * \param length The length of the unicode string * \return A new autoreleased OFString */ -+ stringWithUnicodeString: (const of_unichar_t*)string - length: (size_t)length; ++ (instancetype)stringWithUnicodeString: (const of_unichar_t*)string + length: (size_t)length; /** * \brief Creates a new OFString from a unicode string with the specified * length, assuming the specified byte order if no BOM is found. * @@ -177,43 +177,43 @@ * \param string The unicode string * \param byteOrder The byte order to assume if there is no BOM * \param length The length of the unicode string * \return A new autoreleased OFString */ -+ stringWithUnicodeString: (const of_unichar_t*)string - byteOrder: (of_endianess_t)byteOrder - length: (size_t)length; ++ (instancetype)stringWithUnicodeString: (const of_unichar_t*)string + byteOrder: (of_endianess_t)byteOrder + length: (size_t)length; /** * \brief Creates a new OFString from a UTF-16 encoded string. * * \param string The UTF-16 string * \return A new autoreleased OFString */ -+ stringWithUTF16String: (const uint16_t*)string; ++ (instancetype)stringWithUTF16String: (const uint16_t*)string; /** * \brief Creates a new OFString from a UTF-16 encoded string, assuming the * specified byte order if no BOM is found. * * \param string The UTF-16 string * \param byteOrder The byte order to assume if there is no BOM * \return A new autoreleased OFString */ -+ stringWithUTF16String: (const uint16_t*)string - byteOrder: (of_endianess_t)byteOrder; ++ (instancetype)stringWithUTF16String: (const uint16_t*)string + byteOrder: (of_endianess_t)byteOrder; /** * \brief Creates a new OFString from a UTF-16 encoded string with the specified * length. * * \param string The UTF-16 string * \param length The length of the unicode string * \return A new autoreleased OFString */ -+ stringWithUTF16String: (const uint16_t*)string - length: (size_t)length; ++ (instancetype)stringWithUTF16String: (const uint16_t*)string + length: (size_t)length; /** * \brief Creates a new OFString from a UTF-16 encoded string with the * specified length, assuming the specified byte order if no BOM is * found. @@ -221,13 +221,13 @@ * \param string The UTF-16 string * \param byteOrder The byte order to assume if there is no BOM * \param length The length of the unicode string * \return A new autoreleased OFString */ -+ stringWithUTF16String: (const uint16_t*)string - byteOrder: (of_endianess_t)byteOrder - length: (size_t)length; ++ (instancetype)stringWithUTF16String: (const uint16_t*)string + byteOrder: (of_endianess_t)byteOrder + length: (size_t)length; /** * \brief Creates a new OFString from a format string. * * See printf for the format syntax. As an addition, %@ is available as format @@ -234,39 +234,39 @@ * specifier for objects. * * \param format A string used as format to initialize the OFString * \return A new autoreleased OFString */ -+ stringWithFormat: (OFConstantString*)format, ...; ++ (instancetype)stringWithFormat: (OFConstantString*)format, ...; /** * \brief Creates a new OFString containing the constructed specified path. * * \param firstComponent The first component of the path * \return A new autoreleased OFString */ -+ stringWithPath: (OFString*)firstComponent, ...; ++ (instancetype)stringWithPath: (OFString*)firstComponent, ...; /** * \brief Creates a new OFString with the contents of the specified UTF-8 * encoded file. * * \param path The path to the file * \return A new autoreleased OFString */ -+ stringWithContentsOfFile: (OFString*)path; ++ (instancetype)stringWithContentsOfFile: (OFString*)path; /** * \brief Creates a new OFString with the contents of the specified file in the * specified encoding. * * \param path The path to the file * \param encoding The encoding of the file * \return A new autoreleased OFString */ -+ stringWithContentsOfFile: (OFString*)path - encoding: (of_string_encoding_t)encoding; ++ (instancetype)stringWithContentsOfFile: (OFString*)path + encoding: (of_string_encoding_t)encoding; /** * \brief Creates a new OFString with the contents of the specified URL. * * If the URL's scheme is file, it tries UTF-8 encoding. @@ -276,22 +276,22 @@ * UTF-8. * * \param URL The URL to the contents for the string * \return A new autoreleased OFString */ -+ stringWithContentsOfURL: (OFURL*)URL; ++ (instancetype)stringWithContentsOfURL: (OFURL*)URL; /** * \brief Creates a new OFString with the contents of the specified URL in the * specified encoding. * * \param URL The URL to the contents for the string * \param encoding The encoding to assume * \return A new autoreleased OFString */ -+ stringWithContentsOfURL: (OFURL*)URL - encoding: (of_string_encoding_t)encoding; ++ (instancetype)stringWithContentsOfURL: (OFURL*)URL + encoding: (of_string_encoding_t)encoding; /** * \brief Initializes an already allocated OFString from a UTF-8 encoded C * string. * Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -512,106 +512,106 @@ return (id)&placeholder; return [super alloc]; } -+ string ++ (instancetype)string { return [[[self alloc] init] autorelease]; } -+ stringWithUTF8String: (const char*)UTF8String ++ (instancetype)stringWithUTF8String: (const char*)UTF8String { return [[[self alloc] initWithUTF8String: UTF8String] autorelease]; } -+ stringWithUTF8String: (const char*)UTF8String - length: (size_t)UTF8StringLength ++ (instancetype)stringWithUTF8String: (const char*)UTF8String + length: (size_t)UTF8StringLength { return [[[self alloc] initWithUTF8String: UTF8String length: UTF8StringLength] autorelease]; } -+ stringWithCString: (const char*)cString - encoding: (of_string_encoding_t)encoding ++ (instancetype)stringWithCString: (const char*)cString + encoding: (of_string_encoding_t)encoding { return [[[self alloc] initWithCString: cString encoding: encoding] autorelease]; } -+ stringWithCString: (const char*)cString - encoding: (of_string_encoding_t)encoding ++ (instancetype)stringWithCString: (const char*)cString + encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength { return [[[self alloc] initWithCString: cString encoding: encoding length: cStringLength] autorelease]; } -+ stringWithString: (OFString*)string ++ (instancetype)stringWithString: (OFString*)string { return [[[self alloc] initWithString: string] autorelease]; } -+ stringWithUnicodeString: (const of_unichar_t*)string ++ (instancetype)stringWithUnicodeString: (const of_unichar_t*)string { return [[[self alloc] initWithUnicodeString: string] autorelease]; } -+ stringWithUnicodeString: (const of_unichar_t*)string - byteOrder: (of_endianess_t)byteOrder ++ (instancetype)stringWithUnicodeString: (const of_unichar_t*)string + byteOrder: (of_endianess_t)byteOrder { return [[[self alloc] initWithUnicodeString: string byteOrder: byteOrder] autorelease]; } -+ stringWithUnicodeString: (const of_unichar_t*)string - length: (size_t)length ++ (instancetype)stringWithUnicodeString: (const of_unichar_t*)string + length: (size_t)length { return [[[self alloc] initWithUnicodeString: string length: length] autorelease]; } -+ stringWithUnicodeString: (const of_unichar_t*)string - byteOrder: (of_endianess_t)byteOrder - length: (size_t)length ++ (instancetype)stringWithUnicodeString: (const of_unichar_t*)string + byteOrder: (of_endianess_t)byteOrder + length: (size_t)length { return [[[self alloc] initWithUnicodeString: string byteOrder: byteOrder length: length] autorelease]; } -+ stringWithUTF16String: (const uint16_t*)string ++ (instancetype)stringWithUTF16String: (const uint16_t*)string { return [[[self alloc] initWithUTF16String: string] autorelease]; } -+ stringWithUTF16String: (const uint16_t*)string - byteOrder: (of_endianess_t)byteOrder ++ (instancetype)stringWithUTF16String: (const uint16_t*)string + byteOrder: (of_endianess_t)byteOrder { return [[[self alloc] initWithUTF16String: string byteOrder: byteOrder] autorelease]; } -+ stringWithUTF16String: (const uint16_t*)string - length: (size_t)length ++ (instancetype)stringWithUTF16String: (const uint16_t*)string + length: (size_t)length { return [[[self alloc] initWithUTF16String: string length: length] autorelease]; } -+ stringWithUTF16String: (const uint16_t*)string - byteOrder: (of_endianess_t)byteOrder - length: (size_t)length ++ (instancetype)stringWithUTF16String: (const uint16_t*)string + byteOrder: (of_endianess_t)byteOrder + length: (size_t)length { return [[[self alloc] initWithUTF16String: string byteOrder: byteOrder length: length] autorelease]; } -+ stringWithFormat: (OFConstantString*)format, ... ++ (instancetype)stringWithFormat: (OFConstantString*)format, ... { id ret; va_list arguments; va_start(arguments, format); @@ -620,11 +620,11 @@ va_end(arguments); return ret; } -+ stringWithPath: (OFString*)firstComponent, ... ++ (instancetype)stringWithPath: (OFString*)firstComponent, ... { id ret; va_list arguments; va_start(arguments, firstComponent); @@ -633,29 +633,29 @@ va_end(arguments); return ret; } -+ stringWithContentsOfFile: (OFString*)path ++ (instancetype)stringWithContentsOfFile: (OFString*)path { return [[[self alloc] initWithContentsOfFile: path] autorelease]; } -+ stringWithContentsOfFile: (OFString*)path - encoding: (of_string_encoding_t)encoding ++ (instancetype)stringWithContentsOfFile: (OFString*)path + encoding: (of_string_encoding_t)encoding { return [[[self alloc] initWithContentsOfFile: path encoding: encoding] autorelease]; } -+ stringWithContentsOfURL: (OFURL*)URL ++ (instancetype)stringWithContentsOfURL: (OFURL*)URL { return [[[self alloc] initWithContentsOfURL: URL] autorelease]; } -+ stringWithContentsOfURL: (OFURL*)URL - encoding: (of_string_encoding_t)encoding ++ (instancetype)stringWithContentsOfURL: (OFURL*)URL + encoding: (of_string_encoding_t)encoding { return [[[self alloc] initWithContentsOfURL: URL encoding: encoding] autorelease]; } Index: src/OFThread.h ================================================================== --- src/OFThread.h +++ src/OFThread.h @@ -47,19 +47,19 @@ /** * \brief Creates a new Thread Local Storage key * * \return A new, autoreleased Thread Local Storage key */ -+ TLSKey; ++ (instancetype)TLSKey; /** * \brief Creates a new Thread Local Storage key with the specified destructor. * * \param destructor A destructor that is called when the thread is terminated * \return A new autoreleased Thread Local Storage key */ -+ TLSKeyWithDestructor: (void(*)(id))destructor; ++ (instancetype)TLSKeyWithDestructor: (void(*)(id))destructor; + (void)callAllDestructors; /** * \brief Initializes an already allocated Thread Local Storage Key with the @@ -111,28 +111,28 @@ /** * \brief Creates a new thread. * * \return A new, autoreleased thread */ -+ thread; ++ (instancetype)thread; /** * \brief Creates a new thread with the specified object. * * \param object An object which is passed for use in the main method or nil * \return A new, autoreleased thread */ -+ threadWithObject: (id)object; ++ (instancetype)threadWithObject: (id)object; #ifdef OF_HAVE_BLOCKS /** * \brief Creates a new thread with the specified block. * * \param block A block which is executed by the thread * \return A new, autoreleased thread */ -+ threadWithBlock: (of_thread_block_t)block; ++ (instancetype)threadWithBlock: (of_thread_block_t)block; #endif /** * \brief Sets the Thread Local Storage for the specified key. * @@ -273,11 +273,11 @@ /** * \brief Creates a new mutex. * * \return A new autoreleased mutex. */ -+ mutex; ++ (instancetype)mutex; /** * \brief Locks the mutex. */ - (void)lock; @@ -317,11 +317,11 @@ /** * \brief Creates a new condition. * * \return A new, autoreleased OFCondition */ -+ condition; ++ (instancetype)condition; /** * \brief Blocks the current thread until another thread calls -[signal] or * -[broadcast]. */ Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -115,22 +115,22 @@ if (!of_tlskey_new(&threadSelfKey)) @throw [OFInitializationFailedException exceptionWithClass: self]; } -+ thread ++ (instancetype)thread { return [[[self alloc] init] autorelease]; } -+ threadWithObject: (id)object ++ (instancetype)threadWithObject: (id)object { return [[[self alloc] initWithObject: object] autorelease]; } #ifdef OF_HAVE_BLOCKS -+ threadWithBlock: (of_thread_block_t)block ++ (instancetype)threadWithBlock: (of_thread_block_t)block { return [[[self alloc] initWithBlock: block] autorelease]; } #endif @@ -368,16 +368,16 @@ { if (self == [OFTLSKey class]) TLSKeys = [[OFList alloc] init]; } -+ TLSKey ++ (instancetype)TLSKey { return [[[self alloc] init] autorelease]; } -+ TLSKeyWithDestructor: (void(*)(id))destructor ++ (instancetype)TLSKeyWithDestructor: (void(*)(id))destructor { return [[[self alloc] initWithDestructor: destructor] autorelease]; } + (void)callAllDestructors @@ -444,11 +444,11 @@ [super dealloc]; } @end @implementation OFMutex -+ mutex ++ (instancetype)mutex { return [[[self alloc] init] autorelease]; } - init @@ -552,11 +552,11 @@ [super dealloc]; } @end @implementation OFCondition -+ condition ++ (instancetype)condition { return [[[self alloc] init] autorelease]; } - init Index: src/OFThreadPool.h ================================================================== --- src/OFThreadPool.h +++ src/OFThreadPool.h @@ -49,11 +49,11 @@ * \warning If for some reason the number of cores in the system could not be * determined, the pool will only have one thread! * * \return A new thread pool with one thread for each core in the system */ -+ threadPool; ++ (instancetype)threadPool; /** * \brief Returns a new thread pool with the specified number of threads. * * \warning If for some reason the number of cores in the system could not be @@ -60,11 +60,11 @@ * determined, the pool will only have one thread! * * \param size The number of threads for the pool * \return A new thread pool with the specified number of threads */ -+ threadPoolWithSize: (size_t)size; ++ (instancetype)threadPoolWithSize: (size_t)size; /** * \brief Initializes an already allocated OFThreadPool with one thread for * each core in the system. * Index: src/OFThreadPool.m ================================================================== --- src/OFThreadPool.m +++ src/OFThreadPool.m @@ -31,15 +31,15 @@ #ifdef OF_HAVE_BLOCKS of_thread_pool_block_t block; #endif } -+ jobWithTarget: (id)target - selector: (SEL)selector - object: (id)object; ++ (instancetype)jobWithTarget: (id)target + selector: (SEL)selector + object: (id)object; #ifdef OF_HAVE_BLOCKS -+ jobWithBlock: (of_thread_pool_block_t)block; ++ (instancetype)jobWithBlock: (of_thread_pool_block_t)block; #endif - initWithTarget: (id)target selector: (SEL)selector object: (id)object; #ifdef OF_HAVE_BLOCKS @@ -47,21 +47,21 @@ #endif - (void)perform; @end @implementation OFThreadPoolJob -+ jobWithTarget: (id)target - selector: (SEL)selector - object: (id)object ++ (instancetype)jobWithTarget: (id)target + selector: (SEL)selector + object: (id)object { return [[[self alloc] initWithTarget: target selector: selector object: object] autorelease]; } #ifdef OF_HAVE_BLOCKS -+ jobWithBlock: (of_thread_pool_block_t)block ++ (instancetype)jobWithBlock: (of_thread_pool_block_t)block { return [[(OFThreadPoolJob*)[self alloc] initWithBlock: block] autorelease]; } #endif @@ -130,16 +130,16 @@ @public volatile BOOL terminate; volatile int *doneCount; } -+ threadWithThreadPool: (OFThreadPool*)threadPool; ++ (instancetype)threadWithThreadPool: (OFThreadPool*)threadPool; - initWithThreadPool: (OFThreadPool*)threadPool; @end @implementation OFThreadPoolThread -+ threadWithThreadPool: (OFThreadPool*)threadPool ++ (instancetype)threadWithThreadPool: (OFThreadPool*)threadPool { return [[[self alloc] initWithThreadPool: threadPool] autorelease]; } - initWithThreadPool: (OFThreadPool*)threadPool @@ -239,16 +239,16 @@ } } @end @implementation OFThreadPool -+ threadPool ++ (instancetype)threadPool { return [[[self alloc] init] autorelease]; } -+ threadPoolWithSize: (size_t)size ++ (instancetype)threadPoolWithSize: (size_t)size { return [[[self alloc] initWithSize: size] autorelease]; } - init Index: src/OFTimer.h ================================================================== --- src/OFTimer.h +++ src/OFTimer.h @@ -54,14 +54,14 @@ * \param target The target on which to call the selector * \param selector The selector to call on the target * \param repeats Whether the timer repeats after it has been executed * \return A new, autoreleased timer */ -+ scheduledTimerWithTimeInterval: (double)interval - target: (id)target - selector: (SEL)selector - repeats: (BOOL)repeats; ++ (instancetype)scheduledTimerWithTimeInterval: (double)interval + target: (id)target + selector: (SEL)selector + repeats: (BOOL)repeats; /** * \brief Creates and schedules a new timer with the specified time interval. * * \param interval The time interval after which the timer should be executed @@ -70,15 +70,15 @@ * \param selector The selector to call on the target * \param object An object to pass when calling the selector on the target * \param repeats Whether the timer repeats after it has been executed * \return A new, autoreleased timer */ -+ scheduledTimerWithTimeInterval: (double)interval - target: (id)target - selector: (SEL)selector - object: (id)object - repeats: (BOOL)repeats; ++ (instancetype)scheduledTimerWithTimeInterval: (double)interval + target: (id)target + selector: (SEL)selector + object: (id)object + repeats: (BOOL)repeats; /** * \brief Creates and schedules a new timer with the specified time interval. * * \param interval The time interval after which the timer should be executed @@ -90,16 +90,16 @@ * \param object2 The second object to pass when calling the selector on the * target * \param repeats Whether the timer repeats after it has been executed * \return A new, autoreleased timer */ -+ scheduledTimerWithTimeInterval: (double)interval - target: (id)target - selector: (SEL)selector - object: (id)object1 - object: (id)object2 - repeats: (BOOL)repeats; ++ (instancetype)scheduledTimerWithTimeInterval: (double)interval + target: (id)target + selector: (SEL)selector + object: (id)object1 + object: (id)object2 + repeats: (BOOL)repeats; #ifdef OF_HAVE_BLOCKS /** * \brief Creates and schedules a new timer with the specified time interval. * @@ -107,13 +107,13 @@ * when fired * \param repeats Whether the timer repeats after it has been executed * \param block The block to invoke when the timer fires * \return A new, autoreleased timer */ -+ scheduledTimerWithTimeInterval: (double)interval - repeats: (BOOL)repeats - block: (of_timer_block_t)block; ++ (instancetype)scheduledTimerWithTimeInterval: (double)interval + repeats: (BOOL)repeats + block: (of_timer_block_t)block; #endif /** * \brief Creates a new timer with the specified time interval. * @@ -122,14 +122,14 @@ * \param target The target on which to call the selector * \param selector The selector to call on the target * \param repeats Whether the timer repeats after it has been executed * \return A new, autoreleased timer */ -+ timerWithTimeInterval: (double)interval - target: (id)target - selector: (SEL)selector - repeats: (BOOL)repeats; ++ (instancetype)timerWithTimeInterval: (double)interval + target: (id)target + selector: (SEL)selector + repeats: (BOOL)repeats; /** * \brief Creates a new timer with the specified time interval. * * \param interval The time interval after which the timer should be executed @@ -138,15 +138,15 @@ * \param selector The selector to call on the target * \param object An object to pass when calling the selector on the target * \param repeats Whether the timer repeats after it has been executed * \return A new, autoreleased timer */ -+ timerWithTimeInterval: (double)interval - target: (id)target - selector: (SEL)selector - object: (id)object - repeats: (BOOL)repeats; ++ (instancetype)timerWithTimeInterval: (double)interval + target: (id)target + selector: (SEL)selector + object: (id)object + repeats: (BOOL)repeats; /** * \brief Creates a new timer with the specified time interval. * * \param interval The time interval after which the timer should be executed @@ -158,16 +158,16 @@ * \param object2 The second object to pass when calling the selector on the * target * \param repeats Whether the timer repeats after it has been executed * \return A new, autoreleased timer */ -+ timerWithTimeInterval: (double)interval - target: (id)target - selector: (SEL)selector - object: (id)object1 - object: (id)object2 - repeats: (BOOL)repeats; ++ (instancetype)timerWithTimeInterval: (double)interval + target: (id)target + selector: (SEL)selector + object: (id)object1 + object: (id)object2 + repeats: (BOOL)repeats; #ifdef OF_HAVE_BLOCKS /** * \brief Creates a new timer with the specified time interval. * @@ -175,13 +175,13 @@ * when fired * \param repeats Whether the timer repeats after it has been executed * \param block The block to invoke when the timer fires * \return A new, autoreleased timer */ -+ timerWithTimeInterval: (double)interval - repeats: (BOOL)repeats - block: (of_timer_block_t)block; ++ (instancetype)timerWithTimeInterval: (double)interval + repeats: (BOOL)repeats + block: (of_timer_block_t)block; #endif /** * \brief Initializes an already allocated timer with the specified time * interval. Index: src/OFTimer.m ================================================================== --- src/OFTimer.m +++ src/OFTimer.m @@ -26,14 +26,14 @@ #import "autorelease.h" #import "macros.h" @implementation OFTimer -+ scheduledTimerWithTimeInterval: (double)interval - target: (id)target - selector: (SEL)selector - repeats: (BOOL)repeats ++ (instancetype)scheduledTimerWithTimeInterval: (double)interval + target: (id)target + selector: (SEL)selector + repeats: (BOOL)repeats { void *pool = objc_autoreleasePoolPush(); OFDate *fireDate = [OFDate dateWithTimeIntervalSinceNow: interval]; id timer = [[[self alloc] initWithFireDate: fireDate interval: interval @@ -47,15 +47,15 @@ objc_autoreleasePoolPop(pool); return [timer autorelease]; } -+ scheduledTimerWithTimeInterval: (double)interval - target: (id)target - selector: (SEL)selector - object: (id)object - repeats: (BOOL)repeats ++ (instancetype)scheduledTimerWithTimeInterval: (double)interval + target: (id)target + selector: (SEL)selector + object: (id)object + repeats: (BOOL)repeats { void *pool = objc_autoreleasePoolPush(); OFDate *fireDate = [OFDate dateWithTimeIntervalSinceNow: interval]; id timer = [[[self alloc] initWithFireDate: fireDate interval: interval @@ -70,16 +70,16 @@ objc_autoreleasePoolPop(pool); return [timer autorelease]; } -+ scheduledTimerWithTimeInterval: (double)interval - target: (id)target - selector: (SEL)selector - object: (id)object1 - object: (id)object2 - repeats: (BOOL)repeats ++ (instancetype)scheduledTimerWithTimeInterval: (double)interval + target: (id)target + selector: (SEL)selector + object: (id)object1 + object: (id)object2 + repeats: (BOOL)repeats { void *pool = objc_autoreleasePoolPush(); OFDate *fireDate = [OFDate dateWithTimeIntervalSinceNow: interval]; id timer = [[[self alloc] initWithFireDate: fireDate interval: interval @@ -96,13 +96,13 @@ return [timer autorelease]; } #ifdef OF_HAVE_BLOCKS -+ scheduledTimerWithTimeInterval: (double)interval - repeats: (BOOL)repeats - block: (of_timer_block_t)block ++ (instancetype)scheduledTimerWithTimeInterval: (double)interval + repeats: (BOOL)repeats + block: (of_timer_block_t)block { void *pool = objc_autoreleasePoolPush(); OFDate *fireDate = [OFDate dateWithTimeIntervalSinceNow: interval]; id timer = [[[self alloc] initWithFireDate: fireDate interval: interval @@ -116,14 +116,14 @@ return [timer autorelease]; } #endif -+ timerWithTimeInterval: (double)interval - target: (id)target - selector: (SEL)selector - repeats: (BOOL)repeats ++ (instancetype)timerWithTimeInterval: (double)interval + target: (id)target + selector: (SEL)selector + repeats: (BOOL)repeats { void *pool = objc_autoreleasePoolPush(); OFDate *fireDate = [OFDate dateWithTimeIntervalSinceNow: interval]; id timer = [[[self alloc] initWithFireDate: fireDate interval: interval @@ -135,15 +135,15 @@ objc_autoreleasePoolPop(pool); return [timer autorelease]; } -+ timerWithTimeInterval: (double)interval - target: (id)target - selector: (SEL)selector - object: (id)object - repeats: (BOOL)repeats ++ (instancetype)timerWithTimeInterval: (double)interval + target: (id)target + selector: (SEL)selector + object: (id)object + repeats: (BOOL)repeats { void *pool = objc_autoreleasePoolPush(); OFDate *fireDate = [OFDate dateWithTimeIntervalSinceNow: interval]; id timer = [[[self alloc] initWithFireDate: fireDate interval: interval @@ -156,16 +156,16 @@ objc_autoreleasePoolPop(pool); return [timer autorelease]; } -+ timerWithTimeInterval: (double)interval - target: (id)target - selector: (SEL)selector - object: (id)object1 - object: (id)object2 - repeats: (BOOL)repeats ++ (instancetype)timerWithTimeInterval: (double)interval + target: (id)target + selector: (SEL)selector + object: (id)object1 + object: (id)object2 + repeats: (BOOL)repeats { void *pool = objc_autoreleasePoolPush(); OFDate *fireDate = [OFDate dateWithTimeIntervalSinceNow: interval]; id timer = [[[self alloc] initWithFireDate: fireDate interval: interval @@ -180,13 +180,13 @@ return [timer autorelease]; } #ifdef OF_HAVE_BLOCKS -+ timerWithTimeInterval: (double)interval - repeats: (BOOL)repeats - block: (of_timer_block_t)block ++ (instancetype)timerWithTimeInterval: (double)interval + repeats: (BOOL)repeats + block: (of_timer_block_t)block { void *pool = objc_autoreleasePoolPush(); OFDate *fireDate = [OFDate dateWithTimeIntervalSinceNow: interval]; id timer = [[[self alloc] initWithFireDate: fireDate interval: interval Index: src/OFURL.h ================================================================== --- src/OFURL.h +++ src/OFURL.h @@ -51,21 +51,21 @@ * Creates a new URL with the specified string. * * \param string A string describing a URL * \return A new, autoreleased OFURL */ -+ URLWithString: (OFString*)string; ++ (instancetype)URLWithString: (OFString*)string; /** * Creates a new URL with the specified string relative to the specified URL. * * \param string A string describing a URL * \param URL An URL to which the string is relative * \return A new, autoreleased OFURL */ -+ URLWithString: (OFString*)string - relativeToURL: (OFURL*)URL; ++ (instancetype)URLWithString: (OFString*)string + relativeToURL: (OFURL*)URL; /** * \brief Initializes an already allocated OFURL with the specified string. * * \param string A string describing a URL Index: src/OFURL.m ================================================================== --- src/OFURL.m +++ src/OFURL.m @@ -76,17 +76,17 @@ return [ret autorelease]; } @implementation OFURL -+ URLWithString: (OFString*)string ++ (instancetype)URLWithString: (OFString*)string { return [[[self alloc] initWithString: string] autorelease]; } -+ URLWithString: (OFString*)string - relativeToURL: (OFURL*)URL ++ (instancetype)URLWithString: (OFString*)string + relativeToURL: (OFURL*)URL { return [[[self alloc] initWithString: string relativeToURL: URL] autorelease]; } Index: src/OFXMLAttribute.h ================================================================== --- src/OFXMLAttribute.h +++ src/OFXMLAttribute.h @@ -41,13 +41,13 @@ * \param name The name of the attribute * \param ns The namespace of the attribute * \param value The string value of the attribute * \return A new autoreleased OFXMLAttribute with the specified parameters */ -+ attributeWithName: (OFString*)name - namespace: (OFString*)ns - stringValue: (OFString*)value; ++ (instancetype)attributeWithName: (OFString*)name + namespace: (OFString*)ns + stringValue: (OFString*)value; /** * \brief Initializes an already allocated OFXMLAttribute. * * \param name The name of the attribute Index: src/OFXMLAttribute.m ================================================================== --- src/OFXMLAttribute.m +++ src/OFXMLAttribute.m @@ -25,13 +25,13 @@ #import "autorelease.h" #import "macros.h" @implementation OFXMLAttribute -+ attributeWithName: (OFString*)name - namespace: (OFString*)ns - stringValue: (OFString*)value ++ (instancetype)attributeWithName: (OFString*)name + namespace: (OFString*)ns + stringValue: (OFString*)value { return [[[self alloc] initWithName: name namespace: ns stringValue: value] autorelease]; } Index: src/OFXMLCDATA.h ================================================================== --- src/OFXMLCDATA.h +++ src/OFXMLCDATA.h @@ -28,15 +28,15 @@ * \brief Creates a new OFXMLCDATA with the specified string. * * \param string The string value for the CDATA * \return A new OFXMLCDATA */ -+ CDATAWithString: (OFString*)string; ++ (instancetype)CDATAWithString: (OFString*)string; /** * \brief Initializes an alredy allocated OFXMLCDATA with the specified string. * * \param string The string value for the CDATA * \return An initialized OFXMLCDATA */ - initWithString: (OFString*)string; @end Index: src/OFXMLCDATA.m ================================================================== --- src/OFXMLCDATA.m +++ src/OFXMLCDATA.m @@ -23,11 +23,11 @@ #import "OFInvalidArgumentException.h" #import "autorelease.h" @implementation OFXMLCDATA -+ CDATAWithString: (OFString*)string ++ (instancetype)CDATAWithString: (OFString*)string { return [[[self alloc] initWithString: string] autorelease]; } - initWithString: (OFString*)string Index: src/OFXMLCharacters.h ================================================================== --- src/OFXMLCharacters.h +++ src/OFXMLCharacters.h @@ -28,11 +28,11 @@ * \brief Creates a new OFXMLCharacters with the specified string. * * \param string The string value for the characters * \return A new OFXMLCharacters */ -+ charactersWithString: (OFString*)string; ++ (instancetype)charactersWithString: (OFString*)string; /** * \brief Initializes an already allocated OFXMLCharacters with the specified * string. * Index: src/OFXMLCharacters.m ================================================================== --- src/OFXMLCharacters.m +++ src/OFXMLCharacters.m @@ -23,11 +23,11 @@ #import "OFInvalidArgumentException.h" #import "autorelease.h" @implementation OFXMLCharacters -+ charactersWithString: (OFString*)string ++ (instancetype)charactersWithString: (OFString*)string { return [[[self alloc] initWithString: string] autorelease]; } - initWithString: (OFString*)string Index: src/OFXMLComment.h ================================================================== --- src/OFXMLComment.h +++ src/OFXMLComment.h @@ -28,11 +28,11 @@ * \brief Creates a new OFXMLComment with the specified string. * * \param string The string for the comment * \return A new OFXMLComment */ -+ commentWithString: (OFString*)string; ++ (instancetype)commentWithString: (OFString*)string; /** * \brief Initializes an already allocated OFXMLComment with the specified * string. * Index: src/OFXMLComment.m ================================================================== --- src/OFXMLComment.m +++ src/OFXMLComment.m @@ -25,11 +25,11 @@ #import "OFInvalidArgumentException.h" #import "autorelease.h" @implementation OFXMLComment -+ commentWithString: (OFString*)string ++ (instancetype)commentWithString: (OFString*)string { return [[[self alloc] initWithString: string] autorelease]; } - initWithString: (OFString*)string Index: src/OFXMLElement.h ================================================================== --- src/OFXMLElement.h +++ src/OFXMLElement.h @@ -48,33 +48,33 @@ * \brief Creates a new XML element with the specified name. * * \param name The name for the element * \return A new autoreleased OFXMLElement with the specified element name */ -+ elementWithName: (OFString*)name; ++ (instancetype)elementWithName: (OFString*)name; /** * \brief Creates a new XML element with the specified name and string value. * * \param name The name for the element * \param stringValue The value for the element * \return A new autoreleased OFXMLElement with the specified element name and * value */ -+ elementWithName: (OFString*)name - stringValue: (OFString*)stringValue; ++ (instancetype)elementWithName: (OFString*)name + stringValue: (OFString*)stringValue; /** * \brief Creates a new XML element with the specified name and namespace. * * \param name The name for the element * \param ns The namespace for the element * \return A new autoreleased OFXMLElement with the specified element name and * namespace */ -+ elementWithName: (OFString*)name - namespace: (OFString*)ns; ++ (instancetype)elementWithName: (OFString*)name + namespace: (OFString*)ns; /** * \brief Creates a new XML element with the specified name, namespace and * string value. * @@ -82,39 +82,39 @@ * \param ns The namespace for the element * \param stringValue The value for the element * \return A new autoreleased OFXMLElement with the specified element name, * namespace and value */ -+ elementWithName: (OFString*)name - namespace: (OFString*)ns - stringValue: (OFString*)stringValue; ++ (instancetype)elementWithName: (OFString*)name + namespace: (OFString*)ns + stringValue: (OFString*)stringValue; /** * \brief Creates a new element with the specified element. * * \param element An OFXMLElement to initialize the OFXMLElement with * \return A new autoreleased OFXMLElement with the contents of the specified * element */ -+ elementWithElement: (OFXMLElement*)element; ++ (instancetype)elementWithElement: (OFXMLElement*)element; /** * \brief Parses the string and returns an OFXMLElement for it. * * \param string The string to parse * \return A new autoreleased OFXMLElement with the contents of the string */ -+ elementWithXMLString: (OFString*)string; ++ (instancetype)elementWithXMLString: (OFString*)string; /** * \brief Parses the specified file and returns an OFXMLElement for it. * * \param path The path to the file * \return A new autoreleased OFXMLElement with the contents of the specified * file */ -+ elementWithFile: (OFString*)path; ++ (instancetype)elementWithFile: (OFString*)path; /** * \brief Initializes an already allocated OFXMLElement with the specified name. * * \param name The name for the element Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -78,49 +78,49 @@ charactersClass = [OFXMLCharacters class]; CDATAClass = [OFXMLCDATA class]; } } -+ elementWithName: (OFString*)name ++ (instancetype)elementWithName: (OFString*)name { return [[[self alloc] initWithName: name] autorelease]; } -+ elementWithName: (OFString*)name - stringValue: (OFString*)stringValue ++ (instancetype)elementWithName: (OFString*)name + stringValue: (OFString*)stringValue { return [[[self alloc] initWithName: name stringValue: stringValue] autorelease]; } -+ elementWithName: (OFString*)name - namespace: (OFString*)ns ++ (instancetype)elementWithName: (OFString*)name + namespace: (OFString*)ns { return [[[self alloc] initWithName: name namespace: ns] autorelease]; } -+ elementWithName: (OFString*)name - namespace: (OFString*)ns - stringValue: (OFString*)stringValue ++ (instancetype)elementWithName: (OFString*)name + namespace: (OFString*)ns + stringValue: (OFString*)stringValue { return [[[self alloc] initWithName: name namespace: ns stringValue: stringValue] autorelease]; } -+ elementWithElement: (OFXMLElement*)element ++ (instancetype)elementWithElement: (OFXMLElement*)element { return [[[self alloc] initWithElement: element] autorelease]; } -+ elementWithXMLString: (OFString*)string ++ (instancetype)elementWithXMLString: (OFString*)string { return [[[self alloc] initWithXMLString: string] autorelease]; } -+ elementWithFile: (OFString*)path ++ (instancetype)elementWithFile: (OFString*)path { return [[[self alloc] initWithFile: path] autorelease]; } - init Index: src/OFXMLElementBuilder.h ================================================================== --- src/OFXMLElementBuilder.h +++ src/OFXMLElementBuilder.h @@ -115,11 +115,11 @@ /** * \brief Creates a new element builder. * * \return A new, autoreleased OFXMLElementBuilder */ -+ elementBuilder; ++ (instancetype)elementBuilder; /** * \brief Returns the delegate for the OFXMLElementBuilder. * * \return The delegate for the OFXMLElementBuilder Index: src/OFXMLElementBuilder.m ================================================================== --- src/OFXMLElementBuilder.m +++ src/OFXMLElementBuilder.m @@ -31,11 +31,11 @@ #import "OFMalformedXMLException.h" #import "macros.h" @implementation OFXMLElementBuilder -+ elementBuilder ++ (instancetype)elementBuilder { return [[[self alloc] init] autorelease]; } - init Index: src/OFXMLParser.h ================================================================== --- src/OFXMLParser.h +++ src/OFXMLParser.h @@ -176,11 +176,11 @@ /** * \brief Creates a new XML parser. * * \return A new, autoreleased OFXMLParser */ -+ parser; ++ (instancetype)parser; /** * \brief Returns the delegate that is used by the XML parser. * * \return The delegate that is used by the XML parser Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -173,11 +173,11 @@ lookupTable[i] = (state_function) [self instanceMethodForSelector: selectors[i]]; } } -+ parser ++ (instancetype)parser { return [[[self alloc] init] autorelease]; } - init Index: src/OFXMLProcessingInstructions.h ================================================================== --- src/OFXMLProcessingInstructions.h +++ src/OFXMLProcessingInstructions.h @@ -28,11 +28,11 @@ * \brief Creates a new OFXMLProcessingInstructions with the specified string. * * \param string The string for the processing instructions * \return A new OFXMLProcessingInstructions */ -+ processingInstructionsWithString: (OFString*)string; ++ (instancetype)processingInstructionsWithString: (OFString*)string; /** * \brief Initializes an already allocated OFXMLProcessingInstructions with the * specified string. * Index: src/OFXMLProcessingInstructions.m ================================================================== --- src/OFXMLProcessingInstructions.m +++ src/OFXMLProcessingInstructions.m @@ -25,11 +25,11 @@ #import "OFInvalidArgumentException.h" #import "autorelease.h" @implementation OFXMLProcessingInstructions -+ processingInstructionsWithString: (OFString*)string ++ (instancetype)processingInstructionsWithString: (OFString*)string { return [[[self alloc] initWithString: string] autorelease]; } - initWithString: (OFString*)string Index: src/exceptions/OFAcceptFailedException.h ================================================================== --- src/exceptions/OFAcceptFailedException.h +++ src/exceptions/OFAcceptFailedException.h @@ -35,12 +35,12 @@ /** * \param class_ The class of the object which caused the exception * \param socket The socket which could not accept a connection * \return A new accept failed exception */ -+ exceptionWithClass: (Class)class_ - socket: (OFTCPSocket*)socket; ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFTCPSocket*)socket; /** * Initializes an already allocated accept failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFAcceptFailedException.m ================================================================== --- src/exceptions/OFAcceptFailedException.m +++ src/exceptions/OFAcceptFailedException.m @@ -23,12 +23,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFAcceptFailedException -+ exceptionWithClass: (Class)class_ - socket: (OFTCPSocket*)socket ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFTCPSocket*)socket { return [[[self alloc] initWithClass: class_ socket: socket] autorelease]; } Index: src/exceptions/OFAddressTranslationFailedException.h ================================================================== --- src/exceptions/OFAddressTranslationFailedException.h +++ src/exceptions/OFAddressTranslationFailedException.h @@ -38,13 +38,13 @@ * \param class_ The class of the object which caused the exception * \param socket The socket which could not translate the address * \param host The host for which translation was requested * \return A new address translation failed exception */ -+ exceptionWithClass: (Class)class_ - socket: (OFTCPSocket*)socket - host: (OFString*)host; ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFTCPSocket*)socket + host: (OFString*)host; /** * Initializes an already allocated address translation failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFAddressTranslationFailedException.m ================================================================== --- src/exceptions/OFAddressTranslationFailedException.m +++ src/exceptions/OFAddressTranslationFailedException.m @@ -21,13 +21,13 @@ #import "OFTCPSocket.h" #import "common.h" @implementation OFAddressTranslationFailedException -+ exceptionWithClass: (Class)class_ - socket: (OFTCPSocket*)socket - host: (OFString*)host ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFTCPSocket*)socket + host: (OFString*)host { return [[[self alloc] initWithClass: class_ socket: socket host: host] autorelease]; } Index: src/exceptions/OFAlreadyConnectedException.h ================================================================== --- src/exceptions/OFAlreadyConnectedException.h +++ src/exceptions/OFAlreadyConnectedException.h @@ -34,12 +34,12 @@ /** * \param class_ The class of the object which caused the exception * \param socket The socket which is already connected * \return A new already connected exception */ -+ exceptionWithClass: (Class)class_ - socket: (OFTCPSocket*)socket; ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFTCPSocket*)socket; /** * Initializes an already allocated already connected exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFAlreadyConnectedException.m ================================================================== --- src/exceptions/OFAlreadyConnectedException.m +++ src/exceptions/OFAlreadyConnectedException.m @@ -23,12 +23,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFAlreadyConnectedException -+ exceptionWithClass: (Class)class_ - socket: (OFTCPSocket*)socket ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFTCPSocket*)socket { return [[[self alloc] initWithClass: class_ socket: socket] autorelease]; } Index: src/exceptions/OFBindFailedException.h ================================================================== --- src/exceptions/OFBindFailedException.h +++ src/exceptions/OFBindFailedException.h @@ -41,14 +41,14 @@ * \param socket The socket which could not be bound * \param host The host on which binding failed * \param port The port on which binding failed * \return A new bind failed exception */ -+ exceptionWithClass: (Class)class_ - socket: (OFTCPSocket*)socket - host: (OFString*)host - port: (uint16_t)port; ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFTCPSocket*)socket + host: (OFString*)host + port: (uint16_t)port; /** * Initializes an already allocated bind failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFBindFailedException.m ================================================================== --- src/exceptions/OFBindFailedException.m +++ src/exceptions/OFBindFailedException.m @@ -23,14 +23,14 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFBindFailedException -+ exceptionWithClass: (Class)class_ - socket: (OFTCPSocket*)socket - host: (OFString*)host - port: (uint16_t)port ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFTCPSocket*)socket + host: (OFString*)host + port: (uint16_t)port { return [[[self alloc] initWithClass: class_ socket: socket host: host port: port] autorelease]; Index: src/exceptions/OFChangeDirectoryFailedException.h ================================================================== --- src/exceptions/OFChangeDirectoryFailedException.h +++ src/exceptions/OFChangeDirectoryFailedException.h @@ -34,12 +34,12 @@ * \param class_ The class of the object which caused the exception * \param path A string with the path of the directory to which couldn't be * changed * \return A new change directory failed exception */ -+ exceptionWithClass: (Class)class_ - path: (OFString*)path; ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path; /** * Initializes an already allocated change directory failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFChangeDirectoryFailedException.m ================================================================== --- src/exceptions/OFChangeDirectoryFailedException.m +++ src/exceptions/OFChangeDirectoryFailedException.m @@ -22,12 +22,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFChangeDirectoryFailedException -+ exceptionWithClass: (Class)class_ - path: (OFString*)path_ ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path_ { return [[[self alloc] initWithClass: class_ path: path_] autorelease]; } Index: src/exceptions/OFChangeFileModeFailedException.h ================================================================== --- src/exceptions/OFChangeFileModeFailedException.h +++ src/exceptions/OFChangeFileModeFailedException.h @@ -38,13 +38,13 @@ * \param class_ The class of the object which caused the exception * \param path The path of the file * \param mode The new mode for the file * \return An initialized change file mode failed exception */ -+ exceptionWithClass: (Class)class_ - path: (OFString*)path - mode: (mode_t)mode; ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path + mode: (mode_t)mode; /** * Initializes an already allocated change file mode failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFChangeFileModeFailedException.m ================================================================== --- src/exceptions/OFChangeFileModeFailedException.m +++ src/exceptions/OFChangeFileModeFailedException.m @@ -22,13 +22,13 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFChangeFileModeFailedException -+ exceptionWithClass: (Class)class_ - path: (OFString*)path - mode: (mode_t)mode ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path + mode: (mode_t)mode { return [[[self alloc] initWithClass: class_ path: path mode: mode] autorelease]; } Index: src/exceptions/OFChangeFileOwnerFailedException.h ================================================================== --- src/exceptions/OFChangeFileOwnerFailedException.h +++ src/exceptions/OFChangeFileOwnerFailedException.h @@ -40,14 +40,14 @@ * \param path The path of the file * \param owner The new owner for the file * \param group The new group for the file * \return An initialized change file owner failed exception */ -+ exceptionWithClass: (Class)class_ - path: (OFString*)path - owner: (OFString*)owner - group: (OFString*)group; ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path + owner: (OFString*)owner + group: (OFString*)group; /** * Initializes an already allocated change file owner failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFChangeFileOwnerFailedException.m ================================================================== --- src/exceptions/OFChangeFileOwnerFailedException.m +++ src/exceptions/OFChangeFileOwnerFailedException.m @@ -23,14 +23,14 @@ #import "common.h" #ifndef _WIN32 @implementation OFChangeFileOwnerFailedException -+ exceptionWithClass: (Class)class_ - path: (OFString*)path - owner: (OFString*)owner - group: (OFString*)group ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path + owner: (OFString*)owner + group: (OFString*)group { return [[[self alloc] initWithClass: class_ path: path owner: owner group: group] autorelease]; Index: src/exceptions/OFConditionBroadcastFailedException.h ================================================================== --- src/exceptions/OFConditionBroadcastFailedException.h +++ src/exceptions/OFConditionBroadcastFailedException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param condition The condition which could not be broadcasted * \return A new condition broadcast failed exception */ -+ exceptionWithClass: (Class)class_ - condition: (OFCondition*)condition; ++ (instancetype)exceptionWithClass: (Class)class_ + condition: (OFCondition*)condition; /** * Initializes an already allocated condition broadcast failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFConditionBroadcastFailedException.m ================================================================== --- src/exceptions/OFConditionBroadcastFailedException.m +++ src/exceptions/OFConditionBroadcastFailedException.m @@ -21,12 +21,12 @@ #import "OFThread.h" #import "OFNotImplementedException.h" @implementation OFConditionBroadcastFailedException -+ exceptionWithClass: (Class)class_ - condition: (OFCondition*)condition ++ (instancetype)exceptionWithClass: (Class)class_ + condition: (OFCondition*)condition { return [[[self alloc] initWithClass: class_ condition: condition] autorelease]; } Index: src/exceptions/OFConditionSignalFailedException.h ================================================================== --- src/exceptions/OFConditionSignalFailedException.h +++ src/exceptions/OFConditionSignalFailedException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param condition The condition which could not be signaled * \return A new condition signal failed exception */ -+ exceptionWithClass: (Class)class_ - condition: (OFCondition*)condition; ++ (instancetype)exceptionWithClass: (Class)class_ + condition: (OFCondition*)condition; /** * Initializes an already allocated condition signal failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFConditionSignalFailedException.m ================================================================== --- src/exceptions/OFConditionSignalFailedException.m +++ src/exceptions/OFConditionSignalFailedException.m @@ -21,12 +21,12 @@ #import "OFThread.h" #import "OFNotImplementedException.h" @implementation OFConditionSignalFailedException -+ exceptionWithClass: (Class)class_ - condition: (OFCondition*)condition ++ (instancetype)exceptionWithClass: (Class)class_ + condition: (OFCondition*)condition { return [[[self alloc] initWithClass: class_ condition: condition] autorelease]; } Index: src/exceptions/OFConditionStillWaitingException.h ================================================================== --- src/exceptions/OFConditionStillWaitingException.h +++ src/exceptions/OFConditionStillWaitingException.h @@ -34,12 +34,12 @@ /** * \param class_ The class of the object which caused the exception * \param condition The condition for which is still being waited * \return A new condition still waiting exception */ -+ exceptionWithClass: (Class)class_ - condition: (OFCondition*)condition; ++ (instancetype)exceptionWithClass: (Class)class_ + condition: (OFCondition*)condition; /** * Initializes an already allocated condition still waiting exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFConditionStillWaitingException.m ================================================================== --- src/exceptions/OFConditionStillWaitingException.m +++ src/exceptions/OFConditionStillWaitingException.m @@ -21,12 +21,12 @@ #import "OFThread.h" #import "OFNotImplementedException.h" @implementation OFConditionStillWaitingException -+ exceptionWithClass: (Class)class_ - condition: (OFCondition*)condition ++ (instancetype)exceptionWithClass: (Class)class_ + condition: (OFCondition*)condition { return [[[self alloc] initWithClass: class_ condition: condition] autorelease]; } Index: src/exceptions/OFConditionWaitFailedException.h ================================================================== --- src/exceptions/OFConditionWaitFailedException.h +++ src/exceptions/OFConditionWaitFailedException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param condition The condition for which could not be waited * \return A new condition wait failed exception */ -+ exceptionWithClass: (Class)class_ - condition: (OFCondition*)condition; ++ (instancetype)exceptionWithClass: (Class)class_ + condition: (OFCondition*)condition; /** * Initializes an already allocated condition wait failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFConditionWaitFailedException.m ================================================================== --- src/exceptions/OFConditionWaitFailedException.m +++ src/exceptions/OFConditionWaitFailedException.m @@ -21,12 +21,12 @@ #import "OFThread.h" #import "OFNotImplementedException.h" @implementation OFConditionWaitFailedException -+ exceptionWithClass: (Class)class_ - condition: (OFCondition*)condition ++ (instancetype)exceptionWithClass: (Class)class_ + condition: (OFCondition*)condition { return [[[self alloc] initWithClass: class_ condition: condition] autorelease]; } Index: src/exceptions/OFConnectionFailedException.h ================================================================== --- src/exceptions/OFConnectionFailedException.h +++ src/exceptions/OFConnectionFailedException.h @@ -41,14 +41,14 @@ * \param socket The socket which could not connect * \param host The host to which the connection failed * \param port The port on the host to which the connection failed * \return A new connection failed exception */ -+ exceptionWithClass: (Class)class_ - socket: (OFTCPSocket*)socket - host: (OFString*)host - port: (uint16_t)port; ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFTCPSocket*)socket + host: (OFString*)host + port: (uint16_t)port; /** * Initializes an already allocated connection failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFConnectionFailedException.m ================================================================== --- src/exceptions/OFConnectionFailedException.m +++ src/exceptions/OFConnectionFailedException.m @@ -23,14 +23,14 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFConnectionFailedException -+ exceptionWithClass: (Class)class_ - socket: (OFTCPSocket*)socket - host: (OFString*)host - port: (uint16_t)port ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFTCPSocket*)socket + host: (OFString*)host + port: (uint16_t)port { return [[[self alloc] initWithClass: class_ socket: socket host: host port: port] autorelease]; Index: src/exceptions/OFCopyFileFailedException.h ================================================================== --- src/exceptions/OFCopyFileFailedException.h +++ src/exceptions/OFCopyFileFailedException.h @@ -36,13 +36,13 @@ * \param class_ The class of the object which caused the exception * \param source The original path * \param destination The new path * \return A new copy file failed exception */ -+ exceptionWithClass: (Class)class_ - sourcePath: (OFString*)source - destinationPath: (OFString*)destination; ++ (instancetype)exceptionWithClass: (Class)class_ + sourcePath: (OFString*)source + destinationPath: (OFString*)destination; /** * Initializes an already allocated copy file failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFCopyFileFailedException.m ================================================================== --- src/exceptions/OFCopyFileFailedException.m +++ src/exceptions/OFCopyFileFailedException.m @@ -22,13 +22,13 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFCopyFileFailedException -+ exceptionWithClass: (Class)class_ - sourcePath: (OFString*)source - destinationPath: (OFString*)destination ++ (instancetype)exceptionWithClass: (Class)class_ + sourcePath: (OFString*)source + destinationPath: (OFString*)destination { return [[[self alloc] initWithClass: class_ sourcePath: source destinationPath: destination] autorelease]; } Index: src/exceptions/OFCreateDirectoryFailedException.h ================================================================== --- src/exceptions/OFCreateDirectoryFailedException.h +++ src/exceptions/OFCreateDirectoryFailedException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param path A string with the path of the directory which couldn't be created * \return A new create directory failed exception */ -+ exceptionWithClass: (Class)class_ - path: (OFString*)path; ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path; /** * Initializes an already allocated create directory failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFCreateDirectoryFailedException.m ================================================================== --- src/exceptions/OFCreateDirectoryFailedException.m +++ src/exceptions/OFCreateDirectoryFailedException.m @@ -22,12 +22,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFCreateDirectoryFailedException -+ exceptionWithClass: (Class)class_ - path: (OFString*)path_ ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path_ { return [[[self alloc] initWithClass: class_ path: path_] autorelease]; } Index: src/exceptions/OFDeleteDirectoryFailedException.h ================================================================== --- src/exceptions/OFDeleteDirectoryFailedException.h +++ src/exceptions/OFDeleteDirectoryFailedException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param path The path of the directory * \return A new delete directory failed exception */ -+ exceptionWithClass: (Class)class_ - path: (OFString*)path; ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path; /** * Initializes an already allocated delete directory failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFDeleteDirectoryFailedException.m ================================================================== --- src/exceptions/OFDeleteDirectoryFailedException.m +++ src/exceptions/OFDeleteDirectoryFailedException.m @@ -22,12 +22,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFDeleteDirectoryFailedException -+ exceptionWithClass: (Class)class_ - path: (OFString*)path_ ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path_ { return [[[self alloc] initWithClass: class_ path: path_] autorelease]; } Index: src/exceptions/OFDeleteFileFailedException.h ================================================================== --- src/exceptions/OFDeleteFileFailedException.h +++ src/exceptions/OFDeleteFileFailedException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param path The path of the file * \return A new delete file failed exception */ -+ exceptionWithClass: (Class)class_ - path: (OFString*)path; ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path; /** * Initializes an already allocated delete file failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFDeleteFileFailedException.m ================================================================== --- src/exceptions/OFDeleteFileFailedException.m +++ src/exceptions/OFDeleteFileFailedException.m @@ -22,12 +22,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFDeleteFileFailedException -+ exceptionWithClass: (Class)class_ - path: (OFString*)path_ ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path_ { return [[[self alloc] initWithClass: class_ path: path_] autorelease]; } Index: src/exceptions/OFEnumerationMutationException.h ================================================================== --- src/exceptions/OFEnumerationMutationException.h +++ src/exceptions/OFEnumerationMutationException.h @@ -32,12 +32,12 @@ /** * \param class_ The class of the object which caused the exception * \param object The object which was mutated during enumeration * \return A new enumeration mutation exception */ -+ exceptionWithClass: (Class)class_ - object: (id)object; ++ (instancetype)exceptionWithClass: (Class)class_ + object: (id)object; /** * Initializes an already allocated enumeration mutation exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFEnumerationMutationException.m ================================================================== --- src/exceptions/OFEnumerationMutationException.m +++ src/exceptions/OFEnumerationMutationException.m @@ -22,12 +22,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFEnumerationMutationException -+ exceptionWithClass: (Class)class_ - object: (id)object ++ (instancetype)exceptionWithClass: (Class)class_ + object: (id)object { return [[[self alloc] initWithClass: class_ object: object] autorelease]; } Index: src/exceptions/OFException.h ================================================================== --- src/exceptions/OFException.h +++ src/exceptions/OFException.h @@ -38,11 +38,11 @@ * Creates a new exception. * * \param class_ The class of the object which caused the exception * \return A new exception */ -+ exceptionWithClass: (Class)class_; ++ (instancetype)exceptionWithClass: (Class)class_; /** * Initializes an already allocated OFException. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFException.m ================================================================== --- src/exceptions/OFException.m +++ src/exceptions/OFException.m @@ -20,11 +20,11 @@ #import "OFString.h" #import "OFNotImplementedException.h" @implementation OFException -+ exceptionWithClass: (Class)class_ ++ (instancetype)exceptionWithClass: (Class)class_ { return [[[self alloc] initWithClass: class_] autorelease]; } - init Index: src/exceptions/OFHTTPRequestFailedException.h ================================================================== --- src/exceptions/OFHTTPRequestFailedException.h +++ src/exceptions/OFHTTPRequestFailedException.h @@ -37,13 +37,13 @@ * \param class_ The class of the object which caused the exception * \param request The HTTP request which failed * \param result The result of the failed HTTP request * \return A new HTTP request failed exception */ -+ exceptionWithClass: (Class)class_ - request: (OFHTTPRequest*)request - result: (OFHTTPRequestResult*)result; ++ (instancetype)exceptionWithClass: (Class)class_ + request: (OFHTTPRequest*)request + result: (OFHTTPRequestResult*)result; /** * Initializes an already allocated HTTP request failed exception * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFHTTPRequestFailedException.m ================================================================== --- src/exceptions/OFHTTPRequestFailedException.m +++ src/exceptions/OFHTTPRequestFailedException.m @@ -24,13 +24,13 @@ #import "autorelease.h" #import "common.h" @implementation OFHTTPRequestFailedException -+ exceptionWithClass: (Class)class_ - request: (OFHTTPRequest*)request - result: (OFHTTPRequestResult*)result ++ (instancetype)exceptionWithClass: (Class)class_ + request: (OFHTTPRequest*)request + result: (OFHTTPRequestResult*)result { return [[[self alloc] initWithClass: class_ request: request result: result] autorelease]; } Index: src/exceptions/OFHashAlreadyCalculatedException.h ================================================================== --- src/exceptions/OFHashAlreadyCalculatedException.h +++ src/exceptions/OFHashAlreadyCalculatedException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param hash The hash which has already been calculated * \return A new hash already calculated exception */ -+ exceptionWithClass: (Class)class_ - hash: (OFHash*)hash; ++ (instancetype)exceptionWithClass: (Class)class_ + hash: (OFHash*)hash; /** * Initializes an already allocated hash already calculated exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFHashAlreadyCalculatedException.m ================================================================== --- src/exceptions/OFHashAlreadyCalculatedException.m +++ src/exceptions/OFHashAlreadyCalculatedException.m @@ -23,12 +23,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFHashAlreadyCalculatedException -+ exceptionWithClass: (Class)class_ - hash: (OFHash*)hash ++ (instancetype)exceptionWithClass: (Class)class_ + hash: (OFHash*)hash { return [[[self alloc] initWithClass: class_ hash: hash] autorelease]; } Index: src/exceptions/OFInvalidArgumentException.h ================================================================== --- src/exceptions/OFInvalidArgumentException.h +++ src/exceptions/OFInvalidArgumentException.h @@ -31,12 +31,12 @@ /** * \param class_ The class of the object which caused the exception * \param selector The selector which doesn't accept the argument * \return A new invalid argument exception */ -+ exceptionWithClass: (Class)class_ - selector: (SEL)selector; ++ (instancetype)exceptionWithClass: (Class)class_ + selector: (SEL)selector; /** * Initializes an already allocated invalid argument exception * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFInvalidArgumentException.m ================================================================== --- src/exceptions/OFInvalidArgumentException.m +++ src/exceptions/OFInvalidArgumentException.m @@ -22,12 +22,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFInvalidArgumentException -+ exceptionWithClass: (Class)class_ - selector: (SEL)selector_ ++ (instancetype)exceptionWithClass: (Class)class_ + selector: (SEL)selector_ { return [[[self alloc] initWithClass: class_ selector: selector_] autorelease]; } Index: src/exceptions/OFInvalidJSONException.h ================================================================== --- src/exceptions/OFInvalidJSONException.h +++ src/exceptions/OFInvalidJSONException.h @@ -31,12 +31,12 @@ /** * \param class_ The class of the object which caused the exception * \param line The line in which the parsing error encountered * \return A new invalid JSON exception */ -+ exceptionWithClass: (Class)class_ - line: (size_t)line; ++ (instancetype)exceptionWithClass: (Class)class_ + line: (size_t)line; /** * Initializes an already allocated invalid JSON exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFInvalidJSONException.m ================================================================== --- src/exceptions/OFInvalidJSONException.m +++ src/exceptions/OFInvalidJSONException.m @@ -20,12 +20,12 @@ #import "OFString.h" #import "OFNotImplementedException.h" @implementation OFInvalidJSONException -+ exceptionWithClass: (Class)class_ - line: (size_t)line ++ (instancetype)exceptionWithClass: (Class)class_ + line: (size_t)line { return [[[self alloc] initWithClass: class_ line: line] autorelease]; } Index: src/exceptions/OFLinkFailedException.h ================================================================== --- src/exceptions/OFLinkFailedException.h +++ src/exceptions/OFLinkFailedException.h @@ -37,13 +37,13 @@ * \param class_ The class of the object which caused the exception * \param source The source for the link * \param destination The destination for the link * \return A new link failed exception */ -+ exceptionWithClass: (Class)class_ - sourcePath: (OFString*)source - destinationPath: (OFString*)destination; ++ (instancetype)exceptionWithClass: (Class)class_ + sourcePath: (OFString*)source + destinationPath: (OFString*)destination; /** * Initializes an already allocated link failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFLinkFailedException.m ================================================================== --- src/exceptions/OFLinkFailedException.m +++ src/exceptions/OFLinkFailedException.m @@ -23,13 +23,13 @@ #import "common.h" #ifndef _WIN32 @implementation OFLinkFailedException -+ exceptionWithClass: (Class)class_ - sourcePath: (OFString*)source - destinationPath: (OFString*)destination ++ (instancetype)exceptionWithClass: (Class)class_ + sourcePath: (OFString*)source + destinationPath: (OFString*)destination { return [[[self alloc] initWithClass: class_ sourcePath: source destinationPath: destination] autorelease]; } Index: src/exceptions/OFListenFailedException.h ================================================================== --- src/exceptions/OFListenFailedException.h +++ src/exceptions/OFListenFailedException.h @@ -38,13 +38,13 @@ * \param class_ The class of the object which caused the exception * \param socket The socket which failed to listen * \param backlog The requested size of the back log * \return A new listen failed exception */ -+ exceptionWithClass: (Class)class_ - socket: (OFTCPSocket*)socket - backLog: (int)backlog; ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFTCPSocket*)socket + backLog: (int)backlog; /** * Initializes an already allocated listen failed exception * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFListenFailedException.m ================================================================== --- src/exceptions/OFListenFailedException.m +++ src/exceptions/OFListenFailedException.m @@ -23,13 +23,13 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFListenFailedException -+ exceptionWithClass: (Class)class_ - socket: (OFTCPSocket*)socket - backLog: (int)backlog ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFTCPSocket*)socket + backLog: (int)backlog { return [[[self alloc] initWithClass: class_ socket: socket backLog: backlog] autorelease]; } Index: src/exceptions/OFMalformedXMLException.h ================================================================== --- src/exceptions/OFMalformedXMLException.h +++ src/exceptions/OFMalformedXMLException.h @@ -32,12 +32,12 @@ /** * \param parser The parser which encountered malformed XML * \return A new malformed XML exception */ -+ exceptionWithClass: (Class)class_ - parser: (OFXMLParser*)parser; ++ (instancetype)exceptionWithClass: (Class)class_ + parser: (OFXMLParser*)parser; /** * Initializes an already allocated malformed XML exception. * * \param parser The parser which encountered malformed XML Index: src/exceptions/OFMalformedXMLException.m ================================================================== --- src/exceptions/OFMalformedXMLException.m +++ src/exceptions/OFMalformedXMLException.m @@ -23,12 +23,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFMalformedXMLException -+ exceptionWithClass: (Class)class_ - parser: (OFXMLParser*)parser ++ (instancetype)exceptionWithClass: (Class)class_ + parser: (OFXMLParser*)parser { return [[[self alloc] initWithClass: class_ parser: parser] autorelease]; } Index: src/exceptions/OFMemoryNotPartOfObjectException.h ================================================================== --- src/exceptions/OFMemoryNotPartOfObjectException.h +++ src/exceptions/OFMemoryNotPartOfObjectException.h @@ -31,12 +31,12 @@ /** * \param class_ The class of the object which caused the exception * \param ptr A pointer to the memory that is not part of the object * \return A new memory not part of object exception */ -+ exceptionWithClass: (Class)class_ - pointer: (void*)ptr; ++ (instancetype)exceptionWithClass: (Class)class_ + pointer: (void*)ptr; /** * Initializes an already allocated memory not part of object exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFMemoryNotPartOfObjectException.m ================================================================== --- src/exceptions/OFMemoryNotPartOfObjectException.m +++ src/exceptions/OFMemoryNotPartOfObjectException.m @@ -20,12 +20,12 @@ #import "OFString.h" #import "OFNotImplementedException.h" @implementation OFMemoryNotPartOfObjectException -+ exceptionWithClass: (Class)class_ - pointer: (void*)ptr ++ (instancetype)exceptionWithClass: (Class)class_ + pointer: (void*)ptr { return [[[self alloc] initWithClass: class_ pointer: ptr] autorelease]; } Index: src/exceptions/OFMutexLockFailedException.h ================================================================== --- src/exceptions/OFMutexLockFailedException.h +++ src/exceptions/OFMutexLockFailedException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param mutex The mutex which is could not be locked * \return A new mutex lock failed exception */ -+ exceptionWithClass: (Class)class_ - mutex: (OFMutex*)mutex; ++ (instancetype)exceptionWithClass: (Class)class_ + mutex: (OFMutex*)mutex; /** * Initializes an already allocated mutex lock failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFMutexLockFailedException.m ================================================================== --- src/exceptions/OFMutexLockFailedException.m +++ src/exceptions/OFMutexLockFailedException.m @@ -21,12 +21,12 @@ #import "OFThread.h" #import "OFNotImplementedException.h" @implementation OFMutexLockFailedException -+ exceptionWithClass: (Class)class_ - mutex: (OFMutex*)mutex ++ (instancetype)exceptionWithClass: (Class)class_ + mutex: (OFMutex*)mutex { return [[[self alloc] initWithClass: class_ mutex: mutex] autorelease]; } Index: src/exceptions/OFMutexStillLockedException.h ================================================================== --- src/exceptions/OFMutexStillLockedException.h +++ src/exceptions/OFMutexStillLockedException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param mutex The mutex which is still locked * \return A new mutex still locked exception */ -+ exceptionWithClass: (Class)class_ - mutex: (OFMutex*)mutex; ++ (instancetype)exceptionWithClass: (Class)class_ + mutex: (OFMutex*)mutex; /** * Initializes an already allocated mutex still locked exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFMutexStillLockedException.m ================================================================== --- src/exceptions/OFMutexStillLockedException.m +++ src/exceptions/OFMutexStillLockedException.m @@ -21,12 +21,12 @@ #import "OFThread.h" #import "OFNotImplementedException.h" @implementation OFMutexStillLockedException -+ exceptionWithClass: (Class)class_ - mutex: (OFMutex*)mutex ++ (instancetype)exceptionWithClass: (Class)class_ + mutex: (OFMutex*)mutex { return [[[self alloc] initWithClass: class_ mutex: mutex] autorelease]; } Index: src/exceptions/OFMutexUnlockFailedException.h ================================================================== --- src/exceptions/OFMutexUnlockFailedException.h +++ src/exceptions/OFMutexUnlockFailedException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param mutex The mutex which could not be unlocked * \return A new mutex unlock failed exception */ -+ exceptionWithClass: (Class)class_ - mutex: (OFMutex*)mutex; ++ (instancetype)exceptionWithClass: (Class)class_ + mutex: (OFMutex*)mutex; /** * Initializes an already allocated mutex unlock failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFMutexUnlockFailedException.m ================================================================== --- src/exceptions/OFMutexUnlockFailedException.m +++ src/exceptions/OFMutexUnlockFailedException.m @@ -21,12 +21,12 @@ #import "OFThread.h" #import "OFNotImplementedException.h" @implementation OFMutexUnlockFailedException -+ exceptionWithClass: (Class)class_ - mutex: (OFMutex*)mutex ++ (instancetype)exceptionWithClass: (Class)class_ + mutex: (OFMutex*)mutex { return [[[self alloc] initWithClass: class_ mutex: mutex] autorelease]; } Index: src/exceptions/OFNotConnectedException.h ================================================================== --- src/exceptions/OFNotConnectedException.h +++ src/exceptions/OFNotConnectedException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param socket The socket which is not connected * \return A new not connected exception */ -+ exceptionWithClass: (Class)class_ - socket: (OFStreamSocket*)socket; ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFStreamSocket*)socket; /** * Initializes an already allocated not connected exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFNotConnectedException.m ================================================================== --- src/exceptions/OFNotConnectedException.m +++ src/exceptions/OFNotConnectedException.m @@ -23,12 +23,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFNotConnectedException -+ exceptionWithClass: (Class)class_ - socket: (OFStreamSocket*)socket ++ (instancetype)exceptionWithClass: (Class)class_ + socket: (OFStreamSocket*)socket { return [[[self alloc] initWithClass: class_ socket: socket] autorelease]; } Index: src/exceptions/OFNotImplementedException.h ================================================================== --- src/exceptions/OFNotImplementedException.h +++ src/exceptions/OFNotImplementedException.h @@ -32,12 +32,12 @@ /** * \param class_ The class of the object which caused the exception * \param selector The selector which is not or not fully implemented * \return A new not implemented exception */ -+ exceptionWithClass: (Class)class_ - selector: (SEL)selector; ++ (instancetype)exceptionWithClass: (Class)class_ + selector: (SEL)selector; /** * Initializes an already allocated not implemented exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFNotImplementedException.m ================================================================== --- src/exceptions/OFNotImplementedException.m +++ src/exceptions/OFNotImplementedException.m @@ -20,12 +20,12 @@ #import "OFString.h" #import "common.h" @implementation OFNotImplementedException -+ exceptionWithClass: (Class)class_ - selector: (SEL)selector ++ (instancetype)exceptionWithClass: (Class)class_ + selector: (SEL)selector { return [[[self alloc] initWithClass: class_ selector: selector] autorelease]; } Index: src/exceptions/OFOpenFileFailedException.h ================================================================== --- src/exceptions/OFOpenFileFailedException.h +++ src/exceptions/OFOpenFileFailedException.h @@ -36,13 +36,13 @@ * \param class_ The class of the object which caused the exception * \param path A string with the path of the file tried to open * \param mode A string with the mode in which the file should have been opened * \return A new open file failed exception */ -+ exceptionWithClass: (Class)class_ - path: (OFString*)path - mode: (OFString*)mode; ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path + mode: (OFString*)mode; /** * Initializes an already allocated open file failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFOpenFileFailedException.m ================================================================== --- src/exceptions/OFOpenFileFailedException.m +++ src/exceptions/OFOpenFileFailedException.m @@ -22,13 +22,13 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFOpenFileFailedException -+ exceptionWithClass: (Class)class_ - path: (OFString*)path - mode: (OFString*)mode ++ (instancetype)exceptionWithClass: (Class)class_ + path: (OFString*)path + mode: (OFString*)mode { return [[[self alloc] initWithClass: class_ path: path mode: mode] autorelease]; } Index: src/exceptions/OFOutOfMemoryException.h ================================================================== --- src/exceptions/OFOutOfMemoryException.h +++ src/exceptions/OFOutOfMemoryException.h @@ -31,12 +31,12 @@ /** * \param class_ The class of the object which caused the exception * \param size The size of the memory that couldn't be allocated * \return A new no memory exception */ -+ exceptionWithClass: (Class)class_ - requestedSize: (size_t)size; ++ (instancetype)exceptionWithClass: (Class)class_ + requestedSize: (size_t)size; /** * Initializes an already allocated no memory exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFOutOfMemoryException.m ================================================================== --- src/exceptions/OFOutOfMemoryException.m +++ src/exceptions/OFOutOfMemoryException.m @@ -18,12 +18,12 @@ #import "OFOutOfMemoryException.h" #import "OFString.h" @implementation OFOutOfMemoryException -+ exceptionWithClass: (Class)class_ - requestedSize: (size_t)size ++ (instancetype)exceptionWithClass: (Class)class_ + requestedSize: (size_t)size { return [[[self alloc] initWithClass: class_ requestedSize: size] autorelease]; } Index: src/exceptions/OFReadOrWriteFailedException.h ================================================================== --- src/exceptions/OFReadOrWriteFailedException.h +++ src/exceptions/OFReadOrWriteFailedException.h @@ -40,13 +40,13 @@ * \param stream The stream which caused the read or write failed exception * \param length The requested length of the data that couldn't be read / * written * \return A new open file failed exception */ -+ exceptionWithClass: (Class)class_ - stream: (OFStream*)stream - requestedLength: (size_t)length; ++ (instancetype)exceptionWithClass: (Class)class_ + stream: (OFStream*)stream + requestedLength: (size_t)length; /** * Initializes an already allocated read or write failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFReadOrWriteFailedException.m ================================================================== --- src/exceptions/OFReadOrWriteFailedException.m +++ src/exceptions/OFReadOrWriteFailedException.m @@ -23,13 +23,13 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFReadOrWriteFailedException -+ exceptionWithClass: (Class)class_ - stream: (OFStream*)stream - requestedLength: (size_t)length ++ (instancetype)exceptionWithClass: (Class)class_ + stream: (OFStream*)stream + requestedLength: (size_t)length { return [[[self alloc] initWithClass: class_ stream: stream requestedLength: length] autorelease]; } Index: src/exceptions/OFRenameFileFailedException.h ================================================================== --- src/exceptions/OFRenameFileFailedException.h +++ src/exceptions/OFRenameFileFailedException.h @@ -36,13 +36,13 @@ * \param class_ The class of the object which caused the exception * \param source The original path * \param destination The new path * \return A new rename file failed exception */ -+ exceptionWithClass: (Class)class_ - sourcePath: (OFString*)source - destinationPath: (OFString*)destination; ++ (instancetype)exceptionWithClass: (Class)class_ + sourcePath: (OFString*)source + destinationPath: (OFString*)destination; /** * Initializes an already allocated rename failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFRenameFileFailedException.m ================================================================== --- src/exceptions/OFRenameFileFailedException.m +++ src/exceptions/OFRenameFileFailedException.m @@ -22,13 +22,13 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFRenameFileFailedException -+ exceptionWithClass: (Class)class_ - sourcePath: (OFString*)source - destinationPath: (OFString*)destination ++ (instancetype)exceptionWithClass: (Class)class_ + sourcePath: (OFString*)source + destinationPath: (OFString*)destination { return [[[self alloc] initWithClass: class_ sourcePath: source destinationPath: destination] autorelease]; } Index: src/exceptions/OFSeekFailedException.h ================================================================== --- src/exceptions/OFSeekFailedException.h +++ src/exceptions/OFSeekFailedException.h @@ -42,14 +42,14 @@ * \param stream The stream for which seeking failed * \param offset The offset to which seeking failed * \param whence To what the offset is relative * \return A new seek failed exception */ -+ exceptionWithClass: (Class)class_ - stream: (OFSeekableStream*)stream - offset: (off_t)offset - whence: (int)whence; ++ (instancetype)exceptionWithClass: (Class)class_ + stream: (OFSeekableStream*)stream + offset: (off_t)offset + whence: (int)whence; /** * Initializes an already allocated seek failed exception. * * \param stream The stream for which seeking failed Index: src/exceptions/OFSeekFailedException.m ================================================================== --- src/exceptions/OFSeekFailedException.m +++ src/exceptions/OFSeekFailedException.m @@ -23,14 +23,14 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFSeekFailedException -+ exceptionWithClass: (Class)class_ - stream: (OFSeekableStream*)stream - offset: (off_t)offset - whence: (int)whence ++ (instancetype)exceptionWithClass: (Class)class_ + stream: (OFSeekableStream*)stream + offset: (off_t)offset + whence: (int)whence { return [[[self alloc] initWithClass: class_ stream: stream offset: offset whence: whence] autorelease]; Index: src/exceptions/OFSetOptionFailedException.h ================================================================== --- src/exceptions/OFSetOptionFailedException.h +++ src/exceptions/OFSetOptionFailedException.h @@ -32,12 +32,12 @@ /** * \param stream The stream for which the option could not be set * \return A new set option failed exception */ -+ exceptionWithClass: (Class)class_ - stream: (OFStream*)stream; ++ (instancetype)exceptionWithClass: (Class)class_ + stream: (OFStream*)stream; /** * Initializes an already allocated set option failed exception. * * \param stream The stream for which the option could not be set Index: src/exceptions/OFSetOptionFailedException.m ================================================================== --- src/exceptions/OFSetOptionFailedException.m +++ src/exceptions/OFSetOptionFailedException.m @@ -23,12 +23,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFSetOptionFailedException -+ exceptionWithClass: (Class)class_ - stream: (OFStream*)stream ++ (instancetype)exceptionWithClass: (Class)class_ + stream: (OFStream*)stream { return [[[self alloc] initWithClass: class_ stream: stream] autorelease]; } Index: src/exceptions/OFSymlinkFailedException.h ================================================================== --- src/exceptions/OFSymlinkFailedException.h +++ src/exceptions/OFSymlinkFailedException.h @@ -37,13 +37,13 @@ * \param class_ The class of the object which caused the exception * \param source The source for the symlink * \param destination The destination for the symlink * \return A new symlink failed exception */ -+ exceptionWithClass: (Class)class_ - sourcePath: (OFString*)source - destinationPath: (OFString*)destination; ++ (instancetype)exceptionWithClass: (Class)class_ + sourcePath: (OFString*)source + destinationPath: (OFString*)destination; /** * Initializes an already allocated symlink failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFSymlinkFailedException.m ================================================================== --- src/exceptions/OFSymlinkFailedException.m +++ src/exceptions/OFSymlinkFailedException.m @@ -23,13 +23,13 @@ #import "common.h" #ifndef _WIN32 @implementation OFSymlinkFailedException -+ exceptionWithClass: (Class)class_ - sourcePath: (OFString*)source - destinationPath: (OFString*)destination ++ (instancetype)exceptionWithClass: (Class)class_ + sourcePath: (OFString*)source + destinationPath: (OFString*)destination { return [[[self alloc] initWithClass: class_ sourcePath: source destinationPath: destination] autorelease]; } Index: src/exceptions/OFThreadJoinFailedException.h ================================================================== --- src/exceptions/OFThreadJoinFailedException.h +++ src/exceptions/OFThreadJoinFailedException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param thread The thread which could not be joined * \return A new thread join failed exception */ -+ exceptionWithClass: (Class)class_ - thread: (OFThread*)thread; ++ (instancetype)exceptionWithClass: (Class)class_ + thread: (OFThread*)thread; /** * Initializes an already allocated thread join failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFThreadJoinFailedException.m ================================================================== --- src/exceptions/OFThreadJoinFailedException.m +++ src/exceptions/OFThreadJoinFailedException.m @@ -21,12 +21,12 @@ #import "OFThread.h" #import "OFNotImplementedException.h" @implementation OFThreadJoinFailedException -+ exceptionWithClass: (Class)class_ - thread: (OFThread*)thread ++ (instancetype)exceptionWithClass: (Class)class_ + thread: (OFThread*)thread { return [[[self alloc] initWithClass: class_ thread: thread] autorelease]; } Index: src/exceptions/OFThreadStartFailedException.h ================================================================== --- src/exceptions/OFThreadStartFailedException.h +++ src/exceptions/OFThreadStartFailedException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param thread The thread which could not be started * \return An initialized thread start failed exception */ -+ exceptionWithClass: (Class)class_ - thread: (OFThread*)thread; ++ (instancetype)exceptionWithClass: (Class)class_ + thread: (OFThread*)thread; /** * Initializes an already allocated thread start failed exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFThreadStartFailedException.m ================================================================== --- src/exceptions/OFThreadStartFailedException.m +++ src/exceptions/OFThreadStartFailedException.m @@ -21,12 +21,12 @@ #import "OFThread.h" #import "OFNotImplementedException.h" @implementation OFThreadStartFailedException -+ exceptionWithClass: (Class)class_ - thread: (OFThread*)thread ++ (instancetype)exceptionWithClass: (Class)class_ + thread: (OFThread*)thread { return [[[self alloc] initWithClass: class_ thread: thread] autorelease]; } Index: src/exceptions/OFThreadStillRunningException.h ================================================================== --- src/exceptions/OFThreadStillRunningException.h +++ src/exceptions/OFThreadStillRunningException.h @@ -33,12 +33,12 @@ /** * \param class_ The class of the object which caused the exception * \param thread The thread which is still running * \return A new thread still running exception */ -+ exceptionWithClass: (Class)class_ - thread: (OFThread*)thread; ++ (instancetype)exceptionWithClass: (Class)class_ + thread: (OFThread*)thread; /** * Initializes an already allocated thread still running exception. * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFThreadStillRunningException.m ================================================================== --- src/exceptions/OFThreadStillRunningException.m +++ src/exceptions/OFThreadStillRunningException.m @@ -21,12 +21,12 @@ #import "OFThread.h" #import "OFNotImplementedException.h" @implementation OFThreadStillRunningException -+ exceptionWithClass: (Class)class_ - thread: (OFThread*)thread ++ (instancetype)exceptionWithClass: (Class)class_ + thread: (OFThread*)thread { return [[[self alloc] initWithClass: class_ thread: thread] autorelease]; } Index: src/exceptions/OFUnboundNamespaceException.h ================================================================== --- src/exceptions/OFUnboundNamespaceException.h +++ src/exceptions/OFUnboundNamespaceException.h @@ -33,20 +33,20 @@ /** * \param class_ The class of the object which caused the exception * \param ns The namespace which is unbound * \return A new unbound namespace exception */ -+ exceptionWithClass: (Class)class_ - namespace: (OFString*)ns; ++ (instancetype)exceptionWithClass: (Class)class_ + namespace: (OFString*)ns; /** * \param class_ The class of the object which caused the exception * \param prefix The prefix which is unbound * \return A new unbound namespace exception */ -+ exceptionWithClass: (Class)class_ - prefix: (OFString*)prefix; ++ (instancetype)exceptionWithClass: (Class)class_ + prefix: (OFString*)prefix; /** * Initializes an already allocated unbound namespace exception * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFUnboundNamespaceException.m ================================================================== --- src/exceptions/OFUnboundNamespaceException.m +++ src/exceptions/OFUnboundNamespaceException.m @@ -22,19 +22,19 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFUnboundNamespaceException -+ exceptionWithClass: (Class)class_ - namespace: (OFString*)ns ++ (instancetype)exceptionWithClass: (Class)class_ + namespace: (OFString*)ns { return [[[self alloc] initWithClass: class_ namespace: ns] autorelease]; } -+ exceptionWithClass: (Class)class_ - prefix: (OFString*)prefix ++ (instancetype)exceptionWithClass: (Class)class_ + prefix: (OFString*)prefix { return [[[self alloc] initWithClass: class_ prefix: prefix] autorelease]; } Index: src/exceptions/OFUnsupportedProtocolException.h ================================================================== --- src/exceptions/OFUnsupportedProtocolException.h +++ src/exceptions/OFUnsupportedProtocolException.h @@ -34,12 +34,12 @@ /** * \param class_ The class of the object which caused the exception * \param url The URL whose protocol is unsupported * \return A new unsupported protocol exception */ -+ exceptionWithClass: (Class)class_ - URL: (OFURL*)url; ++ (instancetype)exceptionWithClass: (Class)class_ + URL: (OFURL*)url; /** * Initializes an already allocated unsupported protocol exception * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFUnsupportedProtocolException.m ================================================================== --- src/exceptions/OFUnsupportedProtocolException.m +++ src/exceptions/OFUnsupportedProtocolException.m @@ -23,12 +23,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFUnsupportedProtocolException -+ exceptionWithClass: (Class)class_ - URL: (OFURL*)url ++ (instancetype)exceptionWithClass: (Class)class_ + URL: (OFURL*)url { return [[[self alloc] initWithClass: class_ URL: url] autorelease]; } Index: src/exceptions/OFUnsupportedVersionException.h ================================================================== --- src/exceptions/OFUnsupportedVersionException.h +++ src/exceptions/OFUnsupportedVersionException.h @@ -32,12 +32,12 @@ /** * \param class_ The class of the object which caused the exception * \param version The version which is unsupported * \return A new unsupported version exception */ -+ exceptionWithClass: (Class)class_ - version: (OFString*)version; ++ (instancetype)exceptionWithClass: (Class)class_ + version: (OFString*)version; /** * Initializes an already allocated unsupported protocol exception * * \param class_ The class of the object which caused the exception Index: src/exceptions/OFUnsupportedVersionException.m ================================================================== --- src/exceptions/OFUnsupportedVersionException.m +++ src/exceptions/OFUnsupportedVersionException.m @@ -22,12 +22,12 @@ #import "OFNotImplementedException.h" #import "common.h" @implementation OFUnsupportedVersionException -+ exceptionWithClass: (Class)class_ - version: (OFString*)version ++ (instancetype)exceptionWithClass: (Class)class_ + version: (OFString*)version { return [[[self alloc] initWithClass: class_ version: version] autorelease]; } Index: tests/OFDictionaryTests.m ================================================================== --- tests/OFDictionaryTests.m +++ tests/OFDictionaryTests.m @@ -37,11 +37,12 @@ @implementation TestsAppDelegate (OFDictionaryTests) - (void)dictionaryTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; - OFMutableDictionary *dict = [OFMutableDictionary dictionary], *dict2; + OFMutableDictionary *dict = [OFMutableDictionary dictionary]; + OFDictionary *idict; OFEnumerator *key_enum, *obj_enum; OFArray *akeys, *avalues; [dict setObject: values[0] forKey: keys[0]]; @@ -190,38 +191,37 @@ #endif TEST(@"-[count]", [dict count] == 2) TEST(@"+[dictionaryWithKeysAndObjects:]", - (dict = [OFDictionary dictionaryWithKeysAndObjects: @"foo", @"bar", - @"baz", @"qux", - nil]) && - [[dict objectForKey: @"foo"] isEqual: @"bar"] && - [[dict objectForKey: @"baz"] isEqual: @"qux"]) + (idict = [OFDictionary dictionaryWithKeysAndObjects: @"foo", @"bar", + @"baz", @"qux", + nil]) && + [[idict objectForKey: @"foo"] isEqual: @"bar"] && + [[idict objectForKey: @"baz"] isEqual: @"qux"]) TEST(@"+[dictionaryWithObject:forKey:]", - (dict = [OFDictionary dictionaryWithObject: @"bar" - forKey: @"foo"]) && - [[dict objectForKey: @"foo"] isEqual: @"bar"]) + (idict = [OFDictionary dictionaryWithObject: @"bar" + forKey: @"foo"]) && + [[idict objectForKey: @"foo"] isEqual: @"bar"]) akeys = [OFArray arrayWithObjects: keys[0], keys[1], nil]; avalues = [OFArray arrayWithObjects: values[0], values[1], nil]; TEST(@"+[dictionaryWithObjects:forKeys:]", - (dict = [OFDictionary dictionaryWithObjects: avalues - forKeys: akeys]) && - [[dict objectForKey: keys[0]] isEqual: values[0]] && - [[dict objectForKey: keys[1]] isEqual: values[1]]) + (idict = [OFDictionary dictionaryWithObjects: avalues + forKeys: akeys]) && + [[idict objectForKey: keys[0]] isEqual: values[0]] && + [[idict objectForKey: keys[1]] isEqual: values[1]]) TEST(@"-[copy]", - (dict = [[dict copy] autorelease]) && - [[dict objectForKey: keys[0]] isEqual: values[0]] && - [[dict objectForKey: keys[1]] isEqual: values[1]]) - - dict2 = dict; - TEST(@"-[mutableCopy]", - (dict = [[dict mutableCopy] autorelease]) && - [dict count] == [dict2 count] && + (idict = [[idict copy] autorelease]) && + [[idict objectForKey: keys[0]] isEqual: values[0]] && + [[idict objectForKey: keys[1]] isEqual: values[1]]) + + TEST(@"-[mutableCopy]", + (dict = [[idict mutableCopy] autorelease]) && + [dict count] == [idict count] && [[dict objectForKey: keys[0]] isEqual: values[0]] && [[dict objectForKey: keys[1]] isEqual: values[1]] && R([dict setObject: @"value3" forKey: @"key3"]) && [[dict objectForKey: @"key3"] isEqual: @"value3"] && @@ -234,15 +234,15 @@ R([dict removeObjectForKey: keys[0]]) && [dict objectForKey: keys[0]] == nil) [dict setObject: @"foo" forKey: keys[0]]; - TEST(@"-[isEqual:]", ![dict isEqual: dict2] && + TEST(@"-[isEqual:]", ![dict isEqual: idict] && R([dict removeObjectForKey: @"key3"]) && - ![dict isEqual: dict2] && + ![dict isEqual: idict] && R([dict setObject: values[0] forKey: keys[0]]) && - [dict isEqual: dict2]) + [dict isEqual: idict]) [pool drain]; } @end Index: tests/OFStringTests.m ================================================================== --- tests/OFStringTests.m +++ tests/OFStringTests.m @@ -71,10 +71,11 @@ @implementation TestsAppDelegate (OFStringTests) - (void)stringTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFMutableString *s[3]; + OFString *is; OFArray *a; int i; const of_unichar_t *ua; const uint16_t *u16a; EntityHandler *h; @@ -155,31 +156,31 @@ "foobar" length: 6]) && [s[0] isEqual: @"foo"]) TEST(@"+[stringWithUnicodeString:]", - (s[1] = [OFString stringWithUnicodeString: ucstr]) && - [s[1] isEqual: @"fööbär🀺"] && - (s[1] = [OFString stringWithUnicodeString: sucstr]) && - [s[1] isEqual: @"fööbär🀺"]) + (is = [OFString stringWithUnicodeString: ucstr]) && + [is isEqual: @"fööbär🀺"] && + (is = [OFString stringWithUnicodeString: sucstr]) && + [is isEqual: @"fööbär🀺"]) TEST(@"+[stringWithUTF16String:]", - (s[1] = [OFString stringWithUTF16String: utf16str]) && - [s[1] isEqual: @"fööbär🀺"] && - (s[1] = [OFString stringWithUTF16String: sutf16str]) && - [s[1] isEqual: @"fööbär🀺"]) + (is = [OFString stringWithUTF16String: utf16str]) && + [is isEqual: @"fööbär🀺"] && + (is = [OFString stringWithUTF16String: sutf16str]) && + [is isEqual: @"fööbär🀺"]) - TEST(@"+[stringWithContentsOfFile:encoding]", (s[1] = [OFString + TEST(@"+[stringWithContentsOfFile:encoding]", (is = [OFString stringWithContentsOfFile: @"testfile.txt" encoding: OF_STRING_ENCODING_ISO_8859_1]) && - [s[1] isEqual: @"testäöü"]) + [is isEqual: @"testäöü"]) - TEST(@"+[stringWithContentsOfURL:encoding]", (s[1] = [OFString + TEST(@"+[stringWithContentsOfURL:encoding]", (is = [OFString stringWithContentsOfURL: [OFURL URLWithString: @"file://testfile.txt"] encoding: OF_STRING_ENCODING_ISO_8859_1]) && - [s[1] isEqual: @"testäöü"]) + [is isEqual: @"testäöü"]) TEST(@"-[appendUTFString:withLength:]", R([s[0] appendUTF8String: "foo\xEF\xBB\xBF" "barqux" + 3 withLength: 6]) && [s[0] isEqual: @"foobar"]) @@ -272,18 +273,18 @@ [[a objectAtIndex: i++] isEqual: @"foo"] && [[a objectAtIndex: i++] isEqual: @"bar"] && [[a objectAtIndex: i++] isEqual: @"baz"]) TEST(@"+[stringWithPath:]", - (s[0] = [OFString stringWithPath: @"foo", @"bar", @"baz", nil]) && + (is = [OFString stringWithPath: @"foo", @"bar", @"baz", nil]) && #ifndef _WIN32 - [s[0] isEqual: @"foo/bar/baz"] && + [is isEqual: @"foo/bar/baz"] && #else - [s[0] isEqual: @"foo\\bar\\baz"] && + [is isEqual: @"foo\\bar\\baz"] && #endif - (s[0] = [OFString stringWithPath: @"foo", nil]) && - [s[0] isEqual: @"foo"]) + (is = [OFString stringWithPath: @"foo", nil]) && + [is isEqual: @"foo"]) TEST(@"-[pathComponents]", /* /tmp */ (a = [@"/tmp" pathComponents]) && [a count] == 2 && [[a objectAtIndex: 0] isEqual: @""] &&