Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -302,14 +302,14 @@ + (void)test { } @end - void* + void * objc_msg_lookup(void *obj, void *sel) { - return (void*)0; + return (void *)0; } void __objc_exec_class(void *module) { @@ -1242,11 +1242,11 @@ static struct { struct objc_class *_isa; } object; ], [ - Foo *test = (Foo*)&object; + Foo *test = (Foo *)&object; (void)test; /* Get rid of unused variable warning */ ], [ AC_MSG_RESULT(no) ], [ AC_MSG_RESULT(yes) @@ -1267,19 +1267,19 @@ Foo *_foo; } @property (readonly, retain) Foo *foo; - + (Foo*)foo; + + (Foo *)foo; @end @implementation Foo @synthesize foo = _foo; - + (Foo*)foo + + (Foo *)foo { - return (Foo*)0; + return (Foo *)0; } @end ], [ ], [ AC_MSG_RESULT(no) Index: generators/TableGenerator.h ================================================================== --- generators/TableGenerator.h +++ generators/TableGenerator.h @@ -34,8 +34,8 @@ size_t _casefoldingTableSize; } - (void)parseUnicodeData; - (void)parseCaseFolding; -- (void)writeTablesToFile: (OFString*)path; -- (void)writeHeaderToFile: (OFString*)path; +- (void)writeTablesToFile: (OFString *)path; +- (void)writeHeaderToFile: (OFString *)path; @end Index: generators/TableGenerator.m ================================================================== --- generators/TableGenerator.m +++ generators/TableGenerator.m @@ -87,11 +87,11 @@ client = [OFHTTPClient client]; response = [client performRequest: request]; while ((line = [response readLine]) != nil) { void *pool2; - OFArray OF_GENERIC(OFString*) *split; + OFArray OF_GENERIC(OFString *) *split; OFString *const *splitObjects; of_unichar_t codep; if ([line length] == 0) continue; @@ -136,11 +136,11 @@ client = [OFHTTPClient client]; response = [client performRequest: request]; while ((line = [response readLine]) != nil) { void *pool2; - OFArray OF_GENERIC(OFString*) *split; + OFArray OF_GENERIC(OFString *) *split; OFString *const *splitObjects; of_unichar_t codep; if ([line length] == 0 || [line hasPrefix: @"#"]) continue; @@ -168,11 +168,11 @@ [of_stdout writeLine: @" done"]; objc_autoreleasePoolPop(pool); } -- (void)writeTablesToFile: (OFString*)path +- (void)writeTablesToFile: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFFile *file = [OFFile fileWithPath: path mode: @"wb"]; @@ -444,11 +444,11 @@ [file writeString: @"\n};\n"]; objc_autoreleasePoolPop(pool); } -- (void)writeHeaderToFile: (OFString*)path +- (void)writeHeaderToFile: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFFile *file = [OFFile fileWithPath: path mode: @"wb"]; Index: src/OFApplication.h ================================================================== --- src/OFApplication.h +++ src/OFApplication.h @@ -123,12 +123,12 @@ * @ref OFApplicationDelegate::applicationDidFinishLaunching. */ @interface OFApplication: OFObject { OFString *_programName; - OFArray OF_GENERIC(OFString*) *_arguments; - OFDictionary OF_GENERIC(OFString*, OFString*) *_environment; + OFArray OF_GENERIC(OFString *) *_arguments; + OFDictionary OF_GENERIC(OFString *, OFString *) *_environment; int *_argc; char ***_argv; @public id _delegate; void (*_SIGINTHandler)(id, SEL); @@ -145,45 +145,45 @@ @property (readonly, nonatomic) OFString *programName; /*! * The arguments passed to the application. */ -@property (readonly, nonatomic) OFArray OF_GENERIC(OFString*) *arguments; +@property (readonly, nonatomic) OFArray OF_GENERIC(OFString *) *arguments; /*! * The environment of the application. */ @property (readonly, nonatomic) - OFDictionary OF_GENERIC(OFString*, OFString*) *environment; + OFDictionary OF_GENERIC(OFString *, OFString *) *environment; /*! * @brief Returns the only OFApplication instance in the application. * * @return The only OFApplication instance in the application */ -+ (OFApplication*)sharedApplication; ++ (OFApplication *)sharedApplication; /*! * @brief Returns the name of the program (argv[0]). * * @return The name of the program (argv[0]) */ -+ (OFString*)programName; ++ (OFString *)programName; /*! * @brief Returns the arguments passed to the application. * * @return The arguments passed to the application */ -+ (OFArray OF_GENERIC(OFString*)*)arguments; ++ (OFArray OF_GENERIC(OFString *) *)arguments; /*! * @brief Returns the environment of the application. * * @return The environment of the application */ -+ (OFDictionary OF_GENERIC(OFString*, OFString*)*)environment; ++ (OFDictionary OF_GENERIC(OFString *, OFString *) *)environment; /*! * @brief Terminates the application with the EXIT_SUCCESS status. */ + (void)terminate OF_NO_RETURN; @@ -201,11 +201,11 @@ * * This is only available if `OF_HAVE_SANDBOX` is defined. * * @param sandbox The sandbox to activate */ -+ (void)activateSandbox: (OFSandbox*)sandbox; ++ (void)activateSandbox: (OFSandbox *)sandbox; #endif /*! * @brief Gets argc and argv. * @@ -247,11 +247,11 @@ * * This is only available if `OF_HAVE_SANDBOX` is defined. * * @param sandbox The sandbox to activate */ -- (void)activateSandbox: (OFSandbox*)sandbox; +- (void)activateSandbox: (OFSandbox *)sandbox; #endif @end #ifdef __cplusplus extern "C" { Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -43,11 +43,11 @@ # include #elif defined(OF_WINDOWS) # include extern int _CRT_glob; -extern void __wgetmainargs(int*, wchar_t***, wchar_t***, int, int*); +extern void __wgetmainargs(int *, wchar_t ***, wchar_t ***, int, int *); #elif !defined(OF_IOS) extern char **environ; #endif #ifdef OF_PSP @@ -66,15 +66,15 @@ # define SA_RESTART 0 # endif #endif @interface OFApplication () -- (void)OF_setArgumentCount: (int*)argc - andArgumentValues: (char**[])argv; +- (void)OF_setArgumentCount: (int *)argc + andArgumentValues: (char **[])argv; #ifdef OF_WINDOWS - (void)OF_setArgumentCount: (int)argc - andWideArgumentValues: (wchar_t*[])argv; + andWideArgumentValues: (wchar_t *[])argv; #endif - (void)OF_run; @end static OFApplication *app = nil; @@ -153,26 +153,26 @@ @implementation OFApplication @synthesize programName = _programName, arguments = _arguments; @synthesize environment = _environment; -+ (OFApplication*)sharedApplication ++ (OFApplication *)sharedApplication { return app; } -+ (OFString*)programName ++ (OFString *)programName { return [app programName]; } -+ (OFArray*)arguments ++ (OFArray *)arguments { return [app arguments]; } -+ (OFDictionary*)environment ++ (OFDictionary *)environment { return [app environment]; } + (void)terminate @@ -192,11 +192,11 @@ OF_UNREACHABLE #endif } #ifdef OF_HAVE_SANDBOX -+ (void)activateSandbox: (OFSandbox*)sandbox ++ (void)activateSandbox: (OFSandbox *)sandbox { [app activateSandbox: sandbox]; } #endif @@ -357,12 +357,12 @@ [_environment release]; [super dealloc]; } -- (void)OF_setArgumentCount: (int*)argc - andArgumentValues: (char***)argv +- (void)OF_setArgumentCount: (int *)argc + andArgumentValues: (char ***)argv { #ifndef OF_WINDOWS void *pool = objc_autoreleasePoolPush(); OFMutableArray *arguments; of_string_encoding_t encoding; @@ -398,11 +398,11 @@ #endif } #ifdef OF_WINDOWS - (void)OF_setArgumentCount: (int)argc - andWideArgumentValues: (wchar_t**)argv + andWideArgumentValues: (wchar_t **)argv { void *pool = objc_autoreleasePoolPush(); OFMutableArray *arguments; if (argc > 0) { @@ -419,12 +419,12 @@ objc_autoreleasePoolPop(pool); } #endif -- (void)getArgumentCount: (int**)argc - andArgumentValues: (char****)argv +- (void)getArgumentCount: (int **)argc + andArgumentValues: (char ****)argv { *argc = _argc; *argv = _argv; } @@ -440,11 +440,11 @@ sigemptyset(&sa.sa_mask); # define REGISTER_SIGNAL(sig) \ if ([delegate respondsToSelector: \ @selector(applicationDidReceive##sig)]) { \ - _##sig##Handler = (void(*)(id, SEL))[(id)delegate \ + _##sig##Handler = (void (*)(id, SEL))[(id)delegate \ methodForSelector: \ @selector(applicationDidReceive##sig)]; \ \ sa.sa_handler = handle##sig; \ } else \ @@ -453,11 +453,11 @@ OF_ENSURE(sigaction(sig, &sa, NULL) == 0); #else # define REGISTER_SIGNAL(sig) \ if ([delegate respondsToSelector: \ @selector(applicationDidReceive##sig)]) { \ - _##sig##Handler = (void(*)(id, SEL))[(id)delegate \ + _##sig##Handler = (void (*)(id, SEL))[(id)delegate \ methodForSelector: \ @selector(applicationDidReceive##sig)]; \ signal(sig, handle##sig); \ } else \ signal(sig, SIG_DFL); @@ -521,11 +521,11 @@ OF_UNREACHABLE } #ifdef OF_HAVE_SANDBOX -- (void)activateSandbox: (OFSandbox*)sandbox +- (void)activateSandbox: (OFSandbox *)sandbox { # ifdef OF_HAVE_PLEDGE void *pool = objc_autoreleasePoolPush(); const char *promises = [[sandbox pledgeString] cStringWithEncoding: [OFLocalization encoding]]; Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -85,11 +85,11 @@ * @class OFArray OFArray.h ObjFW/OFArray.h * * @brief An abstract class for storing objects in an array. */ #ifdef OF_HAVE_GENERICS -@interface OFArray : +@interface OFArray: #else # ifndef DOXYGEN # define ObjectType id # endif @interface OFArray: @@ -123,11 +123,11 @@ * @brief Creates a new OFArray with the objects from the specified array. * * @param array An array * @return A new autoreleased OFArray */ -+ (instancetype)arrayWithArray: (OFArray OF_GENERIC(ObjectType)*)array; ++ (instancetype)arrayWithArray: (OFArray OF_GENERIC(ObjectType) *)array; /*! * @brief Creates a new OFArray with the objects from the specified C array of * the specified length. * @@ -169,11 +169,11 @@ * @brief Initializes an OFArray with the objects from the specified array. * * @param array An array * @return An initialized OFArray */ -- initWithArray: (OFArray OF_GENERIC(ObjectType)*)array; +- initWithArray: (OFArray OF_GENERIC(ObjectType) *)array; /*! * @brief Initializes an OFArray with the objects from the specified C array of * the specified length. * @@ -207,11 +207,11 @@ * @note Any nil values are replaced with @ref OFNull! * * @param key The key of the value to return * @return The value for the specified key */ -- (nullable id)valueForKey: (OFString*)key; +- (nullable id)valueForKey: (OFString *)key; /*! * @brief Set the value for the specified key * * If the key starts with an `@`, the `@` is stripped and @@ -223,11 +223,11 @@ * * @param value The value for the specified key * @param key The key of the value to set */ - (void)setValue: (nullable id)value - forKey: (OFString*)key; + forKey: (OFString *)key; /*! * @brief Copies the objects at the specified range to the specified buffer. * * @param buffer The buffer to copy the objects to @@ -306,19 +306,19 @@ * @brief Returns the objects in the specified range as a new OFArray. * * @param range The range for the subarray * @return The subarray as a new autoreleased OFArray */ -- (OFArray OF_GENERIC(ObjectType)*)objectsInRange: (of_range_t)range; +- (OFArray OF_GENERIC(ObjectType) *)objectsInRange: (of_range_t)range; /*! * @brief Creates a string by joining all objects of the array. * * @param separator The string with which the objects should be joined * @return A string containing all objects joined by the separator */ -- (OFString*)componentsJoinedByString: (OFString*)separator; +- (OFString *)componentsJoinedByString: (OFString *)separator; /*! * @brief Creates a string by joining all objects of the array. * * @param separator The string with which the objects should be joined @@ -327,23 +327,23 @@ * Value | Description * ----------------------|---------------------- * `OF_ARRAY_SKIP_EMPTY` | Skip empty components * @return A string containing all objects joined by the separator */ -- (OFString*)componentsJoinedByString: (OFString*)separator - options: (int)options; +- (OFString *)componentsJoinedByString: (OFString *)separator + options: (int)options; /*! * @brief Creates a string by calling the selector on all objects of the array * and joining the strings returned by calling the selector. * * @param separator The string with which the objects should be joined * @param selector The selector to perform on the objects * @return A string containing all objects joined by the separator */ -- (OFString*)componentsJoinedByString: (OFString*)separator - usingSelector: (SEL)selector; +- (OFString *)componentsJoinedByString: (OFString *)separator + usingSelector: (SEL)selector; /*! * @brief Creates a string by calling the selector on all objects of the array * and joining the strings returned by calling the selector. * @@ -354,13 +354,13 @@ * Value | Description * ----------------------|---------------------- * `OF_ARRAY_SKIP_EMPTY` | Skip empty components * @return A string containing all objects joined by the separator */ -- (OFString*)componentsJoinedByString: (OFString*)separator - usingSelector: (SEL)selector - options: (int)options; +- (OFString *)componentsJoinedByString: (OFString *)separator + usingSelector: (SEL)selector + options: (int)options; /*! * @brief Performs the specified selector on all objects in the array. * * @param selector The selector to perform on all objects in the array @@ -381,11 +381,11 @@ /*! * @brief Returns a sorted copy of the array. * * @return A sorted copy of the array */ -- (OFArray OF_GENERIC(ObjectType)*)sortedArray; +- (OFArray OF_GENERIC(ObjectType) *)sortedArray; /*! * @brief Returns a sorted copy of the array. * * @param options The options to use when sorting the array.@n @@ -393,51 +393,51 @@ * Value | Description * ---------------------------|------------------------- * `OF_ARRAY_SORT_DESCENDING` | Sort in descending order * @return A sorted copy of the array */ -- (OFArray OF_GENERIC(ObjectType)*)sortedArrayWithOptions: (int)options; +- (OFArray OF_GENERIC(ObjectType) *)sortedArrayWithOptions: (int)options; /*! * @brief Returns a copy of the array with the order reversed. * * @return A copy of the array with the order reversed */ -- (OFArray OF_GENERIC(ObjectType)*)reversedArray; +- (OFArray OF_GENERIC(ObjectType) *)reversedArray; /*! * @brief Creates a new array with the specified object added. * * @param object The object to add * @return A new array with the specified object added */ -- (OFArray OF_GENERIC(ObjectType)*)arrayByAddingObject: (ObjectType)object; +- (OFArray OF_GENERIC(ObjectType) *)arrayByAddingObject: (ObjectType)object; /*! * @brief Creates a new array with the objects from the specified array added. * * @param array The array with objects to add * @return A new array with the objects from the specified array added */ -- (OFArray OF_GENERIC(ObjectType)*)arrayByAddingObjectsFromArray: - (OFArray OF_GENERIC(ObjectType)*)array; +- (OFArray OF_GENERIC(ObjectType) *)arrayByAddingObjectsFromArray: + (OFArray OF_GENERIC(ObjectType) *)array; /*! * @brief Creates a new array with the specified object removed. * * @param object The object to remove * @return A new array with the specified object removed */ -- (OFArray OF_GENERIC(ObjectType)*)arrayByRemovingObject: (ObjectType)object; +- (OFArray OF_GENERIC(ObjectType) *)arrayByRemovingObject: (ObjectType)object; /*! * @brief Returns an OFEnumerator to enumerate through all objects of the * array. * * @returns An OFEnumerator to enumerate through all objects of the array */ -- (OFEnumerator OF_GENERIC(ObjectType)*)objectEnumerator; +- (OFEnumerator OF_GENERIC(ObjectType) *)objectEnumerator; #ifdef OF_HAVE_BLOCKS /*! * @brief Executes a block for each object. * @@ -449,21 +449,21 @@ * @brief Creates a new array, mapping each object using the specified block. * * @param block A block which maps an object for each object * @return A new, autoreleased OFArray */ -- (OFArray*)mappedArrayUsingBlock: (of_array_map_block_t)block; +- (OFArray *)mappedArrayUsingBlock: (of_array_map_block_t)block; /*! * @brief Creates a new array, only containing the objects for which the block * returns true. * * @param block A block which determines if the object should be in the new * array * @return A new, autoreleased OFArray */ -- (OFArray OF_GENERIC(ObjectType)*)filteredArrayUsingBlock: +- (OFArray OF_GENERIC(ObjectType) *)filteredArrayUsingBlock: (of_array_filter_block_t)block; /*! * @brief Folds the array to a single object using the specified block. * @@ -494,11 +494,11 @@ unsigned long _mutations; unsigned long *_mutationsPtr; size_t _position; } -- initWithArray: (OFArray*)data +- initWithArray: (OFArray *)data mutationsPtr: (unsigned long *_Nullable)mutationsPtr; @end OF_ASSUME_NONNULL_END Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -36,12 +36,12 @@ static struct { Class isa; } placeholder; @interface OFArray () -- (OFString*)OF_JSONRepresentationWithOptions: (int)options - depth: (size_t)depth; +- (OFString *)OF_JSONRepresentationWithOptions: (int)options + depth: (size_t)depth; @end @interface OFArray_placeholder: OFArray @end @@ -74,23 +74,23 @@ { return (id)[[OFArray_adjacent alloc] initWithObject: firstObject arguments: arguments]; } -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array { return (id)[[OFArray_adjacent alloc] initWithArray: array]; } -- initWithObjects: (id const*)objects +- initWithObjects: (id const *)objects count: (size_t)count { return (id)[[OFArray_adjacent alloc] initWithObjects: objects count: count]; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { return (id)[[OFArray_adjacent alloc] initWithSerialization: element]; } - retain @@ -149,16 +149,16 @@ va_end(arguments); return ret; } -+ (instancetype)arrayWithArray: (OFArray*)array ++ (instancetype)arrayWithArray: (OFArray *)array { return [[[self alloc] initWithArray: array] autorelease]; } -+ (instancetype)arrayWithObjects: (id const*)objects ++ (instancetype)arrayWithObjects: (id const *)objects count: (size_t)count { return [[[self alloc] initWithObjects: objects count: count] autorelease]; } @@ -206,39 +206,39 @@ arguments: (va_list)arguments { OF_INVALID_INIT_METHOD } -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array { OF_INVALID_INIT_METHOD } -- initWithObjects: (id const*)objects +- initWithObjects: (id const *)objects count: (size_t)count { OF_INVALID_INIT_METHOD } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { OF_INVALID_INIT_METHOD } - (size_t)count { OF_UNRECOGNIZED_SELECTOR } -- (void)getObjects: (id*)buffer +- (void)getObjects: (id *)buffer inRange: (of_range_t)range { for (size_t i = 0; i < range.length; i++) buffer[i] = [self objectAtIndex: range.location + i]; } -- (id const*)objects +- (id const *)objects { OFObject *container; size_t count; id *buffer; @@ -271,11 +271,11 @@ - (id)objectAtIndexedSubscript: (size_t)index { return [self objectAtIndex: index]; } -- (id)valueForKey: (OFString*)key +- (id)valueForKey: (OFString *)key { OFMutableArray *ret; if ([key hasPrefix: @"@"]) { void *pool = objc_autoreleasePoolPush(); @@ -304,11 +304,11 @@ return ret; } - (void)setValue: (id)value - forKey: (OFString*)key + forKey: (OFString *)key { if ([key hasPrefix: @"@"]) { void *pool = objc_autoreleasePoolPush(); key = [key substringWithRange: of_range(1, [key length] - 1)]; @@ -387,11 +387,11 @@ return [self objectAtIndex: count - 1]; return nil; } -- (OFArray*)objectsInRange: (of_range_t)range +- (OFArray *)objectsInRange: (of_range_t)range { OFArray *ret; id *buffer; if (range.length > SIZE_MAX - range.location || @@ -416,36 +416,36 @@ } return ret; } -- (OFString*)componentsJoinedByString: (OFString*)separator +- (OFString *)componentsJoinedByString: (OFString *)separator { return [self componentsJoinedByString: separator usingSelector: @selector(description) options: 0]; } -- (OFString*)componentsJoinedByString: (OFString*)separator - options: (int)options +- (OFString *)componentsJoinedByString: (OFString *)separator + options: (int)options { return [self componentsJoinedByString: separator usingSelector: @selector(description) options: options]; } -- (OFString*)componentsJoinedByString: (OFString*)separator - usingSelector: (SEL)selector +- (OFString *)componentsJoinedByString: (OFString *)separator + usingSelector: (SEL)selector { return [self componentsJoinedByString: separator usingSelector: selector options: 0]; } -- (OFString*)componentsJoinedByString: (OFString*)separator - usingSelector: (SEL)selector - options: (int)options +- (OFString *)componentsJoinedByString: (OFString *)separator + usingSelector: (SEL)selector + options: (int)options { OFMutableString *ret; if (separator == nil) @throw [OFInvalidArgumentException exception]; @@ -529,11 +529,11 @@ OF_HASH_FINALIZE(hash); return hash; } -- (OFString*)description +- (OFString *)description { void *pool; OFMutableString *ret; if ([self count] == 0) @@ -557,11 +557,11 @@ [ret makeImmutable]; return [ret autorelease]; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; if ([self isKindOfClass: [OFMutableArray class]]) @@ -584,24 +584,24 @@ objc_autoreleasePoolPop(pool); return [element autorelease]; } -- (OFString*)JSONRepresentation +- (OFString *)JSONRepresentation { return [self OF_JSONRepresentationWithOptions: 0 depth: 0]; } -- (OFString*)JSONRepresentationWithOptions: (int)options +- (OFString *)JSONRepresentationWithOptions: (int)options { return [self OF_JSONRepresentationWithOptions: options depth: 0]; } -- (OFString*)OF_JSONRepresentationWithOptions: (int)options - depth: (size_t)depth +- (OFString *)OF_JSONRepresentationWithOptions: (int)options + depth: (size_t)depth { OFMutableString *JSON = [OFMutableString stringWithString: @"["]; void *pool = objc_autoreleasePoolPush(); size_t i, count = [self count]; @@ -654,11 +654,11 @@ objc_autoreleasePoolPop(pool); return JSON; } -- (OFDataArray*)messagePackRepresentation +- (OFDataArray *)messagePackRepresentation { OFDataArray *data; size_t i, count; void *pool; @@ -720,11 +720,11 @@ for (id object in self) [object performSelector: selector withObject: object]; } -- (OFArray*)sortedArray +- (OFArray *)sortedArray { OFMutableArray *new = [[self mutableCopy] autorelease]; [new sort]; @@ -731,11 +731,11 @@ [new makeImmutable]; return new; } -- (OFArray*)sortedArrayWithOptions: (int)options +- (OFArray *)sortedArrayWithOptions: (int)options { OFMutableArray *new = [[self mutableCopy] autorelease]; [new sortWithOptions: options]; @@ -742,11 +742,11 @@ [new makeImmutable]; return new; } -- (OFArray*)reversedArray +- (OFArray *)reversedArray { OFMutableArray *new = [[self mutableCopy] autorelease]; [new reverse]; @@ -753,12 +753,12 @@ [new makeImmutable]; return new; } -- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state - objects: (id*)objects +- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state + objects: (id *)objects count: (int)count { of_range_t range = of_range(state->state, count); if (range.length > SIZE_MAX - range.location) @@ -773,16 +773,16 @@ if (range.location + range.length > ULONG_MAX) @throw [OFOutOfRangeException exception]; state->state = (unsigned long)(range.location + range.length); state->itemsPtr = objects; - state->mutationsPtr = (unsigned long*)self; + state->mutationsPtr = (unsigned long *)self; return (int)range.length; } -- (OFEnumerator*)objectEnumerator +- (OFEnumerator *)objectEnumerator { return [[[OFArrayEnumerator alloc] initWithArray: self mutationsPtr: NULL] autorelease]; } @@ -799,11 +799,11 @@ break; } } #endif -- (OFArray*)arrayByAddingObject: (id)object +- (OFArray *)arrayByAddingObject: (id)object { OFMutableArray *ret; if (object == nil) @throw [OFInvalidArgumentException exception]; @@ -814,21 +814,21 @@ [ret makeImmutable]; return ret; } -- (OFArray*)arrayByAddingObjectsFromArray: (OFArray*)array +- (OFArray *)arrayByAddingObjectsFromArray: (OFArray *)array { OFMutableArray *ret = [[self mutableCopy] autorelease]; [ret addObjectsFromArray: array]; [ret makeImmutable]; return ret; } -- (OFArray*)arrayByRemovingObject: (id)object +- (OFArray *)arrayByRemovingObject: (id)object { OFMutableArray *ret = [[self mutableCopy] autorelease]; [ret removeObject: object]; [ret makeImmutable]; @@ -835,11 +835,11 @@ return ret; } #ifdef OF_HAVE_BLOCKS -- (OFArray*)mappedArrayUsingBlock: (of_array_map_block_t)block +- (OFArray *)mappedArrayUsingBlock: (of_array_map_block_t)block { OFArray *ret; size_t count = [self count]; id *tmp = [self allocMemoryWithSize: sizeof(id) count: count]; @@ -857,11 +857,11 @@ } return ret; } -- (OFArray*)filteredArrayUsingBlock: (of_array_filter_block_t)block +- (OFArray *)filteredArrayUsingBlock: (of_array_filter_block_t)block { OFArray *ret; size_t count = [self count]; id *tmp = [self allocMemoryWithSize: sizeof(id) count: count]; @@ -915,12 +915,12 @@ } #endif @end @implementation OFArrayEnumerator -- initWithArray: (OFArray*)array - mutationsPtr: (unsigned long*)mutationsPtr +- initWithArray: (OFArray *)array + mutationsPtr: (unsigned long *)mutationsPtr { self = [super init]; _array = [array retain]; _count = [array count]; Index: src/OFArray_adjacent.m ================================================================== --- src/OFArray_adjacent.m +++ src/OFArray_adjacent.m @@ -83,11 +83,11 @@ } return self; } -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array { id const *objects; size_t count; self = [super init]; @@ -125,11 +125,11 @@ } return self; } -- initWithObjects: (id const*)objects +- initWithObjects: (id const *)objects count: (size_t)count { self = [self init]; @try { @@ -156,11 +156,11 @@ } return self; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { self = [self init]; @try { void *pool = objc_autoreleasePoolPush(); @@ -194,26 +194,26 @@ - (size_t)count { return [_array count]; } -- (id const*)objects +- (id const *)objects { return [_array items]; } - (id)objectAtIndex: (size_t)index { - return *((id*)[_array itemAtIndex: index]); + return *((id *)[_array itemAtIndex: index]); } - (id)objectAtIndexedSubscript: (size_t)index { - return *((id*)[_array itemAtIndex: index]); + return *((id *)[_array itemAtIndex: index]); } -- (void)getObjects: (id*)buffer +- (void)getObjects: (id *)buffer inRange: (of_range_t)range { id *objects = [_array items]; size_t count = [_array count]; @@ -260,19 +260,19 @@ return OF_NOT_FOUND; } -- (OFArray*)objectsInRange: (of_range_t)range +- (OFArray *)objectsInRange: (of_range_t)range { if (range.length > SIZE_MAX - range.location || range.location + range.length > [_array count]) @throw [OFOutOfRangeException exception]; if ([self isKindOfClass: [OFMutableArray class]]) return [OFArray - arrayWithObjects: (id*)[_array items] + range.location + arrayWithObjects: (id *)[_array items] + range.location count: range.length]; return [OFArray_adjacentSubarray arrayWithArray: self range: range]; } @@ -318,12 +318,12 @@ OF_HASH_FINALIZE(hash); return hash; } -- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state - objects: (id*)objects +- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state + objects: (id *)objects count: (int)count_ { size_t count = [_array count]; if (count > INT_MAX) @@ -338,11 +338,11 @@ if (state->state >= count) return 0; state->state = (unsigned long)count; state->itemsPtr = [_array items]; - state->mutationsPtr = (unsigned long*)self; + state->mutationsPtr = (unsigned long *)self; return (int)count; } #ifdef OF_HAVE_BLOCKS Index: src/OFArray_adjacentSubarray.m ================================================================== --- src/OFArray_adjacentSubarray.m +++ src/OFArray_adjacentSubarray.m @@ -19,11 +19,11 @@ #import "OFArray_adjacentSubarray.h" #import "OFArray_adjacent.h" #import "OFMutableArray_adjacent.h" @implementation OFArray_adjacentSubarray -- (const id*)objects +- (const id *)objects { return [_array objects] + _range.location; } - (bool)isEqual: (id)object Index: src/OFArray_subarray.h ================================================================== --- src/OFArray_subarray.h +++ src/OFArray_subarray.h @@ -22,12 +22,12 @@ { OFArray *_array; of_range_t _range; } -+ (instancetype)arrayWithArray: (OFArray*)array ++ (instancetype)arrayWithArray: (OFArray *)array range: (of_range_t)range; -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array range: (of_range_t)range; @end OF_ASSUME_NONNULL_END Index: src/OFArray_subarray.m ================================================================== --- src/OFArray_subarray.m +++ src/OFArray_subarray.m @@ -19,18 +19,18 @@ #import "OFArray_subarray.h" #import "OFOutOfRangeException.h" @implementation OFArray_subarray -+ (instancetype)arrayWithArray: (OFArray*)array ++ (instancetype)arrayWithArray: (OFArray *)array range: (of_range_t)range { return [[[self alloc] initWithArray: array range: range] autorelease]; } -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array range: (of_range_t)range { self = [super init]; @try { @@ -63,11 +63,11 @@ @throw [OFOutOfRangeException exception]; return [_array objectAtIndex: index + _range.location]; } -- (void)getObjects: (id*)buffer +- (void)getObjects: (id *)buffer inRange: (of_range_t)range { if (range.length > SIZE_MAX - range.location || range.location + range.length > _range.length) @throw [OFOutOfRangeException exception]; @@ -106,11 +106,11 @@ return OF_NOT_FOUND; return index; } -- (OFArray*)objectsInRange: (of_range_t)range +- (OFArray *)objectsInRange: (of_range_t)range { if (range.length > SIZE_MAX - range.location || range.location + range.length > _range.length) @throw [OFOutOfRangeException exception]; Index: src/OFAutoreleasePool.m ================================================================== --- src/OFAutoreleasePool.m +++ src/OFAutoreleasePool.m @@ -142,11 +142,11 @@ _ignoreRelease = true; objc_autoreleasePoolPop(_pool); if (cache == NULL) { - cache = calloc(sizeof(OFAutoreleasePool*), MAX_CACHE_SIZE); + cache = calloc(sizeof(OFAutoreleasePool *), MAX_CACHE_SIZE); #if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) if (!of_tlskey_set(cacheKey, cache)) { free(cache); cache = NULL; Index: src/OFBigDataArray.m ================================================================== --- src/OFBigDataArray.m +++ src/OFBigDataArray.m @@ -69,11 +69,11 @@ } return self; } -- (void)addItem: (const void*)item +- (void)addItem: (const void *)item { if (SIZE_MAX - _count < 1 || _count + 1 > SIZE_MAX / _itemSize) @throw [OFOutOfRangeException exception]; if (_count + 1 > _capacity) { @@ -92,11 +92,11 @@ memcpy(_items + _count * _itemSize, item, _itemSize); _count++; } -- (void)addItems: (const void*)items +- (void)addItems: (const void *)items count: (size_t)count { if (count > SIZE_MAX - _count || _count + count > SIZE_MAX / _itemSize) @throw [OFOutOfRangeException exception]; @@ -116,11 +116,11 @@ memcpy(_items + _count * _itemSize, items, count * _itemSize); _count += count; } -- (void)insertItems: (const void*)items +- (void)insertItems: (const void *)items atIndex: (size_t)index count: (size_t)count { if (count > SIZE_MAX - _count || index > _count || _count + count > SIZE_MAX / _itemSize) Index: src/OFBlock.m ================================================================== --- src/OFBlock.m +++ src/OFBlock.m @@ -41,11 +41,11 @@ Class isa; of_block_byref_t *forwarding; int flags; int size; void (*byref_keep)(void *dest, void *src); - void (*byref_dispose)(void*); + void (*byref_dispose)(void *); }; enum { OF_BLOCK_HAS_COPY_DISPOSE = (1 << 25), OF_BLOCK_HAS_CTOR = (1 << 26), @@ -69,32 +69,32 @@ @end #ifdef OF_OBJFW_RUNTIME /* Begin of ObjC module */ static struct objc_abi_class _NSConcreteStackBlock_metaclass = { - (struct objc_abi_class*)(void*)"OFBlock", "OFBlock", "OFStackBlock", 8, - OBJC_CLASS_INFO_METACLASS, sizeof(struct objc_abi_class), NULL, NULL + (struct objc_abi_class *)(void *)"OFBlock", "OFBlock", "OFStackBlock", + 8, OBJC_CLASS_INFO_METACLASS, sizeof(struct objc_abi_class), NULL, NULL }; struct objc_abi_class _NSConcreteStackBlock = { - &_NSConcreteStackBlock_metaclass, "OFBlock", "OFStackBlock", 8, - OBJC_CLASS_INFO_CLASS, sizeof(of_block_literal_t), NULL, NULL + &_NSConcreteStackBlock_metaclass, "OFBlock", "OFStackBlock", + 8, OBJC_CLASS_INFO_CLASS, sizeof(of_block_literal_t), NULL, NULL }; static struct objc_abi_class _NSConcreteGlobalBlock_metaclass = { - (struct objc_abi_class*)(void*)"OFBlock", "OFBlock", "OFGlobalBlock", 8, - OBJC_CLASS_INFO_METACLASS, sizeof(struct objc_abi_class), NULL, NULL + (struct objc_abi_class *)(void *)"OFBlock", "OFBlock", "OFGlobalBlock", + 8, OBJC_CLASS_INFO_METACLASS, sizeof(struct objc_abi_class), NULL, NULL }; struct objc_abi_class _NSConcreteGlobalBlock = { &_NSConcreteGlobalBlock_metaclass, "OFBlock", "OFGlobalBlock", 8, OBJC_CLASS_INFO_CLASS, sizeof(of_block_literal_t), NULL, NULL }; static struct objc_abi_class _NSConcreteMallocBlock_metaclass = { - (struct objc_abi_class*)(void*)"OFBlock", "OFBlock", "OFMallocBlock", 8, - OBJC_CLASS_INFO_METACLASS, sizeof(struct objc_abi_class), NULL, NULL + (struct objc_abi_class *)(void *)"OFBlock", "OFBlock", "OFMallocBlock", + 8, OBJC_CLASS_INFO_METACLASS, sizeof(struct objc_abi_class), NULL, NULL }; struct objc_abi_class _NSConcreteMallocBlock = { &_NSConcreteMallocBlock_metaclass, "OFBlock", "OFMallocBlock", 8, OBJC_CLASS_INFO_CLASS, sizeof(of_block_literal_t), NULL, NULL @@ -112,20 +112,20 @@ &_NSConcreteMallocBlock, NULL } }; static struct objc_abi_module module = { - 8, sizeof(module), NULL, (struct objc_abi_symtab*)&symtab + 8, sizeof(module), NULL, (struct objc_abi_symtab *)&symtab }; OF_CONSTRUCTOR() { __objc_exec_class(&module); } /* End of ObjC module */ #elif defined(OF_APPLE_RUNTIME) -extern Class objc_initializeClassPair(Class, const char*, Class, Class); +extern Class objc_initializeClassPair(Class, const char *, Class, Class); struct class { struct class *isa, *super_class; const char *name; long version, info, instance_size; @@ -156,22 +156,23 @@ # define SPINLOCK_HASH(p) ((uintptr_t)p >> 4) & (NUM_SPINLOCKS - 1) static of_spinlock_t blockSpinlocks[NUM_SPINLOCKS]; static of_spinlock_t byrefSpinlocks[NUM_SPINLOCKS]; #endif -void* +void * _Block_copy(const void *block_) { - of_block_literal_t *block = (of_block_literal_t*)block_; + of_block_literal_t *block = (of_block_literal_t *)block_; if (object_getClass((id)block) == (Class)&_NSConcreteStackBlock) { of_block_literal_t *copy; if ((copy = malloc(block->descriptor->size)) == NULL) { alloc_failed_exception.isa = [OFAllocFailedException class]; - @throw (OFAllocFailedException*)&alloc_failed_exception; + @throw (OFAllocFailedException *) + &alloc_failed_exception; } memcpy(copy, block, block->descriptor->size); object_setClass((id)copy, (Class)&_NSConcreteMallocBlock); copy->flags++; @@ -198,11 +199,11 @@ } void _Block_release(const void *block_) { - of_block_literal_t *block = (of_block_literal_t*)block_; + of_block_literal_t *block = (of_block_literal_t *)block_; if (object_getClass((id)block) != (Class)&_NSConcreteMallocBlock) return; #ifdef OF_HAVE_ATOMIC_OPS @@ -239,27 +240,27 @@ if (src_ == NULL) return; switch (flags) { case OF_BLOCK_FIELD_IS_BLOCK: - *(of_block_literal_t**)dst_ = _Block_copy(src_); + *(of_block_literal_t **)dst_ = _Block_copy(src_); break; case OF_BLOCK_FIELD_IS_OBJECT: if (!(flags_ & OF_BLOCK_BYREF_CALLER)) - *(id*)dst_ = [(id)src_ retain]; + *(id *)dst_ = [(id)src_ retain]; break; case OF_BLOCK_FIELD_IS_BYREF:; - of_block_byref_t *src = (of_block_byref_t*)src_; - of_block_byref_t **dst = (of_block_byref_t**)dst_; + of_block_byref_t *src = (of_block_byref_t *)src_; + of_block_byref_t **dst = (of_block_byref_t **)dst_; src = src->forwarding; if ((src->flags & OF_BLOCK_REFCOUNT_MASK) == 0) { if ((*dst = malloc(src->size)) == NULL) { alloc_failed_exception.isa = [OFAllocFailedException class]; - @throw (OFAllocFailedException*) + @throw (OFAllocFailedException *) &alloc_failed_exception; } memcpy(*dst, src, src->size); (*dst)->flags = @@ -268,11 +269,11 @@ if (src->flags & OF_BLOCK_HAS_COPY_DISPOSE) src->byref_keep(*dst, src); #ifdef OF_HAVE_ATOMIC_OPS - if (!of_atomic_ptr_cmpswap((void**)&src->forwarding, + if (!of_atomic_ptr_cmpswap((void **)&src->forwarding, src, *dst)) { src->byref_dispose(*dst); free(*dst); *dst = src->forwarding; @@ -323,11 +324,11 @@ case OF_BLOCK_FIELD_IS_OBJECT: if (!(flags_ & OF_BLOCK_BYREF_CALLER)) [(id)obj_ release]; break; case OF_BLOCK_FIELD_IS_BYREF:; - of_block_byref_t *obj = (of_block_byref_t*)obj_; + of_block_byref_t *obj = (of_block_byref_t *)obj_; obj = obj->forwarding; #ifdef OF_HAVE_ATOMIC_OPS if ((of_atomic_int_dec(&obj->flags) & @@ -432,35 +433,35 @@ - init { OF_INVALID_INIT_METHOD } -- (void*)allocMemoryWithSize: (size_t)size +- (void *)allocMemoryWithSize: (size_t)size +{ + OF_UNRECOGNIZED_SELECTOR +} + +- (void *)allocMemoryWithSize: (size_t)size + count: (size_t)count { OF_UNRECOGNIZED_SELECTOR } -- (void*)allocMemoryWithSize: (size_t)size - count: (size_t)count +- (void *)resizeMemory: (void *)ptr + size: (size_t)size { OF_UNRECOGNIZED_SELECTOR } -- (void*)resizeMemory: (void*)ptr - size: (size_t)size +- (void *)resizeMemory: (void *)ptr + size: (size_t)size + count: (size_t)count { OF_UNRECOGNIZED_SELECTOR } -- (void*)resizeMemory: (void*)ptr - size: (size_t)size - count: (size_t)count -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (void)freeMemory: (void*)ptr +- (void)freeMemory: (void *)ptr { OF_UNRECOGNIZED_SELECTOR } - retain @@ -485,11 +486,11 @@ } - (unsigned int)retainCount { if (object_getClass(self) == (Class)&_NSConcreteMallocBlock) - return ((of_block_literal_t*)self)->flags & + return ((of_block_literal_t *)self)->flags & OF_BLOCK_REFCOUNT_MASK; return OF_RETAIN_COUNT_MAX; } Index: src/OFCondition.h ================================================================== --- src/OFCondition.h +++ src/OFCondition.h @@ -67,11 +67,11 @@ * to check the condition again after @ref waitUntilDate: returned! * * @param date The date at which the timeout is reached * @return Whether the condition has been signaled */ -- (bool)waitUntilDate: (OFDate*)date; +- (bool)waitUntilDate: (OFDate *)date; /*! * @brief Signals the next waiting thread to continue. */ - (void)signal; Index: src/OFCondition.m ================================================================== --- src/OFCondition.m +++ src/OFCondition.m @@ -66,11 +66,11 @@ - (bool)waitForTimeInterval: (of_time_interval_t)timeInterval { return of_condition_timed_wait(&_condition, &_mutex, timeInterval); } -- (bool)waitUntilDate: (OFDate*)date +- (bool)waitUntilDate: (OFDate *)date { return of_condition_timed_wait(&_condition, &_mutex, [date timeIntervalSinceNow]); } Index: src/OFConstantString.m ================================================================== --- src/OFConstantString.m +++ src/OFConstantString.m @@ -52,35 +52,35 @@ { OF_UNRECOGNIZED_SELECTOR } -- (void*)allocMemoryWithSize: (size_t)size +- (void *)allocMemoryWithSize: (size_t)size +{ + OF_UNRECOGNIZED_SELECTOR +} + +- (void *)allocMemoryWithSize: (size_t)size + count: (size_t)count { OF_UNRECOGNIZED_SELECTOR } -- (void*)allocMemoryWithSize: (size_t)size - count: (size_t)count +- (void *)resizeMemory: (void *)pointer + size: (size_t)size { OF_UNRECOGNIZED_SELECTOR } -- (void*)resizeMemory: (void*)pointer - size: (size_t)size +- (void *)resizeMemory: (void *)pointer + size: (size_t)size + count: (size_t)count { OF_UNRECOGNIZED_SELECTOR } -- (void*)resizeMemory: (void*)pointer - size: (size_t)size - count: (size_t)count -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (void)freeMemory: (void*)pointer +- (void)freeMemory: (void *)pointer { OF_UNRECOGNIZED_SELECTOR } - retain @@ -158,45 +158,45 @@ case -1: free(ivars); @throw [OFInvalidEncodingException exception]; } - _cString = (char*)ivars; + _cString = (char *)ivars; object_setClass(self, [OFString_const class]); } } + alloc { OF_UNRECOGNIZED_SELECTOR } -- (void*)allocMemoryWithSize: (size_t)size +- (void *)allocMemoryWithSize: (size_t)size +{ + OF_UNRECOGNIZED_SELECTOR +} + +- (void *)allocMemoryWithSize: (size_t)size + count: (size_t)count { OF_UNRECOGNIZED_SELECTOR } -- (void*)allocMemoryWithSize: (size_t)size - count: (size_t)count +- (void *)resizeMemory: (void *)pointer + size: (size_t)size { OF_UNRECOGNIZED_SELECTOR } -- (void*)resizeMemory: (void*)pointer - size: (size_t)size +- (void *)resizeMemory: (void *)pointer + size: (size_t)size + count: (size_t)count { OF_UNRECOGNIZED_SELECTOR } -- (void*)resizeMemory: (void*)pointer - size: (size_t)size - count: (size_t)count -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (void)freeMemory: (void*)pointer +- (void)freeMemory: (void *)pointer { OF_UNRECOGNIZED_SELECTOR } - retain @@ -265,26 +265,26 @@ [self finishInitialization]; return [self hash]; } -- (OFString*)description +- (OFString *)description { [self finishInitialization]; return [self description]; } /* From OFString */ -- (const char*)UTF8String +- (const char *)UTF8String { [self finishInitialization]; return [self UTF8String]; } -- (size_t)getCString: (char*)cString_ +- (size_t)getCString: (char *)cString_ maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding { [self finishInitialization]; @@ -291,11 +291,11 @@ return [self getCString: cString_ maxLength: maxLength encoding: encoding]; } -- (const char*)cStringWithEncoding: (of_string_encoding_t)encoding +- (const char *)cStringWithEncoding: (of_string_encoding_t)encoding { [self finishInitialization]; return [self cStringWithEncoding: encoding]; } @@ -319,11 +319,11 @@ [self finishInitialization]; return [self cStringLengthWithEncoding: encoding]; } -- (of_comparison_result_t)caseInsensitiveCompare: (OFString*)otherString +- (of_comparison_result_t)caseInsensitiveCompare: (OFString *)otherString { [self finishInitialization]; return [self caseInsensitiveCompare: otherString]; } @@ -333,36 +333,36 @@ [self finishInitialization]; return [self characterAtIndex: index]; } -- (void)getCharacters: (of_unichar_t*)buffer +- (void)getCharacters: (of_unichar_t *)buffer inRange: (of_range_t)range { [self finishInitialization]; [self getCharacters: buffer inRange: range]; } -- (of_range_t)rangeOfString: (OFString*)string +- (of_range_t)rangeOfString: (OFString *)string { [self finishInitialization]; return [self rangeOfString: string]; } -- (of_range_t)rangeOfString: (OFString*)string +- (of_range_t)rangeOfString: (OFString *)string options: (int)options { [self finishInitialization]; return [self rangeOfString: string options: options]; } -- (of_range_t)rangeOfString: (OFString*)string +- (of_range_t)rangeOfString: (OFString *)string options: (int)options range: (of_range_t)range { [self finishInitialization]; @@ -369,163 +369,163 @@ return [self rangeOfString: string options: options range: range]; } -- (bool)containsString: (OFString*)string +- (bool)containsString: (OFString *)string { [self finishInitialization]; return [self containsString: string]; } -- (OFString*)substringWithRange: (of_range_t)range +- (OFString *)substringWithRange: (of_range_t)range { [self finishInitialization]; return [self substringWithRange: range]; } -- (OFString*)stringByAppendingString: (OFString*)string +- (OFString *)stringByAppendingString: (OFString *)string { [self finishInitialization]; return [self stringByAppendingString: string]; } -- (OFString*)stringByAppendingFormat: (OFConstantString*)format - arguments: (va_list)arguments +- (OFString *)stringByAppendingFormat: (OFConstantString *)format + arguments: (va_list)arguments { [self finishInitialization]; return [self stringByAppendingFormat: format arguments: arguments]; } -- (OFString*)stringByAppendingPathComponent: (OFString*)component +- (OFString *)stringByAppendingPathComponent: (OFString *)component { [self finishInitialization]; return [self stringByAppendingPathComponent: component]; } -- (OFString*)stringByPrependingString: (OFString*)string +- (OFString *)stringByPrependingString: (OFString *)string { [self finishInitialization]; return [self stringByPrependingString: string]; } -- (OFString*)stringByReplacingOccurrencesOfString: (OFString*)string - withString: (OFString*)replacement +- (OFString *)stringByReplacingOccurrencesOfString: (OFString *)string + withString: (OFString *)replacement { [self finishInitialization]; return [self stringByReplacingOccurrencesOfString: string withString: replacement]; } -- (OFString*)stringByReplacingOccurrencesOfString: (OFString*)string - withString: (OFString*)replacement - options: (int)options - range: (of_range_t)range +- (OFString *)stringByReplacingOccurrencesOfString: (OFString *)string + withString: (OFString *)replacement + options: (int)options + range: (of_range_t)range { [self finishInitialization]; return [self stringByReplacingOccurrencesOfString: string withString: replacement options: options range: range]; } -- (OFString*)uppercaseString +- (OFString *)uppercaseString { [self finishInitialization]; return [self uppercaseString]; } -- (OFString*)lowercaseString +- (OFString *)lowercaseString { [self finishInitialization]; return [self lowercaseString]; } -- (OFString*)capitalizedString +- (OFString *)capitalizedString { [self finishInitialization]; return [self capitalizedString]; } -- (OFString*)stringByDeletingLeadingWhitespaces +- (OFString *)stringByDeletingLeadingWhitespaces { [self finishInitialization]; return [self stringByDeletingLeadingWhitespaces]; } -- (OFString*)stringByDeletingTrailingWhitespaces +- (OFString *)stringByDeletingTrailingWhitespaces { [self finishInitialization]; return [self stringByDeletingTrailingWhitespaces]; } -- (OFString*)stringByDeletingEnclosingWhitespaces +- (OFString *)stringByDeletingEnclosingWhitespaces { [self finishInitialization]; return [self stringByDeletingEnclosingWhitespaces]; } -- (bool)hasPrefix: (OFString*)prefix +- (bool)hasPrefix: (OFString *)prefix { [self finishInitialization]; return [self hasPrefix: prefix]; } -- (bool)hasSuffix: (OFString*)suffix +- (bool)hasSuffix: (OFString *)suffix { [self finishInitialization]; return [self hasSuffix: suffix]; } -- (OFArray*)componentsSeparatedByString: (OFString*)delimiter +- (OFArray *)componentsSeparatedByString: (OFString *)delimiter { [self finishInitialization]; return [self componentsSeparatedByString: delimiter]; } -- (OFArray*)componentsSeparatedByString: (OFString*)delimiter - options: (int)options +- (OFArray *)componentsSeparatedByString: (OFString *)delimiter + options: (int)options { [self finishInitialization]; return [self componentsSeparatedByString: delimiter options: options]; } -- (OFArray*)pathComponents +- (OFArray *)pathComponents { [self finishInitialization]; return [self pathComponents]; } -- (OFString*)lastPathComponent +- (OFString *)lastPathComponent { [self finishInitialization]; return [self lastPathComponent]; } -- (OFString*)stringByDeletingLastPathComponent +- (OFString *)stringByDeletingLastPathComponent { [self finishInitialization]; return [self stringByDeletingLastPathComponent]; } @@ -563,25 +563,25 @@ [self finishInitialization]; return [self doubleValue]; } -- (const of_unichar_t*)characters +- (const of_unichar_t *)characters { [self finishInitialization]; return [self characters]; } -- (const of_char16_t*)UTF16String +- (const of_char16_t *)UTF16String { [self finishInitialization]; return [self UTF16String]; } -- (const of_char16_t*)UTF16StringWithByteOrder: (of_byte_order_t)byteOrder +- (const of_char16_t *)UTF16StringWithByteOrder: (of_byte_order_t)byteOrder { [self finishInitialization]; return [self UTF16StringWithByteOrder: byteOrder]; } @@ -591,32 +591,32 @@ [self finishInitialization]; return [self UTF16StringLength]; } -- (const of_char32_t*)UTF32String +- (const of_char32_t *)UTF32String { [self finishInitialization]; return [self UTF32String]; } -- (const of_char32_t*)UTF32StringWithByteOrder: (of_byte_order_t)byteOrder +- (const of_char32_t *)UTF32StringWithByteOrder: (of_byte_order_t)byteOrder { [self finishInitialization]; return [self UTF32StringWithByteOrder: byteOrder]; } -- (void)writeToFile: (OFString*)path +- (void)writeToFile: (OFString *)path { [self finishInitialization]; [self writeToFile: path]; } -- (void)writeToFile: (OFString*)path +- (void)writeToFile: (OFString *)path encoding: (of_string_encoding_t)encoding { [self finishInitialization]; [self writeToFile: path Index: src/OFCountedSet.h ================================================================== --- src/OFCountedSet.h +++ src/OFCountedSet.h @@ -38,11 +38,11 @@ * * @brief An abstract class for a mutable unordered set of objects, counting how * often it contains an object. */ #ifdef OF_HAVE_GENERICS -@interface OFCountedSet : OFMutableSet +@interface OFCountedSet: OFMutableSet #else # ifndef DOXYGEN # define ObjectType id # endif @interface OFCountedSet: OFMutableSet Index: src/OFCountedSet.m ================================================================== --- src/OFCountedSet.m +++ src/OFCountedSet.m @@ -35,16 +35,16 @@ - init { return (id)[[OFCountedSet_hashtable alloc] init]; } -- initWithSet: (OFSet*)set +- initWithSet: (OFSet *)set { return (id)[[OFCountedSet_hashtable alloc] initWithSet: set]; } -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array { return (id)[[OFCountedSet_hashtable alloc] initWithArray: array]; } - initWithObjects: (id)firstObject, ... @@ -58,11 +58,11 @@ va_end(arguments); return ret; } -- initWithObjects: (id const*)objects +- initWithObjects: (id const *)objects count: (size_t)count { return (id)[[OFCountedSet_hashtable alloc] initWithObjects: objects count: count]; } @@ -72,11 +72,11 @@ { return (id)[[OFCountedSet_hashtable alloc] initWithObject: firstObject arguments: arguments]; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { return (id)[[OFCountedSet_hashtable alloc] initWithSerialization: element]; } @@ -134,11 +134,11 @@ - (size_t)countForObject: (id)object { OF_UNRECOGNIZED_SELECTOR } -- (OFString*)description +- (OFString *)description { OFMutableString *ret; void *pool; size_t i, count = [self count]; @@ -180,11 +180,11 @@ - mutableCopy { return [[OFCountedSet alloc] initWithSet: self]; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; element = [OFXMLElement elementWithName: @"OFCountedSet" @@ -226,16 +226,16 @@ block(object, [self countForObject: object], stop); }]; } #endif -- (void)minusSet: (OFSet*)set +- (void)minusSet: (OFSet *)set { void *pool = objc_autoreleasePoolPush(); if ([set isKindOfClass: [OFCountedSet class]]) { - OFCountedSet *countedSet = (OFCountedSet*)set; + OFCountedSet *countedSet = (OFCountedSet *)set; for (id object in countedSet) { size_t count = [countedSet countForObject: object]; for (size_t i = 0; i < count; i++) @@ -246,16 +246,16 @@ [self removeObject: object]; objc_autoreleasePoolPop(pool); } -- (void)unionSet: (OFSet*)set +- (void)unionSet: (OFSet *)set { void *pool = objc_autoreleasePoolPush(); if ([set isKindOfClass: [OFCountedSet class]]) { - OFCountedSet *countedSet = (OFCountedSet*)set; + OFCountedSet *countedSet = (OFCountedSet *)set; for (id object in countedSet) { size_t count = [countedSet countForObject: object]; for (size_t i = 0; i < count; i++) Index: src/OFCountedSet_hashtable.m ================================================================== --- src/OFCountedSet_hashtable.m +++ src/OFCountedSet_hashtable.m @@ -34,19 +34,19 @@ { if (self == [OFCountedSet_hashtable class]) [self inheritMethodsFromClass: [OFMutableSet_hashtable class]]; } -- initWithSet: (OFSet*)set +- initWithSet: (OFSet *)set { self = [self init]; @try { void *pool = objc_autoreleasePoolPush(); if ([set isKindOfClass: [OFCountedSet class]]) { - OFCountedSet *countedSet = (OFCountedSet*)countedSet; + OFCountedSet *countedSet = (OFCountedSet *)countedSet; for (id object in countedSet) { size_t count = [countedSet countForObject: object]; @@ -64,11 +64,11 @@ } return self; } -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array { self = [self init]; @try { id const *objects = [array objects]; @@ -82,11 +82,11 @@ } return self; } -- initWithObjects: (id const*)objects +- initWithObjects: (id const *)objects count: (size_t)count { self = [self init]; @try { @@ -118,11 +118,11 @@ } return self; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { self = [self init]; @try { void *pool = objc_autoreleasePoolPush(); @@ -146,11 +146,11 @@ if (object == nil || count_ == nil) @throw [OFInvalidFormatException exception]; count = (size_t)[[count_ stringValue] decimalValue]; - [_mapTable setObject: (void*)(uintptr_t)count + [_mapTable setObject: (void *)(uintptr_t)count forKey: [object objectByDeserializing]]; objc_autoreleasePoolPop(pool2); } @@ -189,11 +189,11 @@ size_t count = (size_t)(uintptr_t)[_mapTable objectForKey: object]; if (SIZE_MAX - count < 1 || UINTPTR_MAX - count < 1) @throw [OFOutOfRangeException exception]; - [_mapTable setObject: (void*)(uintptr_t)(count + 1) + [_mapTable setObject: (void *)(uintptr_t)(count + 1) forKey: object]; } - (void)removeObject: (id)object { @@ -203,15 +203,15 @@ return; count--; if (count > 0) - [_mapTable setObject: (void*)(uintptr_t)count + [_mapTable setObject: (void *)(uintptr_t)count forKey: object]; else [_mapTable removeObjectForKey: object]; } - (void)makeImmutable { } @end Index: src/OFCryptoHash.h ================================================================== --- src/OFCryptoHash.h +++ src/OFCryptoHash.h @@ -58,11 +58,11 @@ * @brief Adds a buffer to the cryptographic hash to be calculated. * * @param buffer The buffer which should be included into the calculation * @param length The length of the buffer */ -- (void)updateWithBuffer: (const void*)buffer +- (void)updateWithBuffer: (const void *)buffer length: (size_t)length; /*! * @brief Returns a buffer containing the cryptographic hash. * @@ -69,11 +69,11 @@ * The size of the buffer depends on the hash used. The buffer is part of the * receiver's memory pool. * * @return A buffer containing the hash */ -- (const unsigned char*)digest OF_RETURNS_INNER_POINTER; +- (const unsigned char *)digest OF_RETURNS_INNER_POINTER; /*! * @brief Resets all state so that a new hash can be calculated. * * @warning This invalidates any pointer previously returned by @ref digest. If Index: src/OFDataArray+CryptoHashing.h ================================================================== --- src/OFDataArray+CryptoHashing.h +++ src/OFDataArray+CryptoHashing.h @@ -32,56 +32,56 @@ /*! * @brief Returns the MD5 hash of the data array as an autoreleased OFString. * * @return The MD5 hash of the data array as an autoreleased OFString */ -- (OFString*)MD5Hash; +- (OFString *)MD5Hash; /*! * @brief Returns the RIPEMD-160 hash of the data array as an autoreleased * OFString. * * @return The RIPEMD-160 hash of the data array as an autoreleased OFString */ -- (OFString*)RIPEMD160Hash; +- (OFString *)RIPEMD160Hash; /*! * @brief Returns the SHA-1 hash of the data array as an autoreleased OFString. * * @return The SHA-1 hash of the data array as an autoreleased OFString */ -- (OFString*)SHA1Hash; +- (OFString *)SHA1Hash; /*! * @brief Returns the SHA-224 hash of the data array as an autoreleased * OFString. * * @return The SHA-224 hash of the data array as an autoreleased OFString */ -- (OFString*)SHA224Hash; +- (OFString *)SHA224Hash; /*! * @brief Returns the SHA-256 hash of the data array as an autoreleased * OFString. * * @return The SHA-256 hash of the data array as an autoreleased OFString */ -- (OFString*)SHA256Hash; +- (OFString *)SHA256Hash; /*! * @brief Returns the SHA-384 hash of the data array as an autoreleased * OFString. * * @return The SHA-384 hash of the data array as an autoreleased OFString */ -- (OFString*)SHA384Hash; +- (OFString *)SHA384Hash; /*! * @brief Returns the SHA-512 hash of the data array as an autoreleased * OFString. * * @return The SHA-512 hash of the data array as an autoreleased OFString */ -- (OFString*)SHA512Hash; +- (OFString *)SHA512Hash; @end OF_ASSUME_NONNULL_END Index: src/OFDataArray+CryptoHashing.m ================================================================== --- src/OFDataArray+CryptoHashing.m +++ src/OFDataArray+CryptoHashing.m @@ -28,11 +28,11 @@ #import "OFSHA512Hash.h" int _OFDataArray_CryptoHashing_reference; @implementation OFDataArray (Hashing) -- (OFString*)OF_cryptoHashWithClass: (Class )class +- (OFString *)OF_cryptoHashWithClass: (Class )class { void *pool = objc_autoreleasePoolPush(); id hash = [class cryptoHash]; size_t digestSize = [class digestSize]; const unsigned char *digest; @@ -57,40 +57,40 @@ return [OFString stringWithCString: cString encoding: OF_STRING_ENCODING_ASCII length: digestSize * 2]; } -- (OFString*)MD5Hash +- (OFString *)MD5Hash { return [self OF_cryptoHashWithClass: [OFMD5Hash class]]; } -- (OFString*)RIPEMD160Hash +- (OFString *)RIPEMD160Hash { return [self OF_cryptoHashWithClass: [OFRIPEMD160Hash class]]; } -- (OFString*)SHA1Hash +- (OFString *)SHA1Hash { return [self OF_cryptoHashWithClass: [OFSHA1Hash class]]; } -- (OFString*)SHA224Hash +- (OFString *)SHA224Hash { return [self OF_cryptoHashWithClass: [OFSHA224Hash class]]; } -- (OFString*)SHA256Hash +- (OFString *)SHA256Hash { return [self OF_cryptoHashWithClass: [OFSHA256Hash class]]; } -- (OFString*)SHA384Hash +- (OFString *)SHA384Hash { return [self OF_cryptoHashWithClass: [OFSHA384Hash class]]; } -- (OFString*)SHA512Hash +- (OFString *)SHA512Hash { return [self OF_cryptoHashWithClass: [OFSHA512Hash class]]; } @end Index: src/OFDataArray+MessagePackValue.m ================================================================== --- src/OFDataArray+MessagePackValue.m +++ src/OFDataArray+MessagePackValue.m @@ -27,11 +27,11 @@ #import "OFInvalidFormatException.h" int _OFDataArray_MessagePackValue_reference; -static size_t parseObject(const uint8_t*, size_t, id*); +static size_t parseObject(const uint8_t *, size_t, id *); static uint16_t readUInt16(const uint8_t *buffer) { return ((uint16_t)buffer[0] << 8) | buffer[1]; @@ -163,11 +163,11 @@ if (length < count + 1) goto error; *object = [OFString - stringWithUTF8String: (const char*)buffer + 1 + stringWithUTF8String: (const char *)buffer + 1 length: count]; return count + 1; } /* fixarray */ @@ -493,11 +493,11 @@ if (length < count + 2) goto error; *object = [OFString - stringWithUTF8String: (const char*)buffer + 2 + stringWithUTF8String: (const char *)buffer + 2 length: count]; return count + 2; case 0xDA: /* str 16 */ if (length < 3) goto error; @@ -506,11 +506,11 @@ if (length < count + 3) goto error; *object = [OFString - stringWithUTF8String: (const char*)buffer + 3 + stringWithUTF8String: (const char *)buffer + 3 length: count]; return count + 3; case 0xDB: /* str 32 */ if (length < 5) goto error; @@ -519,11 +519,11 @@ if (length < count + 5) goto error; *object = [OFString - stringWithUTF8String: (const char*)buffer + 5 + stringWithUTF8String: (const char *)buffer + 5 length: count]; return count + 5; /* Arrays */ case 0xDC: /* array 16 */ if (length < 3) Index: src/OFDataArray.h ================================================================== --- src/OFDataArray.h +++ src/OFDataArray.h @@ -88,11 +88,11 @@ * of the specified file. * * @param path The path of the file * @return A new autoreleased OFDataArray */ -+ (instancetype)dataArrayWithContentsOfFile: (OFString*)path; ++ (instancetype)dataArrayWithContentsOfFile: (OFString *)path; #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) /*! * @brief Creates a new OFDataArray with an item size of 1, containing the data @@ -99,30 +99,30 @@ * of the specified URL. * * @param URL The URL to the contents for the OFDataArray * @return A new autoreleased OFDataArray */ -+ (instancetype)dataArrayWithContentsOfURL: (OFURL*)URL; ++ (instancetype)dataArrayWithContentsOfURL: (OFURL *)URL; #endif /*! * @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 */ -+ (instancetype)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 */ -+ (instancetype)dataArrayWithBase64EncodedString: (OFString*)string; ++ (instancetype)dataArrayWithBase64EncodedString: (OFString *)string; /*! * @brief Initializes an already allocated OFDataArray whose items all have the * same size. * @@ -158,11 +158,11 @@ * containing the data of the specified file. * * @param path The path of the file * @return An initialized OFDataArray */ -- initWithContentsOfFile: (OFString*)path; +- initWithContentsOfFile: (OFString *)path; #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) /*! * @brief Initializes an already allocated OFDataArray with an item size of 1, @@ -169,30 +169,30 @@ * containing the data of the specified URL. * * @param URL The URL to the contents for the OFDataArray * @return A new autoreleased OFDataArray */ -- initWithContentsOfURL: (OFURL*)URL; +- initWithContentsOfURL: (OFURL *)URL; #endif /*! * @brief Initializes an already allocated 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 */ -- initWithStringRepresentation: (OFString*)string; +- initWithStringRepresentation: (OFString *)string; /*! * @brief Initializes an already allocated 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 An initialized OFDataArray */ -- initWithBase64EncodedString: (OFString*)string; +- initWithBase64EncodedString: (OFString *)string; /*! * @brief Returns the number of items in the OFDataArray. * * @return The number of items in the OFDataArray @@ -207,67 +207,67 @@ * Modifying the returned array directly is allowed and will change the contents * of the data array. * * @return All elements of the OFDataArray as a C array */ -- (void*)items OF_RETURNS_INNER_POINTER; +- (void *)items OF_RETURNS_INNER_POINTER; /*! * @brief Returns a specific item of the OFDataArray. * * @param index The number of the item to return * @return The specified item of the OFDataArray */ -- (void*)itemAtIndex: (size_t)index OF_RETURNS_INNER_POINTER; +- (void *)itemAtIndex: (size_t)index OF_RETURNS_INNER_POINTER; /*! * @brief Returns the first item of the OFDataArray. * * @return The first item of the OFDataArray or NULL */ -- (nullable void*)firstItem OF_RETURNS_INNER_POINTER; +- (nullable void *)firstItem OF_RETURNS_INNER_POINTER; /*! * @brief Returns the last item of the OFDataArray. * * @return The last item of the OFDataArray or NULL */ -- (nullable void*)lastItem OF_RETURNS_INNER_POINTER; +- (nullable void *)lastItem OF_RETURNS_INNER_POINTER; /*! * @brief Adds an item to the OFDataArray. * * @param item A pointer to an arbitrary item */ -- (void)addItem: (const void*)item; +- (void)addItem: (const void *)item; /*! * @brief Adds an item to the OFDataArray at the specified index. * * @param item A pointer to an arbitrary item * @param index The index where the item should be added */ -- (void)insertItem: (const void*)item +- (void)insertItem: (const void *)item atIndex: (size_t)index; /*! * @brief Adds items from a C array to the OFDataArray. * * @param items A C array containing the items to add * @param count The number of items to add */ -- (void)addItems: (const void*)items +- (void)addItems: (const void *)items count: (size_t)count; /*! * @brief Adds items from a C array to the OFDataArray at the specified index. * * @param items A C array containing the items to add * @param index The index where the items should be added * @param count The number of items to add */ -- (void)insertItems: (const void*)items +- (void)insertItems: (const void *)items atIndex: (size_t)index count: (size_t)count; /*! * @brief Removes the item at the specified index. @@ -299,28 +299,28 @@ * The string representation is a hex dump of the data inside the data array, * grouped by itemSize bytes. * * @return The string representation of the data array. */ -- (OFString*)stringRepresentation; +- (OFString *)stringRepresentation; /*! * @brief Returns a string containing the data in Base64 encoding. * * @return A string containing the data in Base64 encoding */ -- (OFString*)stringByBase64Encoding; +- (OFString *)stringByBase64Encoding; #ifdef OF_HAVE_FILES /*! * @brief Writes the OFDataArray into the specified file. * * @param path The path of the file to write to */ -- (void)writeToFile: (OFString*)path; +- (void)writeToFile: (OFString *)path; #endif @end OF_ASSUME_NONNULL_END #import "OFDataArray+CryptoHashing.h" #import "OFDataArray+MessagePackValue.h" Index: src/OFDataArray.m ================================================================== --- src/OFDataArray.m +++ src/OFDataArray.m @@ -81,30 +81,30 @@ return [[[self alloc] initWithItemSize: itemSize capacity: capacity] autorelease]; } #ifdef OF_HAVE_FILES -+ (instancetype)dataArrayWithContentsOfFile: (OFString*)path ++ (instancetype)dataArrayWithContentsOfFile: (OFString *)path { return [[[self alloc] initWithContentsOfFile: path] autorelease]; } #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) -+ (instancetype)dataArrayWithContentsOfURL: (OFURL*)URL ++ (instancetype)dataArrayWithContentsOfURL: (OFURL *)URL { return [[[self alloc] initWithContentsOfURL: URL] autorelease]; } #endif -+ (instancetype)dataArrayWithStringRepresentation: (OFString*)string ++ (instancetype)dataArrayWithStringRepresentation: (OFString *)string { return [[[self alloc] initWithStringRepresentation: string] autorelease]; } -+ (instancetype)dataArrayWithBase64EncodedString: (OFString*)string ++ (instancetype)dataArrayWithBase64EncodedString: (OFString *)string { return [[[self alloc] initWithBase64EncodedString: string] autorelease]; } - init @@ -152,11 +152,11 @@ return self; } #ifdef OF_HAVE_FILES -- initWithContentsOfFile: (OFString*)path +- initWithContentsOfFile: (OFString *)path { @try { OFFile *file = [[OFFile alloc] initWithPath: path mode: @"rb"]; of_offset_t size = [[OFFileManager defaultManager] @@ -194,11 +194,11 @@ return self; } #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) -- initWithContentsOfURL: (OFURL*)URL +- initWithContentsOfURL: (OFURL *)URL { void *pool; OFString *scheme; pool = objc_autoreleasePoolPush(); @@ -274,11 +274,11 @@ return self; } #endif -- initWithStringRepresentation: (OFString*)string +- initWithStringRepresentation: (OFString *)string { @try { const char *cString; size_t count; @@ -326,11 +326,11 @@ } return self; } -- initWithBase64EncodedString: (OFString*)string +- initWithBase64EncodedString: (OFString *)string { self = [self initWithItemSize: 1 capacity: [string length] / 3]; @try { @@ -344,11 +344,11 @@ } return self; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { @try { void *pool = objc_autoreleasePoolPush(); OFString *stringValue; @@ -372,40 +372,40 @@ - (size_t)count { return _count; } -- (void*)items +- (void *)items { return _items; } -- (void*)itemAtIndex: (size_t)index +- (void *)itemAtIndex: (size_t)index { if (index >= _count) @throw [OFOutOfRangeException exception]; return _items + index * _itemSize; } -- (void*)firstItem +- (void *)firstItem { if (_items == NULL || _count == 0) return NULL; return _items; } -- (void*)lastItem +- (void *)lastItem { if (_items == NULL || _count == 0) return NULL; return _items + (_count - 1) * _itemSize; } -- (void)addItem: (const void*)item +- (void)addItem: (const void *)item { if (SIZE_MAX - _count < 1) @throw [OFOutOfRangeException exception]; if (_count + 1 > _capacity) { @@ -418,19 +418,19 @@ memcpy(_items + _count * _itemSize, item, _itemSize); _count++; } -- (void)insertItem: (const void*)item +- (void)insertItem: (const void *)item atIndex: (size_t)index { [self insertItems: item atIndex: index count: 1]; } -- (void)addItems: (const void*)items +- (void)addItems: (const void *)items count: (size_t)count { if (count > SIZE_MAX - _count) @throw [OFOutOfRangeException exception]; @@ -443,11 +443,11 @@ memcpy(_items + _count * _itemSize, items, count * _itemSize); _count += count; } -- (void)insertItems: (const void*)items +- (void)insertItems: (const void *)items atIndex: (size_t)index count: (size_t)count { if (count > SIZE_MAX - _count || index > _count) @throw [OFOutOfRangeException exception]; @@ -553,11 +553,11 @@ size_t count, minCount; if (![object isKindOfClass: [OFDataArray class]]) @throw [OFInvalidArgumentException exception]; - dataArray = (OFDataArray*)object; + dataArray = (OFDataArray *)object; if ([dataArray itemSize] != _itemSize) @throw [OFInvalidArgumentException exception]; count = [dataArray count]; @@ -584,18 +584,18 @@ uint32_t hash; OF_HASH_INIT(hash); for (size_t i = 0; i < _count * _itemSize; i++) - OF_HASH_ADD(hash, ((uint8_t*)_items)[i]); + OF_HASH_ADD(hash, ((uint8_t *)_items)[i]); OF_HASH_FINALIZE(hash); return hash; } -- (OFString*)description +- (OFString *)description { OFMutableString *ret = [OFMutableString stringWithString: @"<"]; for (size_t i = 0; i < _count; i++) { if (i > 0) @@ -609,11 +609,11 @@ [ret makeImmutable]; return ret; } -- (OFString*)stringRepresentation +- (OFString *)stringRepresentation { OFMutableString *ret = [OFMutableString string]; for (size_t i = 0; i < _count; i++) for (size_t j = 0; j < _itemSize; j++) @@ -621,17 +621,17 @@ [ret makeImmutable]; return ret; } -- (OFString*)stringByBase64Encoding +- (OFString *)stringByBase64Encoding { return of_base64_encode(_items, _count * _itemSize); } #ifdef OF_HAVE_FILES -- (void)writeToFile: (OFString*)path +- (void)writeToFile: (OFString *)path { OFFile *file = [[OFFile alloc] initWithPath: path mode: @"wb"]; @try { @@ -641,11 +641,11 @@ [file release]; } } #endif -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool; OFXMLElement *element; if (_itemSize != 1) @@ -662,11 +662,11 @@ objc_autoreleasePoolPop(pool); return [element autorelease]; } -- (OFDataArray*)messagePackRepresentation +- (OFDataArray *)messagePackRepresentation { OFDataArray *data; if (_itemSize != 1) @throw [OFInvalidArgumentException exception]; Index: src/OFDate.h ================================================================== --- src/OFDate.h +++ src/OFDate.h @@ -71,12 +71,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 */ -+ (instancetype)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. * @@ -88,12 +88,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 */ -+ (instancetype)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. @@ -144,12 +144,12 @@ * * @param string The string describing the date * @param format The format of the string describing the date * @return An initialized OFDate with the specified date and time */ -- initWithDateString: (OFString*)string - format: (OFString*)format; +- initWithDateString: (OFString *)string + format: (OFString *)format; /*! * @brief Initializes an already allocated OFDate with the specified string in * the specified format. * @@ -162,12 +162,12 @@ * * @param string The string describing the date * @param format The format of the string describing the date * @return An initialized OFDate with the specified date and time */ -- initWithLocalDateString: (OFString*)string - format: (OFString*)format; +- initWithLocalDateString: (OFString *)string + format: (OFString *)format; /*! * @brief Returns the microsecond of the date. * * @return The microsecond of the date @@ -278,41 +278,41 @@ * See the man page for `strftime` for information on the format. * * @param format The format for the date string * @return A new, autoreleased OFString */ -- (OFString*)dateStringWithFormat: (OFConstantString*)format; +- (OFString *)dateStringWithFormat: (OFConstantString *)format; /*! * @brief Creates a string of the local date with the specified format. * * See the man page for `strftime` for information on the format. * * @param format The format for the date string * @return A new, autoreleased OFString */ -- (OFString*)localDateStringWithFormat: (OFConstantString*)format; +- (OFString *)localDateStringWithFormat: (OFConstantString *)format; /*! * @brief Returns the earlier of the two dates. * * If the argument is `nil`, it returns the receiver. * * @param otherDate Another date * @return The earlier date of the two dates */ -- (OFDate*)earlierDate: (OFDate*)otherDate; +- (OFDate *)earlierDate: (OFDate *)otherDate; /*! * @brief Returns the later of the two dates. * * If the argument is `nil`, it returns the receiver. * * @param otherDate Another date * @return The later date of the two dates */ -- (OFDate*)laterDate: (OFDate*)otherDate; +- (OFDate *)laterDate: (OFDate *)otherDate; /*! * @brief Returns the seconds since 1970-01-01T00:00:00Z. * * @return The seconds since 1970-01-01T00:00:00Z @@ -323,11 +323,11 @@ * @brief Returns the seconds the receiver is after the date. * * @param otherDate Date date to generate the difference with receiver * @return The seconds the receiver is after the date. */ -- (of_time_interval_t)timeIntervalSinceDate: (OFDate*)otherDate; +- (of_time_interval_t)timeIntervalSinceDate: (OFDate *)otherDate; /*! * @brief Returns the seconds the receiver is in the future. * * @return The seconds the receiver is in the future @@ -338,9 +338,9 @@ * @brief Creates a new date with the specified time interval added. * * @param seconds The seconds after the date * @return A new, autoreleased OFDate */ -- (OFDate*)dateByAddingTimeInterval: (of_time_interval_t)seconds; +- (OFDate *)dateByAddingTimeInterval: (of_time_interval_t)seconds; @end OF_ASSUME_NONNULL_END Index: src/OFDate.m ================================================================== --- src/OFDate.m +++ src/OFDate.m @@ -203,19 +203,19 @@ { return [[[self alloc] initWithTimeIntervalSinceNow: seconds] autorelease]; } -+ (instancetype)dateWithDateString: (OFString*)string - format: (OFString*)format ++ (instancetype)dateWithDateString: (OFString *)string + format: (OFString *)format { return [[[self alloc] initWithDateString: string format: format] autorelease]; } -+ (instancetype)dateWithLocalDateString: (OFString*)string - format: (OFString*)format ++ (instancetype)dateWithLocalDateString: (OFString *)string + format: (OFString *)format { return [[[self alloc] initWithLocalDateString: string format: format] autorelease]; } @@ -261,12 +261,12 @@ _seconds += seconds; return self; } -- initWithDateString: (OFString*)string - format: (OFString*)format +- initWithDateString: (OFString *)string + format: (OFString *)format { self = [super init]; @try { const char *UTF8String = [string UTF8String]; @@ -286,12 +286,12 @@ } return self; } -- initWithLocalDateString: (OFString*)string - format: (OFString*)format +- initWithLocalDateString: (OFString *)string + format: (OFString *)format { self = [super init]; @try { const char *UTF8String = [string UTF8String]; @@ -325,11 +325,11 @@ } return self; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); @@ -408,29 +408,29 @@ OFDate *otherDate; if (![object isKindOfClass: [OFDate class]]) @throw [OFInvalidArgumentException exception]; - otherDate = (OFDate*)object; + otherDate = (OFDate *)object; if (_seconds < otherDate->_seconds) return OF_ORDERED_ASCENDING; if (_seconds > otherDate->_seconds) return OF_ORDERED_DESCENDING; return OF_ORDERED_SAME; } -- (OFString*)description +- (OFString *)description { if (isinf(_seconds)) return (_seconds > 0 ? @"Distant Future" : @"Distant Past"); else return [self dateStringWithFormat: @"%Y-%m-%dT%H:%M:%SZ"]; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; union { double d; @@ -529,11 +529,11 @@ - (uint16_t)localDayOfYear { LOCALTIME_RET(tm_yday + 1) } -- (OFString*)dateStringWithFormat: (OFConstantString*)format +- (OFString *)dateStringWithFormat: (OFConstantString *)format { OFString *ret; time_t seconds = (time_t)_seconds; struct tm tm; size_t pageSize; @@ -589,11 +589,11 @@ } return ret; } -- (OFString*)localDateStringWithFormat: (OFConstantString*)format +- (OFString *)localDateStringWithFormat: (OFConstantString *)format { OFString *ret; time_t seconds = (time_t)_seconds; struct tm tm; size_t pageSize; @@ -649,11 +649,11 @@ } return ret; } -- (OFDate*)earlierDate: (OFDate*)otherDate +- (OFDate *)earlierDate: (OFDate *)otherDate { if (otherDate == nil) return [[self retain] autorelease]; if ([self compare: otherDate] == OF_ORDERED_DESCENDING) @@ -660,11 +660,11 @@ return [[otherDate retain] autorelease]; return [[self retain] autorelease]; } -- (OFDate*)laterDate: (OFDate*)otherDate +- (OFDate *)laterDate: (OFDate *)otherDate { if (otherDate == nil) return [[self retain] autorelease]; if ([self compare: otherDate] == OF_ORDERED_ASCENDING) @@ -676,11 +676,11 @@ - (of_time_interval_t)timeIntervalSince1970 { return _seconds; } -- (of_time_interval_t)timeIntervalSinceDate: (OFDate*)otherDate +- (of_time_interval_t)timeIntervalSinceDate: (OFDate *)otherDate { return _seconds - otherDate->_seconds; } - (of_time_interval_t)timeIntervalSinceNow @@ -694,10 +694,10 @@ seconds += (of_time_interval_t)t.tv_usec / 1000000; return _seconds - seconds; } -- (OFDate*)dateByAddingTimeInterval: (of_time_interval_t)seconds +- (OFDate *)dateByAddingTimeInterval: (of_time_interval_t)seconds { return [OFDate dateWithTimeIntervalSince1970: _seconds + seconds]; } @end Index: src/OFDeflateStream.h ================================================================== --- src/OFDeflateStream.h +++ src/OFDeflateStream.h @@ -74,19 +74,19 @@ * * @param stream The underlying stream to which compressed data is written or * from which compressed data is read * @return A new, autoreleased OFDeflateStream */ -+ (instancetype)streamWithStream: (OFStream*)stream; ++ (instancetype)streamWithStream: (OFStream *)stream; /*! * @brief Initializes an already allocated OFDeflateStream with the specified * underlying stream. * * @param stream The underlying stream to which compressed data is written or * from which compressed data is read * @return A initialized OFDeflateStream */ -- initWithStream: (OFStream*)stream; +- initWithStream: (OFStream *)stream; @end OF_ASSUME_NONNULL_END Index: src/OFDeflateStream.m ================================================================== --- src/OFDeflateStream.m +++ src/OFDeflateStream.m @@ -152,11 +152,11 @@ *bits = ret; return true; } -static struct huffman_tree* +static struct huffman_tree * newTree(void) { struct huffman_tree *tree; if ((tree = malloc(sizeof(*tree))) == NULL) @@ -186,11 +186,11 @@ } tree->value = value; } -static struct huffman_tree* +static struct huffman_tree * constructTree(uint8_t lengths[], uint16_t count) { struct huffman_tree *tree; uint16_t lengthCount[MAX_BITS + 1] = { 0 }; uint16_t code, maxCode = 0, nextCode[MAX_BITS + 1]; @@ -283,21 +283,21 @@ fixedDistTree = constructTree(lengths, 32); } #ifndef DEFLATE64 -+ (instancetype)streamWithStream: (OFStream*)stream ++ (instancetype)streamWithStream: (OFStream *)stream { return [[[self alloc] initWithStream: stream] autorelease]; } - init { OF_INVALID_INIT_METHOD } -- initWithStream: (OFStream*)stream +- initWithStream: (OFStream *)stream { self = [super init]; _stream = [stream retain]; @@ -338,11 +338,11 @@ #else _decompression->slidingWindowMask = 0x7FFF; #endif } -- (size_t)lowlevelReadIntoBuffer: (void*)buffer_ +- (size_t)lowlevelReadIntoBuffer: (void *)buffer_ length: (size_t)length { struct of_deflate_stream_decompression_ivars *ivars = _decompression; uint8_t *buffer = buffer_; uint16_t bits, tmp; Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -50,11 +50,11 @@ * * @note Fast enumeration on a dictionary enumerates through the keys of the * dictionary. */ #ifdef OF_HAVE_GENERICS -@interface OFDictionary : +@interface OFDictionary: #else # ifndef DOXYGEN # define KeyType id # define ObjectType id # endif @@ -74,11 +74,11 @@ * * @param dictionary An OFDictionary * @return A new autoreleased OFDictionary */ + (instancetype)dictionaryWithDictionary: - (OFDictionary OF_GENERIC(KeyType, ObjectType)*)dictionary; + (OFDictionary OF_GENERIC(KeyType, ObjectType) *)dictionary; /*! * @brief Creates a new OFDictionary with the specified key and object. * * @param key The key @@ -94,12 +94,12 @@ * @param keys An array of keys * @param objects An array of objects * @return A new autoreleased OFDictionary */ + (instancetype) - dictionaryWithObjects: (OFArray OF_GENERIC(ObjectType)*)objects - forKeys: (OFArray OF_GENERIC(KeyType)*)keys; + dictionaryWithObjects: (OFArray OF_GENERIC(ObjectType) *)objects + forKeys: (OFArray OF_GENERIC(KeyType) *)keys; /*! * @brief Creates a new OFDictionary with the specified keys and objects. * * @param keys An array of keys @@ -126,11 +126,12 @@ * OFDictionary. * * @param dictionary An OFDictionary * @return An initialized OFDictionary */ -- initWithDictionary: (OFDictionary OF_GENERIC(KeyType, ObjectType)*)dictionary; +- initWithDictionary: + (OFDictionary OF_GENERIC(KeyType, ObjectType) *)dictionary; /*! * @brief Initializes an already allocated OFDictionary with the specified key * and object. * @@ -147,12 +148,12 @@ * * @param keys An array of keys * @param objects An array of objects * @return An initialized OFDictionary */ -- initWithObjects: (OFArray OF_GENERIC(ObjectType)*)objects - forKeys: (OFArray OF_GENERIC(KeyType)*)keys; +- initWithObjects: (OFArray OF_GENERIC(ObjectType) *)objects + forKeys: (OFArray OF_GENERIC(KeyType) *)keys; /*! * @brief Initializes an already allocated OFDictionary with the specified keys * and objects. * @@ -208,11 +209,11 @@ * @ref objectForKey:. * * @param key The key whose value should be returned * @return The value for the given key or `nil` if the key was not found */ -- (nullable id)valueForKey: (OFString*)key; +- (nullable id)valueForKey: (OFString *)key; /*! * @brief Sets a value for a key. * * If the key starts with an `@`, the `@` is stripped and @@ -223,11 +224,11 @@ * * @param key The key to set * @param value The value to set the key to */ - (void)setValue: (nullable id)value - forKey: (OFString*)key; + forKey: (OFString *)key; /*! * @brief Checks whether the dictionary contains an object equal to the * specified object. * @@ -249,32 +250,32 @@ /*! * @brief Returns an array of all keys. * * @return An array of all keys */ -- (OFArray OF_GENERIC(KeyType)*)allKeys; +- (OFArray OF_GENERIC(KeyType) *)allKeys; /*! * @brief Returns an array of all objects. * * @return An array of all objects */ -- (OFArray OF_GENERIC(ObjectType)*)allObjects; +- (OFArray OF_GENERIC(ObjectType) *)allObjects; /*! * @brief Returns an OFEnumerator to enumerate through the dictionary's keys. * * @return An OFEnumerator to enumerate through the dictionary's keys */ -- (OFEnumerator OF_GENERIC(KeyType)*)keyEnumerator; +- (OFEnumerator OF_GENERIC(KeyType) *)keyEnumerator; /*! * @brief Returns an OFEnumerator to enumerate through the dictionary's objects. * * @return An OFEnumerator to enumerate through the dictionary's objects */ -- (OFEnumerator OF_GENERIC(ObjectType)*)objectEnumerator; +- (OFEnumerator OF_GENERIC(ObjectType) *)objectEnumerator; #ifdef OF_HAVE_BLOCKS /*! * @brief Executes a block for each key / object pair. * @@ -288,11 +289,11 @@ * block. * * @param block A block which maps an object for each object * @return A new autoreleased OFDictionary */ -- (OFDictionary OF_GENERIC(KeyType, id)*)mappedDictionaryUsingBlock: +- (OFDictionary OF_GENERIC(KeyType, id) *)mappedDictionaryUsingBlock: (of_dictionary_map_block_t)block; /*! * @brief Creates a new dictionary, only containing the objects for which the * block returns true. @@ -299,11 +300,11 @@ * * @param block A block which determines if the object should be in the new * dictionary * @return A new autoreleased OFDictionary */ -- (OFDictionary OF_GENERIC(KeyType, ObjectType)*)filteredDictionaryUsingBlock: +- (OFDictionary OF_GENERIC(KeyType, ObjectType) *)filteredDictionaryUsingBlock: (of_dictionary_filter_block_t)block; #endif @end #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef KeyType Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -34,11 +34,11 @@ static struct { Class isa; } placeholder; @interface OFDictionary () -- (OFString*)OF_JSONRepresentationWithOptions: (int)options +- (OFString *)OF_JSONRepresentationWithOptions: (int)options depth: (size_t)depth; @end @interface OFDictionary_placeholder: OFDictionary @end @@ -47,11 +47,11 @@ - init { return (id)[[OFDictionary_hashtable alloc] init]; } -- initWithDictionary: (OFDictionary*)dictionary +- initWithDictionary: (OFDictionary *)dictionary { return (id)[[OFDictionary_hashtable alloc] initWithDictionary: dictionary]; } @@ -60,19 +60,19 @@ { return (id)[[OFDictionary_hashtable alloc] initWithObject: object forKey: key]; } -- initWithObjects: (OFArray*)objects - forKeys: (OFArray*)keys +- initWithObjects: (OFArray *)objects + forKeys: (OFArray *)keys { return (id)[[OFDictionary_hashtable alloc] initWithObjects: objects forKeys: keys]; } -- initWithObjects: (id const*)objects - forKeys: (id const*)keys +- initWithObjects: (id const *)objects + forKeys: (id const *)keys count: (size_t)count { return (id)[[OFDictionary_hashtable alloc] initWithObjects: objects forKeys: keys count: count]; @@ -96,11 +96,11 @@ { return (id)[[OFDictionary_hashtable alloc] initWithKey: firstKey arguments: arguments]; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { return (id)[[OFDictionary_hashtable alloc] initWithSerialization: element]; } @@ -142,11 +142,11 @@ + (instancetype)dictionary { return [[[self alloc] init] autorelease]; } -+ (instancetype)dictionaryWithDictionary: (OFDictionary*)dictionary ++ (instancetype)dictionaryWithDictionary: (OFDictionary *)dictionary { return [[[self alloc] initWithDictionary: dictionary] autorelease]; } + (instancetype)dictionaryWithObject: (id)object @@ -154,19 +154,19 @@ { return [[[self alloc] initWithObject: object forKey: key] autorelease]; } -+ (instancetype)dictionaryWithObjects: (OFArray*)objects - forKeys: (OFArray*)keys ++ (instancetype)dictionaryWithObjects: (OFArray *)objects + forKeys: (OFArray *)keys { return [[[self alloc] initWithObjects: objects forKeys: keys] autorelease]; } -+ (instancetype)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]; @@ -199,11 +199,11 @@ } return [super init]; } -- initWithDictionary: (OFDictionary*)dictionary +- initWithDictionary: (OFDictionary *)dictionary { OF_INVALID_INIT_METHOD } - initWithObject: (id)object @@ -213,12 +213,12 @@ @throw [OFInvalidArgumentException exception]; return [self initWithKeysAndObjects: key, object, nil]; } -- initWithObjects: (OFArray*)objects_ - forKeys: (OFArray*)keys_ +- initWithObjects: (OFArray *)objects_ + forKeys: (OFArray *)keys_ { id const *objects, *keys; size_t count; @try { @@ -237,12 +237,12 @@ return [self initWithObjects: objects forKeys: keys count: count]; } -- initWithObjects: (id const*)objects - forKeys: (id const*)keys +- initWithObjects: (id const *)objects + forKeys: (id const *)keys count: (size_t)count { OF_INVALID_INIT_METHOD } @@ -263,11 +263,11 @@ arguments: (va_list)arguments { OF_INVALID_INIT_METHOD } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { OF_INVALID_INIT_METHOD } - (id)objectForKey: (id)key @@ -278,11 +278,11 @@ - (id)objectForKeyedSubscript: (id)key { return [self objectForKey: key]; } -- (id)valueForKey: (OFString*)key +- (id)valueForKey: (OFString *)key { if ([key hasPrefix: @"@"]) { void *pool = objc_autoreleasePoolPush(); id ret; @@ -296,11 +296,11 @@ return [self objectForKey: key]; } - (void)setValue: (id)value - forKey: (OFString*)key + forKey: (OFString *)key { if ([key hasPrefix: @"@"]) { void *pool = objc_autoreleasePoolPush(); key = [key substringWithRange: of_range(1, [key length] - 1)]; @@ -314,12 +314,12 @@ if (![self isKindOfClass: [OFMutableDictionary class]]) @throw [OFUndefinedKeyException exceptionWithObject: self key: key value: value]; - [(OFMutableDictionary*)self setObject: value - forKey: key]; + [(OFMutableDictionary *)self setObject: value + forKey: key]; } - (size_t)count { OF_UNRECOGNIZED_SELECTOR @@ -415,11 +415,11 @@ objc_autoreleasePoolPop(pool); return false; } -- (OFArray*)allKeys +- (OFArray *)allKeys { OFMutableArray *ret = [OFMutableArray arrayWithCapacity: [self count]]; for (id key in self) [ret addObject: key]; @@ -427,11 +427,11 @@ [ret makeImmutable]; return ret; } -- (OFArray*)allObjects +- (OFArray *)allObjects { OFMutableArray *ret = [OFMutableArray arrayWithCapacity: [self count]]; void *pool = objc_autoreleasePoolPush(); OFEnumerator *enumerator = [self objectEnumerator]; id object; @@ -444,22 +444,22 @@ objc_autoreleasePoolPop(pool); return ret; } -- (OFEnumerator*)keyEnumerator +- (OFEnumerator *)keyEnumerator { OF_UNRECOGNIZED_SELECTOR } -- (OFEnumerator*)objectEnumerator +- (OFEnumerator *)objectEnumerator { OF_UNRECOGNIZED_SELECTOR } -- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state - objects: (id*)objects +- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state + objects: (id *)objects count: (int)count { OF_UNRECOGNIZED_SELECTOR } @@ -475,11 +475,11 @@ if (stop) break; } } -- (OFDictionary*)mappedDictionaryUsingBlock: (of_dictionary_map_block_t)block +- (OFDictionary *)mappedDictionaryUsingBlock: (of_dictionary_map_block_t)block { OFMutableDictionary *new = [OFMutableDictionary dictionary]; [self enumerateKeysAndObjectsUsingBlock: ^ (id key, id object, bool *stop) { @@ -490,11 +490,11 @@ [new makeImmutable]; return new; } -- (OFDictionary*)filteredDictionaryUsingBlock: +- (OFDictionary *)filteredDictionaryUsingBlock: (of_dictionary_filter_block_t)block { OFMutableDictionary *new = [OFMutableDictionary dictionary]; [self enumerateKeysAndObjectsUsingBlock: ^ (id key, id object, @@ -527,11 +527,11 @@ objc_autoreleasePoolPop(pool); return hash; } -- (OFString*)description +- (OFString *)description { OFMutableString *ret; void *pool; OFEnumerator *keyEnumerator, *objectEnumerator; id key, object; @@ -568,11 +568,11 @@ objc_autoreleasePoolPop(pool); return ret; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; OFEnumerator *keyEnumerator, *objectEnumerator; id key, object; @@ -612,23 +612,23 @@ objc_autoreleasePoolPop(pool); return [element autorelease]; } -- (OFString*)JSONRepresentation +- (OFString *)JSONRepresentation { return [self OF_JSONRepresentationWithOptions: 0 depth: 0]; } -- (OFString*)JSONRepresentationWithOptions: (int)options +- (OFString *)JSONRepresentationWithOptions: (int)options { return [self OF_JSONRepresentationWithOptions: options depth: 0]; } -- (OFString*)OF_JSONRepresentationWithOptions: (int)options +- (OFString *)OF_JSONRepresentationWithOptions: (int)options depth: (size_t)depth { OFMutableString *JSON = [OFMutableString stringWithString: @"{"]; void *pool = objc_autoreleasePoolPush(); OFEnumerator *keyEnumerator = [self keyEnumerator]; @@ -705,11 +705,11 @@ objc_autoreleasePoolPop(pool); return JSON; } -- (OFDataArray*)messagePackRepresentation +- (OFDataArray *)messagePackRepresentation { OFDataArray *data; size_t i, count; void *pool; OFEnumerator *keyEnumerator, *objectEnumerator; Index: src/OFDictionary_hashtable.m ================================================================== --- src/OFDictionary_hashtable.m +++ src/OFDictionary_hashtable.m @@ -28,17 +28,17 @@ #import "OFEnumerationMutationException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" -static void* +static void * copy(void *object) { return [(id)object copy]; } -static void* +static void * retain(void *object) { return [(id)object retain]; } @@ -94,11 +94,11 @@ } return self; } -- initWithDictionary: (OFDictionary*)dictionary +- initWithDictionary: (OFDictionary *)dictionary { size_t count; if (dictionary == nil) return [self init]; @@ -107,11 +107,11 @@ [dictionary isKindOfClass: [OFMutableDictionary_hashtable class]]) { self = [super init]; @try { OFDictionary_hashtable *dictionary_ = - (OFDictionary_hashtable*)dictionary; + (OFDictionary_hashtable *)dictionary; _mapTable = [dictionary_->_mapTable copy]; } @catch (id e) { [self release]; @throw e; @@ -164,12 +164,12 @@ } return self; } -- initWithObjects: (id const*)objects - forKeys: (id const*)keys +- initWithObjects: (id const *)objects + forKeys: (id const *)keys count: (size_t)count { self = [self initWithCapacity: count]; @try { @@ -238,11 +238,11 @@ } return self; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); @@ -316,11 +316,11 @@ if (![dictionary isKindOfClass: [OFDictionary_hashtable class]] && ![dictionary isKindOfClass: [OFMutableDictionary_hashtable class]]) return [super isEqual: dictionary]; - dictionary_ = (OFDictionary_hashtable*)dictionary; + dictionary_ = (OFDictionary_hashtable *)dictionary; return [dictionary_->_mapTable isEqual: _mapTable]; } - (bool)containsObject: (id)object @@ -331,11 +331,11 @@ - (bool)containsObjectIdenticalTo: (id)object { return [_mapTable containsObjectIdenticalTo: object]; } -- (OFArray*)allKeys +- (OFArray *)allKeys { OFArray *ret; id *keys; size_t count; @@ -366,11 +366,11 @@ } return ret; } -- (OFArray*)allObjects +- (OFArray *)allObjects { OFArray *ret; id *objects; size_t count; @@ -401,26 +401,26 @@ } return ret; } -- (OFEnumerator*)keyEnumerator +- (OFEnumerator *)keyEnumerator { return [[[OFMapTable_EnumeratorWrapper alloc] initWithEnumerator: [_mapTable keyEnumerator] object: self] autorelease]; } -- (OFEnumerator*)objectEnumerator +- (OFEnumerator *)objectEnumerator { return [[[OFMapTable_EnumeratorWrapper alloc] initWithEnumerator: [_mapTable objectEnumerator] object: self] autorelease]; } -- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state - objects: (id*)objects +- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state + objects: (id *)objects count: (int)count { return [_mapTable countByEnumeratingWithState: state objects: objects count: count]; Index: src/OFEnumerator.h ================================================================== --- src/OFEnumerator.h +++ src/OFEnumerator.h @@ -33,20 +33,20 @@ * @brief Returns an OFEnumerator to enumerate through all objects of the * collection. * * @returns An OFEnumerator to enumerate through all objects of the collection */ -- (OFEnumerator*)objectEnumerator; +- (OFEnumerator *)objectEnumerator; @end /*! * @class OFEnumerator OFEnumerator.h ObjFW/OFEnumerator.h * * @brief A class which provides methods to enumerate through collections. */ #ifdef OF_HAVE_GENERICS -@interface OFEnumerator : OFObject +@interface OFEnumerator: OFObject #else # ifndef DOXYGEN # define ObjectType id # endif @interface OFEnumerator: OFObject @@ -61,11 +61,11 @@ /*! * @brief Returns an array of all remaining objects in the collection. * * @return An array of all remaining objects in the collection */ -- (OFArray OF_GENERIC(ObjectType)*)allObjects; +- (OFArray OF_GENERIC(ObjectType) *)allObjects; /*! * @brief Resets the enumerator, so the next call to nextObject returns the * first object again. */ @@ -117,12 +117,12 @@ * @param objects A pointer to an array where to put the objects * @param count The number of objects that can be stored at objects * @return The number of objects returned in objects or 0 when the enumeration * finished. */ -- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state +- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state objects: (id __unsafe_unretained _Nonnull *_Nonnull) objects count: (int)count; @end OF_ASSUME_NONNULL_END Index: src/OFEnumerator.m ================================================================== --- src/OFEnumerator.m +++ src/OFEnumerator.m @@ -40,11 +40,11 @@ - (id)nextObject { OF_UNRECOGNIZED_SELECTOR } -- (OFArray*)allObjects +- (OFArray *)allObjects { OFMutableArray *ret = [OFMutableArray array]; void *pool = objc_autoreleasePoolPush(); id object; Index: src/OFFile.h ================================================================== --- src/OFFile.h +++ src/OFFile.h @@ -67,12 +67,12 @@ * `ab` | write-only, create, append, binary * `a+` | read-write, create, append * `ab+` or `a+b` | read-write, create, append, binary * @return A new autoreleased OFFile */ -+ (instancetype)fileWithPath: (OFString*)path - mode: (OFString*)mode; ++ (instancetype)fileWithPath: (OFString *)path + mode: (OFString *)mode; /*! * @brief Creates a new OFFile with the specified file descriptor. * * @param fd A file descriptor, returned from for example open(). @@ -101,12 +101,12 @@ * `ab` | write-only, create, append, binary * `a+` | read-write, create, append * `ab+` or `a+b` | read-write, create, append, binary * @return An initialized OFFile */ -- initWithPath: (OFString*)path - mode: (OFString*)mode; +- initWithPath: (OFString *)path + mode: (OFString *)mode; /*! * @brief Initializes an already allocated OFFile. * * @param fd A file descriptor, returned from for example open(). Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -129,12 +129,12 @@ @throw [OFInitializationFailedException exceptionWithClass: self]; #endif } -+ (instancetype)fileWithPath: (OFString*)path - mode: (OFString*)mode ++ (instancetype)fileWithPath: (OFString *)path + mode: (OFString *)mode { return [[[self alloc] initWithPath: path mode: mode] autorelease]; } @@ -147,12 +147,12 @@ - init { OF_INVALID_INIT_METHOD } -- initWithPath: (OFString*)path - mode: (OFString*)mode +- initWithPath: (OFString *)path + mode: (OFString *)mode { self = [super init]; @try { int flags; @@ -199,11 +199,11 @@ return true; return _atEndOfStream; } -- (size_t)lowlevelReadIntoBuffer: (void*)buffer +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { ssize_t ret; if (_fd == -1 || _atEndOfStream) @@ -229,11 +229,11 @@ _atEndOfStream = true; return ret; } -- (void)lowlevelWriteBuffer: (const void*)buffer +- (void)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { if (_fd == -1 || _atEndOfStream) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length]; Index: src/OFFileManager.h ================================================================== --- src/OFFileManager.h +++ src/OFFileManager.h @@ -30,59 +30,59 @@ */ @interface OFFileManager: OFObject /*! * @brief Returns the default file manager. */ -+ (OFFileManager*)defaultManager; ++ (OFFileManager *)defaultManager; /*! * @brief Returns the path for the current working directory. * * @return The path of the current working directory */ -- (OFString*)currentDirectoryPath; +- (OFString *)currentDirectoryPath; /*! * @brief Checks whether a file exists at the specified path. * * @param path The path to check * @return A boolean whether there is a file at the specified path */ -- (bool)fileExistsAtPath: (OFString*)path; +- (bool)fileExistsAtPath: (OFString *)path; /*! * @brief Checks whether a directory exists at the specified path. * * @param path The path to check * @return A boolean whether there is a directory at the specified path */ -- (bool)directoryExistsAtPath: (OFString*)path; +- (bool)directoryExistsAtPath: (OFString *)path; #if defined(OF_HAVE_SYMLINK) || defined(OF_WINDOWS) /*! * @brief Checks whether a symbolic link exists at the specified path. * * @param path The path to check * @return A boolean whether there is a symbolic link at the specified path */ -- (bool)symbolicLinkExistsAtPath: (OFString*)path; +- (bool)symbolicLinkExistsAtPath: (OFString *)path; #endif /*! * @brief Creates a directory at the specified path. * * @param path The path of the directory to create */ -- (void)createDirectoryAtPath: (OFString*)path; +- (void)createDirectoryAtPath: (OFString *)path; /*! * @brief Creates a directory at the specified path. * * @param path The path of the directory to create * @param createParents Whether to create the parents of the directory */ -- (void)createDirectoryAtPath: (OFString*)path +- (void)createDirectoryAtPath: (OFString *)path createParents: (bool)createParents; /*! * @brief Returns an array with the items in the specified directory. * @@ -89,90 +89,90 @@ * @note `.` and `..` are not part of the returned array. * * @param path The path to the directory whose items should be returned * @return An array of OFString with the items in the specified directory */ -- (OFArray OF_GENERIC(OFString*)*)contentsOfDirectoryAtPath: (OFString*)path; +- (OFArray OF_GENERIC(OFString *) *)contentsOfDirectoryAtPath: (OFString *)path; /*! * @brief Changes the current working directory. * * @param path The new directory to change to */ -- (void)changeCurrentDirectoryPath: (OFString*)path; +- (void)changeCurrentDirectoryPath: (OFString *)path; /*! * @brief Returns the size of the specified file. * * @param path The path to the file whose size should be returned * * @return The size of the specified file */ -- (of_offset_t)sizeOfFileAtPath: (OFString*)path; +- (of_offset_t)sizeOfFileAtPath: (OFString *)path; /*! * @brief Returns the last access time of the specified item. * * @param path The path to the item whose last access time should be returned * * @return The last access time of the specified item */ -- (OFDate*)accessTimeOfItemAtPath: (OFString*)path; +- (OFDate *)accessTimeOfItemAtPath: (OFString *)path; /*! * @brief Returns the last modification time of the specified item. * * @param path The path to the item whose last modification time should be * returned * * @return The last modification time of the specified item */ -- (OFDate*)modificationTimeOfItemAtPath: (OFString*)path; +- (OFDate *)modificationTimeOfItemAtPath: (OFString *)path; /*! * @brief Returns the last status change time of the specified item. * * @param path The path to the item whose last status change time should be * returned * * @return The last status change time of the specified item */ -- (OFDate*)statusChangeTimeOfItemAtPath: (OFString*)path; +- (OFDate *)statusChangeTimeOfItemAtPath: (OFString *)path; #ifdef OF_HAVE_CHMOD /*! * @brief Returns the permissions of the specified item. * * @param path The path to the item whose permissions should be returned * * @return The permissions of the specified item */ -- (mode_t)permissionsOfItemAtPath: (OFString*)path; +- (mode_t)permissionsOfItemAtPath: (OFString *)path; /*! * @brief Changes the permissions of an item. * * This method only changes the read-only flag on Windows. * * @param path The path to the item whose permissions should be changed * @param permissions The new permissions for the item */ -- (void)changePermissionsOfItemAtPath: (OFString*)path +- (void)changePermissionsOfItemAtPath: (OFString *)path permissions: (mode_t)permissions; #endif #ifdef OF_HAVE_CHOWN /*! * @brief Get the owner and group of the specified item. * - * @param owner A pointer to an OFString* to store the owner, or nil - * @param group A pointer to an OFString* to store the group, or nil + * @param owner A pointer to an `OFString *` to store the owner, or nil + * @param group A pointer to an `OFString *` to store the group, or nil * @param path The path to the item whose owner and group should be retrieved */ - (void)getOwner: (OFString *__autoreleasing _Nonnull *_Nullable)owner group: (OFString *__autoreleasing _Nonnull *_Nullable)group - ofItemAtPath: (OFString*)path; + ofItemAtPath: (OFString *)path; /*! * @brief Changes the owner of an item. * * This method is not available on some systems, most notably Windows. @@ -179,13 +179,13 @@ * * @param path The path to the item whose owner should be changed * @param owner The new owner for the item * @param group The new group for the item */ -- (void)changeOwnerOfItemAtPath: (OFString*)path - owner: (OFString*)owner - group: (OFString*)group; +- (void)changeOwnerOfItemAtPath: (OFString *)path + owner: (OFString *)owner + group: (OFString *)group; #endif /*! * @brief Copies a file, directory or symlink (if supported by the OS). * @@ -197,12 +197,12 @@ * directory. * * @param source The file, directory or symlink to copy * @param destination The destination path */ -- (void)copyItemAtPath: (OFString*)source - toPath: (OFString*)destination; +- (void)copyItemAtPath: (OFString *)source + toPath: (OFString *)destination; /*! * @brief Moves an item. * * The destination path must be a full path, which means it must include the @@ -213,21 +213,21 @@ * removed using @ref removeItemAtPath:. * * @param source The item to rename * @param destination The new name for the item */ -- (void)moveItemAtPath: (OFString*)source - toPath: (OFString*)destination; +- (void)moveItemAtPath: (OFString *)source + toPath: (OFString *)destination; /*! * @brief Removes the item at the specified path. * * If the item at the specified path is a directory, it is removed recursively. * * @param path The path to the item which should be removed */ -- (void)removeItemAtPath: (OFString*)path; +- (void)removeItemAtPath: (OFString *)path; #if defined(OF_HAVE_LINK) || defined(OF_WINDOWS) /*! * @brief Creates a hard link for the specified item. * @@ -237,12 +237,12 @@ * This method is not available on some systems. * * @param source The path to the item for which a link should be created * @param destination The path to the item which should link to the source */ -- (void)linkItemAtPath: (OFString*)source - toPath: (OFString*)destination; +- (void)linkItemAtPath: (OFString *)source + toPath: (OFString *)destination; #endif #if defined(OF_HAVE_SYMLINK) || defined(OF_WINDOWS) /*! * @brief Creates a symbolic link for an item. @@ -258,12 +258,12 @@ * @param destination The path to the item which should symbolically link to the * source * @param source The path to the item for which a symbolic link should be * created */ -- (void)createSymbolicLinkAtPath: (OFString*)destination - withDestinationPath: (OFString*)source; +- (void)createSymbolicLinkAtPath: (OFString *)destination + withDestinationPath: (OFString *)source; #endif #if defined(OF_HAVE_READLINK) || defined(OF_WINDOWS) /*! * @brief Returns the destination of the symbolic link at the specified path. @@ -272,10 +272,10 @@ * * @note On Windows, at least Windows Vista is required. * * @return The destination of the symbolic link at the specified path */ -- (OFString*)destinationOfSymbolicLinkAtPath: (OFString*)path; +- (OFString *)destinationOfSymbolicLinkAtPath: (OFString *)path; #endif @end OF_ASSUME_NONNULL_END Index: src/OFFileManager.m ================================================================== --- src/OFFileManager.m +++ src/OFFileManager.m @@ -163,16 +163,16 @@ #endif defaultManager = [[OFFileManager alloc] init]; } -+ (OFFileManager*)defaultManager ++ (OFFileManager *)defaultManager { return defaultManager; } -- (OFString*)currentDirectoryPath +- (OFString *)currentDirectoryPath { OFString *ret; #ifndef OF_WINDOWS char *buffer = getcwd(NULL, 0); #else @@ -192,11 +192,11 @@ } return ret; } -- (bool)fileExistsAtPath: (OFString*)path +- (bool)fileExistsAtPath: (OFString *)path { of_stat_t s; if (path == nil) @throw [OFInvalidArgumentException exception]; @@ -208,11 +208,11 @@ return true; return false; } -- (bool)directoryExistsAtPath: (OFString*)path +- (bool)directoryExistsAtPath: (OFString *)path { of_stat_t s; if (path == nil) @throw [OFInvalidArgumentException exception]; @@ -225,11 +225,11 @@ return false; } #if defined(OF_HAVE_SYMLINK) -- (bool)symbolicLinkExistsAtPath: (OFString*)path +- (bool)symbolicLinkExistsAtPath: (OFString *)path { of_stat_t s; if (path == nil) @throw [OFInvalidArgumentException exception]; @@ -241,11 +241,11 @@ return true; return false; } #elif defined(OF_WINDOWS) -- (bool)symbolicLinkExistsAtPath: (OFString*)path +- (bool)symbolicLinkExistsAtPath: (OFString *)path { WIN32_FIND_DATAW data; if (!FindFirstFileW([path UTF16String], &data)) return false; @@ -256,11 +256,11 @@ return false; } #endif -- (void)createDirectoryAtPath: (OFString*)path +- (void)createDirectoryAtPath: (OFString *)path { if (path == nil) @throw [OFInvalidArgumentException exception]; #ifndef OF_WINDOWS @@ -272,11 +272,11 @@ @throw [OFCreateDirectoryFailedException exceptionWithPath: path errNo: errno]; } -- (void)createDirectoryAtPath: (OFString*)path +- (void)createDirectoryAtPath: (OFString *)path createParents: (bool)createParents { OFString *currentPath = nil; if (!createParents) { @@ -306,11 +306,11 @@ [currentPath autorelease]; } } -- (OFArray*)contentsOfDirectoryAtPath: (OFString*)path +- (OFArray *)contentsOfDirectoryAtPath: (OFString *)path { OFMutableArray *files; #ifndef OF_WINDOWS of_string_encoding_t encoding; #endif @@ -426,11 +426,11 @@ [files makeImmutable]; return files; } -- (void)changeCurrentDirectoryPath: (OFString*)path +- (void)changeCurrentDirectoryPath: (OFString *)path { if (path == nil) @throw [OFInvalidArgumentException exception]; #ifndef OF_WINDOWS @@ -441,11 +441,11 @@ @throw [OFChangeCurrentDirectoryPathFailedException exceptionWithPath: path errNo: errno]; } -- (of_offset_t)sizeOfFileAtPath: (OFString*)path +- (of_offset_t)sizeOfFileAtPath: (OFString *)path { of_stat_t s; if (path == nil) @throw [OFInvalidArgumentException exception]; @@ -455,11 +455,11 @@ errNo: errno]; return s.st_size; } -- (OFDate*)accessTimeOfItemAtPath: (OFString*)path +- (OFDate *)accessTimeOfItemAtPath: (OFString *)path { of_stat_t s; if (path == nil) @throw [OFInvalidArgumentException exception]; @@ -470,11 +470,11 @@ /* FIXME: We could be more precise on some OSes */ return [OFDate dateWithTimeIntervalSince1970: s.st_atime]; } -- (OFDate*)modificationTimeOfItemAtPath: (OFString*)path +- (OFDate *)modificationTimeOfItemAtPath: (OFString *)path { of_stat_t s; if (path == nil) @throw [OFInvalidArgumentException exception]; @@ -485,11 +485,11 @@ /* FIXME: We could be more precise on some OSes */ return [OFDate dateWithTimeIntervalSince1970: s.st_mtime]; } -- (OFDate*)statusChangeTimeOfItemAtPath: (OFString*)path +- (OFDate *)statusChangeTimeOfItemAtPath: (OFString *)path { of_stat_t s; if (path == nil) @throw [OFInvalidArgumentException exception]; @@ -501,11 +501,11 @@ /* FIXME: We could be more precise on some OSes */ return [OFDate dateWithTimeIntervalSince1970: s.st_ctime]; } #ifdef OF_HAVE_CHMOD -- (mode_t)permissionsOfItemAtPath: (OFString*)path +- (mode_t)permissionsOfItemAtPath: (OFString *)path { of_stat_t s; if (path == nil) @throw [OFInvalidArgumentException exception]; @@ -515,11 +515,11 @@ errNo: errno]; return s.st_mode; } -- (void)changePermissionsOfItemAtPath: (OFString*)path +- (void)changePermissionsOfItemAtPath: (OFString *)path permissions: (mode_t)permissions { if (path == nil) @throw [OFInvalidArgumentException exception]; @@ -535,13 +535,13 @@ errNo: errno]; } #endif #ifdef OF_HAVE_CHOWN -- (void)getOwner: (OFString**)owner - group: (OFString**)group - ofItemAtPath: (OFString*)path +- (void)getOwner: (OFString **)owner + group: (OFString **)group + ofItemAtPath: (OFString *)path { of_stat_t s; if (path == nil) @throw [OFInvalidArgumentException exception]; @@ -574,13 +574,13 @@ [passwdMutex unlock]; } #endif } -- (void)changeOwnerOfItemAtPath: (OFString*)path - owner: (OFString*)owner - group: (OFString*)group +- (void)changeOwnerOfItemAtPath: (OFString *)path + owner: (OFString *)owner + group: (OFString *)group { uid_t uid = -1; gid_t gid = -1; of_string_encoding_t encoding; @@ -632,12 +632,12 @@ group: group errNo: errno]; } #endif -- (void)copyItemAtPath: (OFString*)source - toPath: (OFString*)destination +- (void)copyItemAtPath: (OFString *)source + toPath: (OFString *)destination { void *pool; of_stat_t s; if (source == nil || destination == nil) @@ -776,12 +776,12 @@ errNo: EINVAL]; objc_autoreleasePoolPop(pool); } -- (void)moveItemAtPath: (OFString*)source - toPath: (OFString*)destination +- (void)moveItemAtPath: (OFString *)source + toPath: (OFString *)destination { void *pool; of_stat_t s; #ifndef OF_WINDOWS of_string_encoding_t encoding; @@ -835,11 +835,11 @@ } objc_autoreleasePoolPop(pool); } -- (void)removeItemAtPath: (OFString*)path +- (void)removeItemAtPath: (OFString *)path { void *pool; of_stat_t s; if (path == nil) @@ -904,12 +904,12 @@ objc_autoreleasePoolPop(pool); } #if defined(OF_HAVE_LINK) -- (void)linkItemAtPath: (OFString*)source - toPath: (OFString*)destination +- (void)linkItemAtPath: (OFString *)source + toPath: (OFString *)destination { void *pool; of_string_encoding_t encoding; if (source == nil || destination == nil) @@ -926,12 +926,12 @@ errNo: errno]; objc_autoreleasePoolPop(pool); } #else -- (void)linkItemAtPath: (OFString*)source - toPath: (OFString*)destination +- (void)linkItemAtPath: (OFString *)source + toPath: (OFString *)destination { void *pool; if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; @@ -947,12 +947,12 @@ objc_autoreleasePoolPop(pool); } #endif #if defined(OF_HAVE_SYMLINK) -- (void)createSymbolicLinkAtPath: (OFString*)destination - withDestinationPath: (OFString*)source +- (void)createSymbolicLinkAtPath: (OFString *)destination + withDestinationPath: (OFString *)source { void *pool; of_string_encoding_t encoding; if (source == nil || destination == nil) @@ -969,12 +969,12 @@ errNo: errno]; objc_autoreleasePoolPop(pool); } #elif defined(OF_WINDOWS) -- (void)createSymbolicLinkAtPath: (OFString*)destination - withDestinationPath: (OFString*)source +- (void)createSymbolicLinkAtPath: (OFString *)destination + withDestinationPath: (OFString *)source { void *pool; if (func_CreateSymbolicLinkW == NULL) @throw [OFNotImplementedException exceptionWithSelector: _cmd @@ -994,11 +994,11 @@ objc_autoreleasePoolPop(pool); } #endif #ifdef OF_HAVE_READLINK -- (OFString*)destinationOfSymbolicLinkAtPath: (OFString*)path +- (OFString *)destinationOfSymbolicLinkAtPath: (OFString *)path { char destination[PATH_MAX]; ssize_t length; of_string_encoding_t encoding; @@ -1016,11 +1016,11 @@ return [OFString stringWithCString: destination encoding: encoding length: length]; } #elif defined(OF_WINDOWS) -- (OFString*)destinationOfSymbolicLinkAtPath: (OFString*)path +- (OFString *)destinationOfSymbolicLinkAtPath: (OFString *)path { HANDLE handle; /* Check if we're on a version that actually supports symlinks. */ if (func_CreateSymbolicLinkW == NULL) Index: src/OFGZIPStream.h ================================================================== --- src/OFGZIPStream.h +++ src/OFGZIPStream.h @@ -72,10 +72,10 @@ OFDate *_modificationDate; uint16_t _extraLength; uint32_t _CRC32, _uncompressedSize; } -+ (instancetype)streamWithStream: (OFStream*)stream; -- initWithStream: (OFStream*)stream; ++ (instancetype)streamWithStream: (OFStream *)stream; +- initWithStream: (OFStream *)stream; @end OF_ASSUME_NONNULL_END Index: src/OFGZIPStream.m ================================================================== --- src/OFGZIPStream.m +++ src/OFGZIPStream.m @@ -24,16 +24,16 @@ #import "OFChecksumFailedException.h" #import "OFInvalidFormatException.h" @implementation OFGZIPStream -+ (instancetype)streamWithStream: (OFStream*)stream ++ (instancetype)streamWithStream: (OFStream *)stream { return [[[self alloc] initWithStream: stream] autorelease]; } -- initWithStream: (OFStream*)stream +- initWithStream: (OFStream *)stream { self = [super init]; @try { _stream = [stream retain]; @@ -53,11 +53,11 @@ [_modificationDate release]; [super dealloc]; } -- (size_t)lowlevelReadIntoBuffer: (void*)buffer +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { uint8_t byte; for (;;) { Index: src/OFHMAC.h ================================================================== --- src/OFHMAC.h +++ src/OFHMAC.h @@ -62,20 +62,20 @@ * it yourself before calling @ref setKey:length:! * * @param key The key for the HMAC * @param length The length of the key for the HMAC */ -- (void)setKey: (const void*)key +- (void)setKey: (const void *)key length: (size_t)length; /*! * @brief Adds a buffer to the HMAC to be calculated. * * @param buffer The buffer which should be included into the calculation * @param length The length of the buffer */ -- (void)updateWithBuffer: (const void*)buffer +- (void)updateWithBuffer: (const void *)buffer length: (size_t)length; /*! * @brief Returns a buffer containing the HMAC. * @@ -82,11 +82,11 @@ * The size of the buffer depends on the hash used. The buffer is part of the * receiver's memory pool. * * @return A buffer containing the hash */ -- (const unsigned char*)digest OF_RETURNS_INNER_POINTER; +- (const unsigned char *)digest OF_RETURNS_INNER_POINTER; /*! * @brief Returns the size of the digest. * * @return The size of the digest. Index: src/OFHMAC.m ================================================================== --- src/OFHMAC.m +++ src/OFHMAC.m @@ -44,11 +44,11 @@ [_innerHashCopy release]; [super dealloc]; } -- (void)setKey: (const void*)key +- (void)setKey: (const void *)key length: (size_t)length { void *pool = objc_autoreleasePoolPush(); size_t blockSize = [_hashClass blockSize]; uint8_t outerKeyPad[blockSize], innerKeyPad[blockSize]; @@ -98,11 +98,11 @@ _innerHashCopy = [_innerHash copy]; _calculated = false; } -- (void)updateWithBuffer: (const void*)buffer +- (void)updateWithBuffer: (const void *)buffer length: (size_t)length { if (_innerHash == nil) @throw [OFInvalidArgumentException exception]; @@ -112,11 +112,11 @@ [_innerHash updateWithBuffer: buffer length: length]; } -- (const unsigned char*)digest +- (const unsigned char *)digest { if (_outerHash == nil || _innerHash == nil) @throw [OFInvalidArgumentException exception]; if (_calculated) Index: src/OFHTTPClient.h ================================================================== --- src/OFHTTPClient.h +++ src/OFHTTPClient.h @@ -47,13 +47,13 @@ * * @param client The OFHTTPClient that created a socket * @param socket The socket created by the OFHTTPClient * @param request The request for which the socket was created */ -- (void)client: (OFHTTPClient*)client - didCreateSocket: (OF_KINDOF(OFTCPSocket*))socket - request: (OFHTTPRequest*)request; +- (void)client: (OFHTTPClient *)client + didCreateSocket: (OF_KINDOF(OFTCPSocket *))socket + request: (OFHTTPRequest *)request; /*! * @brief A callback which is called when an OFHTTPClient received headers. * * @param client The OFHTTPClient which received the headers @@ -60,14 +60,14 @@ * @param headers The headers received * @param statusCode The status code received * @param request The request for which the headers and status code have been * received */ -- (void)client: (OFHTTPClient*)client - didReceiveHeaders: (OFDictionary OF_GENERIC(OFString*, OFString*)*)headers +- (void)client: (OFHTTPClient *)client + didReceiveHeaders: (OFDictionary OF_GENERIC(OFString *, OFString *) *)headers statusCode: (int)statusCode - request: (OFHTTPRequest*)request; + request: (OFHTTPRequest *)request; /*! * @brief A callback which is called when an OFHTTPClient wants to follow a * redirect. * @@ -85,15 +85,15 @@ * @param statusCode The status code for the redirection * @param request The request for which the OFHTTPClient wants to redirect * @param response The response indicating the redirect * @return A boolean whether the OFHTTPClient should follow the redirect */ -- (bool)client: (OFHTTPClient*)client - shouldFollowRedirect: (OFURL*)URL +- (bool)client: (OFHTTPClient *)client + shouldFollowRedirect: (OFURL *)URL statusCode: (int)statusCode - request: (OFHTTPRequest*)request - response: (OFHTTPResponse*)response; + request: (OFHTTPRequest *)request + response: (OFHTTPResponse *)response; @end /*! * @class OFHTTPClient OFHTTPClient.h ObjFW/OFHTTPClient.h * @@ -129,11 +129,11 @@ /*! * @brief Performs the specified HTTP request and returns an OFHTTPResponse. * * @return An OFHTTPResponse with the response for the HTTP request */ -- (OFHTTPResponse*)performRequest: (OFHTTPRequest*)request; +- (OFHTTPResponse *)performRequest: (OFHTTPRequest *)request; /*! * @brief Performs the HTTP request and returns an OFHTTPResponse. * * @param request The request to perform @@ -140,15 +140,15 @@ * @param redirects The maximum number of redirects after which no further * attempt is done to follow the redirect, but instead the * redirect is returned as an OFHTTPResponse * @return An OFHTTPResponse with the response for the HTTP request */ -- (OFHTTPResponse*)performRequest: (OFHTTPRequest*)request - redirects: (size_t)redirects; +- (OFHTTPResponse *)performRequest: (OFHTTPRequest *)request + redirects: (size_t)redirects; /*! * @brief Closes connections that are still open due to keep-alive. */ - (void)close; @end OF_ASSUME_NONNULL_END Index: src/OFHTTPClient.m ================================================================== --- src/OFHTTPClient.m +++ src/OFHTTPClient.m @@ -42,11 +42,11 @@ #import "OFWriteFailedException.h" static OF_INLINE void normalizeKey(char *str_) { - unsigned char *str = (unsigned char*)str_; + unsigned char *str = (unsigned char *)str_; bool firstLetter = true; while (*str != '\0') { if (!of_ascii_isalpha(*str)) { firstLetter = true; @@ -68,16 +68,16 @@ OFTCPSocket *_socket; bool _hasContentLength, _chunked, _keepAlive, _atEndOfStream; size_t _toRead; } -- initWithSocket: (OFTCPSocket*)socket; +- initWithSocket: (OFTCPSocket *)socket; - (void)OF_setKeepAlive: (bool)keepAlive; @end @implementation OFHTTPClientResponse -- initWithSocket: (OFTCPSocket*)socket +- initWithSocket: (OFTCPSocket *)socket { self = [super init]; _socket = [socket retain]; @@ -94,11 +94,11 @@ [_socket release]; [super dealloc]; } -- (void)setHeaders: (OFDictionary*)headers +- (void)setHeaders: (OFDictionary *)headers { OFString *contentLength; [super setHeaders: headers]; @@ -125,11 +125,11 @@ @throw [OFInvalidServerReplyException exception]; } } } -- (size_t)lowlevelReadIntoBuffer: (void*)buffer +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { if (_atEndOfStream) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length @@ -275,17 +275,17 @@ [self close]; [super dealloc]; } -- (OFHTTPResponse*)performRequest: (OFHTTPRequest*)request +- (OFHTTPResponse *)performRequest: (OFHTTPRequest *)request { return [self performRequest: request redirects: 10]; } -- (OFTCPSocket*)OF_closeAndCreateSocketForRequest: (OFHTTPRequest*)request +- (OFTCPSocket *)OF_closeAndCreateSocketForRequest: (OFHTTPRequest *)request { OFURL *URL = [request URL]; OFTCPSocket *socket; [self close]; @@ -310,27 +310,27 @@ port: [URL port]]; return socket; } -- (OFHTTPResponse*)performRequest: (OFHTTPRequest*)request - redirects: (size_t)redirects +- (OFHTTPResponse *)performRequest: (OFHTTPRequest *)request + redirects: (size_t)redirects { void *pool = objc_autoreleasePoolPush(); OFURL *URL = [request URL]; OFString *scheme = [URL scheme]; of_http_request_method_t method = [request method]; OFString *path; OFMutableString *requestString; OFString *user, *password; - OFMutableDictionary OF_GENERIC(OFString*, OFString*) *headers; + OFMutableDictionary OF_GENERIC(OFString *, OFString *) *headers; OFDataArray *body = [request body]; OFTCPSocket *socket; OFHTTPClientResponse *response; OFString *line, *version, *redirect, *connectionHeader; bool keepAlive; - OFMutableDictionary OF_GENERIC(OFString*, OFString*) *serverHeaders; + OFMutableDictionary OF_GENERIC(OFString *, OFString *) *serverHeaders; OFEnumerator *keyEnumerator, *objectEnumerator; OFString *key, *object; int status; if (![scheme isEqual: @"http"] && ![scheme isEqual: @"https"]) Index: src/OFHTTPCookie.h ================================================================== --- src/OFHTTPCookie.h +++ src/OFHTTPCookie.h @@ -28,11 +28,11 @@ { OFString *_name, *_value; OFDate *_expires; OFString *_domain, *_path; bool _secure, _HTTPOnly; - OFMutableArray OF_GENERIC(OFString*) *_extensions; + OFMutableArray OF_GENERIC(OFString *) *_extensions; } /*! * The name of the cookie. */ @@ -70,36 +70,36 @@ /*! * An array of other attributes. */ @property (readonly, nonatomic) - OFMutableArray OF_GENERIC(OFString*) *extensions; + OFMutableArray OF_GENERIC(OFString *) *extensions; /*! * @brief Create a new cookie with the specified name and value. * * @param name The name of the cookie * @param value The value of the cookie * @return A new, autoreleased OFHTTPCookie */ -+ (instancetype)cookieWithName: (OFString*)name - value: (OFString*)value; ++ (instancetype)cookieWithName: (OFString *)name + value: (OFString *)value; /*! * @brief Parses the specified string and returns an array of cookies. * * @param string The cookie string to parse * @return An array of cookies */ -+ (OFArray OF_GENERIC(OFHTTPCookie*)*)cookiesForString: (OFString*)string; ++ (OFArray OF_GENERIC(OFHTTPCookie *) *)cookiesForString: (OFString *)string; /*! * @brief Initializes an already allocated new cookie with the specified name * and value. * * @param name The name of the cookie * @param value The value of the cookie * @return An initialized OFHTTPCookie */ -- initWithName: (OFString*)name - value: (OFString*)value; +- initWithName: (OFString *)name + value: (OFString *)value; @end Index: src/OFHTTPCookie.m ================================================================== --- src/OFHTTPCookie.m +++ src/OFHTTPCookie.m @@ -55,20 +55,20 @@ @implementation OFHTTPCookie @synthesize name = _name, value = _value, expires = _expires, domain = _domain; @synthesize path = _path, secure = _secure, HTTPOnly = _HTTPOnly; @synthesize extensions = _extensions; -+ (instancetype)cookieWithName: (OFString*)name - value: (OFString*)value ++ (instancetype)cookieWithName: (OFString *)name + value: (OFString *)value { return [[[self alloc] initWithName: name value: value] autorelease]; } -+ (OFArray OF_GENERIC(OFHTTPCookie*)*)cookiesForString: (OFString*)string ++ (OFArray OF_GENERIC(OFHTTPCookie *) *)cookiesForString: (OFString *)string { - OFMutableArray OF_GENERIC(OFHTTPCookie*) *ret = [OFMutableArray array]; + OFMutableArray OF_GENERIC(OFHTTPCookie *) *ret = [OFMutableArray array]; void *pool = objc_autoreleasePoolPush(); const of_unichar_t *characters = [string characters]; size_t length = [string length], last = 0; enum { STATE_PRE_NAME, @@ -247,12 +247,12 @@ - init { OF_INVALID_INIT_METHOD } -- initWithName: (OFString*)name - value: (OFString*)value +- initWithName: (OFString *)name + value: (OFString *)value { self = [super init]; @try { _name = [name copy]; @@ -345,11 +345,11 @@ } return copy; } -- (OFString*)description +- (OFString *)description { OFMutableString *ret = [OFMutableString stringWithFormat: @"%@=%@", _name, _value]; void *pool = objc_autoreleasePoolPush(); Index: src/OFHTTPRequest.h ================================================================== --- src/OFHTTPRequest.h +++ src/OFHTTPRequest.h @@ -74,12 +74,12 @@ @interface OFHTTPRequest: OFObject { OFURL *_URL; of_http_request_method_t _method; of_http_request_protocol_version_t _protocolVersion; - OFDictionary OF_GENERIC(OFString*, OFString*) *_headers; - OFArray OF_GENERIC(OFHTTPCookie*) *_cookies; + OFDictionary OF_GENERIC(OFString *, OFString *) *_headers; + OFArray OF_GENERIC(OFHTTPCookie *) *_cookies; OFDataArray *_body; OFString *_remoteAddress; } /*! @@ -94,17 +94,17 @@ /*! * The headers for the HTTP request. */ @property OF_NULLABLE_PROPERTY (nonatomic, copy) - OFDictionary OF_GENERIC(OFString*, OFString*) *headers; + OFDictionary OF_GENERIC(OFString *, OFString *) *headers; /*! * The cookies for the HTTP request. */ @property OF_NULLABLE_PROPERTY (nonatomic, copy) - OFArray OF_GENERIC(OFHTTPCookie*) *cookies; + OFArray OF_GENERIC(OFHTTPCookie *) *cookies; /*! * The entity body of the HTTP request. */ @property OF_NULLABLE_PROPERTY (nonatomic, retain) OFDataArray *body; @@ -125,19 +125,19 @@ * @brief Creates a new OFHTTPRequest with the specified URL. * * @param URL The URL for the request * @return A new, autoreleased OFHTTPRequest */ -+ (instancetype)requestWithURL: (OFURL*)URL; ++ (instancetype)requestWithURL: (OFURL *)URL; /*! * @brief Initializes an already allocated OFHTTPRequest with the specified URL. * * @param URL The URL for the request * @return An initialized OFHTTPRequest */ -- initWithURL: (OFURL*)URL; +- initWithURL: (OFURL *)URL; /*! * @brief Sets the protocol version of the HTTP request. * * @param protocolVersion The protocol version of the HTTP request @@ -155,35 +155,35 @@ * @brief Sets the protocol version of the HTTP request to the version * described by the specified string. * * @param string A string describing an HTTP version */ -- (void)setProtocolVersionFromString: (OFString*)string; +- (void)setProtocolVersionFromString: (OFString *)string; /*! * @brief Returns the protocol version of the HTTP request as a string. * * @return The protocol version of the HTTP request as a string */ -- (OFString*)protocolVersionString; +- (OFString *)protocolVersionString; /*! * @brief Sets the entity body of the HTTP request to the specified string * encoded in UTF-8. * * @param string The string to use for the entity body */ -- (void)setBodyFromString: (nullable OFString*)string; +- (void)setBodyFromString: (nullable OFString *)string; /*! * @brief Sets the entity body of the HTTP request to the specified string * encoded in the specified encoding. * * @param string The string to use for the entity body * @param encoding The encoding to encode the string with */ -- (void)setBodyFromString: (nullable OFString*)string +- (void)setBodyFromString: (nullable OFString *)string encoding: (of_string_encoding_t)encoding; @end #ifdef __cplusplus extern "C" { Index: src/OFHTTPRequest.m ================================================================== --- src/OFHTTPRequest.m +++ src/OFHTTPRequest.m @@ -27,11 +27,11 @@ #import "OFInvalidFormatException.h" #import "OFOutOfRangeException.h" #import "OFUnsupportedVersionException.h" -const char* +const char * of_http_request_method_to_string(of_http_request_method_t method) { switch (method) { case OF_HTTP_REQUEST_METHOD_OPTIONS: return "OPTIONS"; @@ -84,11 +84,11 @@ + (instancetype)request { return [[[self alloc] init] autorelease]; } -+ (instancetype)requestWithURL: (OFURL*)URL ++ (instancetype)requestWithURL: (OFURL *)URL { return [[[self alloc] initWithURL: URL] autorelease]; } - init @@ -100,11 +100,11 @@ _protocolVersion.minor = 1; return self; } -- initWithURL: (OFURL*)URL +- initWithURL: (OFURL *)URL { self = [self init]; @try { [self setURL: URL]; @@ -200,11 +200,11 @@ - (of_http_request_protocol_version_t)protocolVersion { return _protocolVersion; } -- (void)setProtocolVersionFromString: (OFString*)string +- (void)setProtocolVersionFromString: (OFString *)string { void *pool = objc_autoreleasePoolPush(); OFArray *components = [string componentsSeparatedByString: @"."]; intmax_t major, minor; of_http_request_protocol_version_t protocolVersion; @@ -224,24 +224,24 @@ [self setProtocolVersion: protocolVersion]; objc_autoreleasePoolPop(pool); } -- (OFString*)protocolVersionString +- (OFString *)protocolVersionString { return [OFString stringWithFormat: @"%u.%u", _protocolVersion.major, _protocolVersion.minor]; } -- (void)setBodyFromString: (OFString*)string +- (void)setBodyFromString: (OFString *)string { [self setBodyFromString: string encoding: OF_STRING_ENCODING_UTF_8]; } -- (void)setBodyFromString: (OFString*)string +- (void)setBodyFromString: (OFString *)string encoding: (of_string_encoding_t)encoding { void *pool = objc_autoreleasePoolPush(); OFDataArray *body = [OFDataArray dataArray]; @@ -250,11 +250,11 @@ [self setBody: body]; objc_autoreleasePoolPop(pool); } -- (OFString*)description +- (OFString *)description { void *pool = objc_autoreleasePoolPush(); const char *method = of_http_request_method_to_string(_method); OFString *indentedHeaders, *indentedBody, *ret; Index: src/OFHTTPResponse.h ================================================================== --- src/OFHTTPResponse.h +++ src/OFHTTPResponse.h @@ -30,12 +30,12 @@ */ @interface OFHTTPResponse: OFStream { of_http_request_protocol_version_t _protocolVersion; short _statusCode; - OFDictionary OF_GENERIC(OFString*, OFString*) *_headers; - OFArray OF_GENERIC(OFHTTPCookie*) *_cookies; + OFDictionary OF_GENERIC(OFString *, OFString *) *_headers; + OFArray OF_GENERIC(OFHTTPCookie *) *_cookies; } /*! * The status code of the reply to the HTTP request. */ @@ -43,17 +43,17 @@ /*! * The headers of the reply to the HTTP request. */ @property OF_NULLABLE_PROPERTY (nonatomic, copy) - OFDictionary OF_GENERIC(OFString*, OFString*) *headers; + OFDictionary OF_GENERIC(OFString *, OFString *) *headers; /*! * The cookies to set of the reply to the HTTP request. */ @property OF_NULLABLE_PROPERTY (nonatomic, copy) - OFArray OF_GENERIC(OFHTTPCookie*) *cookies; + OFArray OF_GENERIC(OFHTTPCookie *) *cookies; /*! * @brief Sets the protocol version of the HTTP request reply. * * @param protocolVersion The protocol version of the HTTP request reply @@ -71,31 +71,31 @@ * @brief Sets the protocol version of the HTTP request reply to the version * described by the specified string. * * @param string A string describing an HTTP version */ -- (void)setProtocolVersionFromString: (OFString*)string; +- (void)setProtocolVersionFromString: (OFString *)string; /*! * @brief Returns the protocol version of the HTTP request reply as a string. * * @return The protocol version of the HTTP request reply as a string */ -- (OFString*)protocolVersionString; +- (OFString *)protocolVersionString; /*! * @brief Returns the reply as a string, trying to detect the encoding. * * @return The reply as a string */ -- (OFString*)string; +- (OFString *)string; /*! * @brief Returns the reply as a string, trying to detect the encoding and * falling back to the specified encoding if not detectable. * * @return The reply as a string */ -- (OFString*)stringWithEncoding: (of_string_encoding_t)encoding; +- (OFString *)stringWithEncoding: (of_string_encoding_t)encoding; @end OF_ASSUME_NONNULL_END Index: src/OFHTTPResponse.m ================================================================== --- src/OFHTTPResponse.m +++ src/OFHTTPResponse.m @@ -168,11 +168,11 @@ - (of_http_request_protocol_version_t)protocolVersion { return _protocolVersion; } -- (void)setProtocolVersionFromString: (OFString*)string +- (void)setProtocolVersionFromString: (OFString *)string { void *pool = objc_autoreleasePoolPush(); OFArray *components = [string componentsSeparatedByString: @"."]; intmax_t major, minor; of_http_request_protocol_version_t protocolVersion; @@ -192,23 +192,23 @@ [self setProtocolVersion: protocolVersion]; objc_autoreleasePoolPop(pool); } -- (OFString*)protocolVersionString +- (OFString *)protocolVersionString { return [OFString stringWithFormat: @"%u.%u", _protocolVersion.major, _protocolVersion.minor]; } -- (OFString*)string +- (OFString *)string { return [self stringWithEncoding: OF_STRING_ENCODING_AUTODETECT]; } -- (OFString*)stringWithEncoding: (of_string_encoding_t)encoding +- (OFString *)stringWithEncoding: (of_string_encoding_t)encoding { void *pool = objc_autoreleasePoolPush(); OFString *contentType, *contentLength, *ret; OFDataArray *data; @@ -223,20 +223,20 @@ if ((contentLength = [_headers objectForKey: @"Content-Length"]) != nil) if ([data count] != (size_t)[contentLength decimalValue]) @throw [OFTruncatedDataException exception]; - ret = [[OFString alloc] initWithCString: (char*)[data items] + ret = [[OFString alloc] initWithCString: (char *)[data items] encoding: encoding length: [data count]]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } -- (OFString*)description +- (OFString *)description { void *pool = objc_autoreleasePoolPush(); OFString *indentedHeaders, *ret; indentedHeaders = [[_headers description] Index: src/OFHTTPServer.h ================================================================== --- src/OFHTTPServer.h +++ src/OFHTTPServer.h @@ -40,13 +40,13 @@ * * @param server The HTTP server which received the request * @param request The request the HTTP server received * @param response The response the server will send to the client */ -- (void)server: (OFHTTPServer*)server - didReceiveRequest: (OFHTTPRequest*)request - response: (OFHTTPResponse*)response; +- (void)server: (OFHTTPServer *)server + didReceiveRequest: (OFHTTPRequest *)request + response: (OFHTTPResponse *)response; @optional /*! * @brief This method is called when the HTTP server's listening socket * encountered an exception. @@ -56,12 +56,12 @@ * socket * @return Whether to continue listening. If you return false, existing * connections will still be handled and you can start accepting new * connections again by calling @ref OFHTTPServer::start again. */ -- (bool)server: (OFHTTPServer*)server - didReceiveExceptionOnListeningSocket: (OFException*)exception; +- (bool)server: (OFHTTPServer *)server + didReceiveExceptionOnListeningSocket: (OFException *)exception; /*! * @brief This method is called when a client socket encountered an exception. * * This can happen when the OFHTTPServer tries to properly close the @@ -73,14 +73,14 @@ * @param server The HTTP server which encountered an exception * @param response The response for which the exception occurred * @param request The request for the response for which the exception occurred * @param exception The exception which occurred */ -- (void)server: (OFHTTPServer*)server - didReceiveExceptionForResponse: (OFHTTPResponse*)response - request: (OFHTTPRequest*)request - exception: (OFException*)exception; +- (void)server: (OFHTTPServer *)server + didReceiveExceptionForResponse: (OFHTTPResponse *)response + request: (OFHTTPRequest *)request + exception: (OFException *)exception; @end /*! * @class OFHTTPServer OFHTTPServer.h ObjFW/OFHTTPServer.h * @@ -96,11 +96,11 @@ } /*! * The host on which the HTTP server will listen. */ -@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString* host; +@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *host; /*! * The port on which the HTTP server will listen. */ @property uint16_t port; Index: src/OFHTTPServer.m ================================================================== --- src/OFHTTPServer.m +++ src/OFHTTPServer.m @@ -45,16 +45,16 @@ * FIXME: Key normalization replaces headers like "DNT" with "Dnt". * FIXME: Errors are not reported to the user. */ @interface OFHTTPServer () -- (bool)OF_socket: (OFTCPSocket*)socket - didAcceptSocket: (OFTCPSocket*)clientSocket - exception: (OFException*)exception; +- (bool)OF_socket: (OFTCPSocket *)socket + didAcceptSocket: (OFTCPSocket *)clientSocket + exception: (OFException *)exception; @end -static const char* +static const char * statusCodeToString(short code) { switch (code) { case 100: return "Continue"; @@ -139,15 +139,15 @@ default: return NULL; } } -static OF_INLINE OFString* +static OF_INLINE OFString * normalizedKey(OFString *key) { char *cString = of_strdup([key UTF8String]); - unsigned char *tmp = (unsigned char*)cString; + unsigned char *tmp = (unsigned char *)cString; bool firstLetter = true; if (cString == NULL) @throw [OFOutOfMemoryException exceptionWithRequestedSize: strlen([key UTF8String])]; @@ -177,19 +177,19 @@ OFHTTPServer *_server; OFHTTPRequest *_request; bool _chunked, _headersSent; } -- initWithSocket: (OFTCPSocket*)socket - server: (OFHTTPServer*)server - request: (OFHTTPRequest*)request; +- initWithSocket: (OFTCPSocket *)socket + server: (OFHTTPServer *)server + request: (OFHTTPRequest *)request; @end @implementation OFHTTPServerResponse -- initWithSocket: (OFTCPSocket*)socket - server: (OFHTTPServer*)server - request: (OFHTTPRequest*)request +- initWithSocket: (OFTCPSocket *)socket + server: (OFHTTPServer *)server + request: (OFHTTPRequest *)request { self = [super init]; _statusCode = 500; _socket = [socket retain]; @@ -211,11 +211,11 @@ } - (void)OF_sendHeaders { void *pool = objc_autoreleasePoolPush(); - OFMutableDictionary OF_GENERIC(OFString*, OFString*) *headers; + OFMutableDictionary OF_GENERIC(OFString *, OFString *) *headers; OFEnumerator *keyEnumerator, *valueEnumerator; OFString *key, *value; [_socket writeFormat: @"HTTP/%@ %d %s\r\n", [self protocolVersionString], _statusCode, @@ -252,11 +252,11 @@ isEqual: @"chunked"]; objc_autoreleasePoolPop(pool); } -- (void)lowlevelWriteBuffer: (const void*)buffer +- (void)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { void *pool; if (_socket == nil) @@ -336,28 +336,28 @@ OFMutableDictionary *_headers; size_t _contentLength; OFDataArray *_body; } -- initWithSocket: (OFTCPSocket*)socket - server: (OFHTTPServer*)server; -- (bool)socket: (OFTCPSocket*)socket - didReadLine: (OFString*)line - exception: (OFException*)exception; -- (bool)parseProlog: (OFString*)line; -- (bool)parseHeaders: (OFString*)line; -- (bool)socket: (OFTCPSocket*)socket - didReadIntoBuffer: (char*)buffer +- initWithSocket: (OFTCPSocket *)socket + server: (OFHTTPServer *)server; +- (bool)socket: (OFTCPSocket *)socket + didReadLine: (OFString *)line + exception: (OFException *)exception; +- (bool)parseProlog: (OFString *)line; +- (bool)parseHeaders: (OFString *)line; +- (bool)socket: (OFTCPSocket *)socket + didReadIntoBuffer: (char *)buffer length: (size_t)length - exception: (OFException*)exception; + exception: (OFException *)exception; - (bool)sendErrorAndClose: (short)statusCode; - (void)createResponse; @end @implementation OFHTTPServer_Connection -- initWithSocket: (OFTCPSocket*)socket - server: (OFHTTPServer*)server +- initWithSocket: (OFTCPSocket *)socket + server: (OFHTTPServer *)server { self = [super init]; @try { _socket = [socket retain]; @@ -391,13 +391,13 @@ [_body release]; [super dealloc]; } -- (bool)socket: (OFTCPSocket*)socket - didReadLine: (OFString*)line - exception: (OFException*)exception +- (bool)socket: (OFTCPSocket *)socket + didReadLine: (OFString *)line + exception: (OFException *)exception { if (line == nil || exception != nil) return false; @try { @@ -422,11 +422,11 @@ } OF_ENSURE(0); } -- (bool)parseProlog: (OFString*)line +- (bool)parseProlog: (OFString *)line { OFString *method; OFMutableString *path; size_t pos; @@ -481,11 +481,11 @@ _state = PARSING_HEADERS; return true; } -- (bool)parseHeaders: (OFString*)line +- (bool)parseHeaders: (OFString *)line { OFString *key, *value, *old; size_t pos; if ([line length] == 0) { @@ -569,14 +569,14 @@ } return true; } -- (bool)socket: (OFTCPSocket*)socket - didReadIntoBuffer: (char*)buffer +- (bool)socket: (OFTCPSocket *)socket + didReadIntoBuffer: (char *)buffer length: (size_t)length - exception: (OFException*)exception + exception: (OFException *)exception { if ([socket isAtEndOfStream] || exception != nil) return false; [_body addItems: buffer @@ -729,13 +729,13 @@ [_listeningSocket cancelAsyncRequests]; [_listeningSocket release]; _listeningSocket = nil; } -- (bool)OF_socket: (OFTCPSocket*)socket - didAcceptSocket: (OFTCPSocket*)clientSocket - exception: (OFException*)exception +- (bool)OF_socket: (OFTCPSocket *)socket + didAcceptSocket: (OFTCPSocket *)clientSocket + exception: (OFException *)exception { OFHTTPServer_Connection *connection; if (exception != nil) { if ([_delegate respondsToSelector: Index: src/OFINICategory+Private.h ================================================================== --- src/OFINICategory+Private.h +++ src/OFINICategory+Private.h @@ -21,12 +21,12 @@ @class OFStream; @interface OFINICategory () - (instancetype)OF_init; -- (void)OF_parseLine: (OFString*)line; -- (bool)OF_writeToStream: (OFStream*)stream +- (void)OF_parseLine: (OFString *)line; +- (bool)OF_writeToStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding first: (bool)first; @end OF_ASSUME_NONNULL_END Index: src/OFINICategory.h ================================================================== --- src/OFINICategory.h +++ src/OFINICategory.h @@ -48,11 +48,11 @@ * the first key/value pair found is returned. * * @param key The key for which the string value should be returned * @return The string value for the specified key, or `nil` if it does not exist */ -- (nullable OFString*)stringForKey: (OFString*)key; +- (nullable OFString *)stringForKey: (OFString *)key; /*! * @brief Returns the string value for the specified key or the specified * default value if it does not exist. * @@ -62,12 +62,12 @@ * @param key The key for which the string value should be returned * @param defaultValue The value to return if the key does not exist * @return The string value for the specified key or the specified default * value if it does not exist */ -- (nullable OFString*)stringForKey: (OFString*)key - defaultValue: (nullable OFString*)defaultValue; +- (nullable OFString *)stringForKey: (OFString *)key + defaultValue: (nullable OFString *)defaultValue; /*! * @brief Returns the integer value for the specified key or the specified * default value if it does not exist. * @@ -77,11 +77,11 @@ * @param key The key for which the integer value should be returned * @param defaultValue The value to return if the key does not exist * @return The integer value for the specified key or the specified default * value if it does not exist */ -- (intmax_t)integerForKey: (OFString*)key +- (intmax_t)integerForKey: (OFString *)key defaultValue: (intmax_t)defaultValue; /*! * @brief Returns the bool value for the specified key or the specified default * value if it does not exist. @@ -92,11 +92,11 @@ * @param key The key for which the bool value should be returned * @param defaultValue The value to return if the key does not exist * @return The bool value for the specified key or the specified default value * if it does not exist */ -- (bool)boolForKey: (OFString*)key +- (bool)boolForKey: (OFString *)key defaultValue: (bool)defaultValue; /*! * @brief Returns the float value for the specified key or the specified * default value if it does not exist. @@ -107,11 +107,11 @@ * @param key The key for which the float value should be returned * @param defaultValue The value to return if the key does not exist * @return The float value for the specified key or the specified default value * if it does not exist */ -- (float)floatForKey: (OFString*)key +- (float)floatForKey: (OFString *)key defaultValue: (float)defaultValue; /*! * @brief Returns the double value for the specified key or the specified * default value if it does not exist. @@ -122,11 +122,11 @@ * @param key The key for which the double value should be returned * @param defaultValue The value to return if the key does not exist * @return The double value for the specified key or the specified default * value if it does not exist */ -- (double)doubleForKey: (OFString*)key +- (double)doubleForKey: (OFString *)key defaultValue: (double)defaultValue; /*! * @brief Returns an array of string values for the specified multi-key, or an * empty array if the key does not exist. @@ -136,11 +136,11 @@ * * @param key The multi-key for which the array should be returned * @return The array for the specified key, or an empty array if it does not * exist */ -- (OFArray OF_GENERIC(OFString*)*)arrayForKey: (OFString*)key; +- (OFArray OF_GENERIC(OFString *) *)arrayForKey: (OFString *)key; /*! * @brief Sets the value of the specified key to the specified string. * * If the specified key is a multi-key (see @ref arrayForKey:), the value of @@ -147,12 +147,12 @@ * the first key/value pair found is changed. * * @param string The string to which the value of the key should be set * @param key The key for which the new value should be set */ -- (void)setString: (OFString*)string - forKey: (OFString*)key; +- (void)setString: (OFString *)string + forKey: (OFString *)key; /*! * @brief Sets the value of the specified key to the specified integer. * * If the specified key is a multi-key (see @ref arrayForKey:), the value of @@ -160,11 +160,11 @@ * * @param integer The integer to which the value of the key should be set * @param key The key for which the new value should be set */ - (void)setInteger: (intmax_t)integer - forKey: (OFString*)key; + forKey: (OFString *)key; /*! * @brief Sets the value of the specified key to the specified bool. * * If the specified key is a multi-key (see @ref arrayForKey:), the value of @@ -172,11 +172,11 @@ * * @param bool_ The bool to which the value of the key should be set * @param key The key for which the new value should be set */ - (void)setBool: (bool)bool_ - forKey: (OFString*)key; + forKey: (OFString *)key; /*! * @brief Sets the value of the specified key to the specified float. * * If the specified key is a multi-key (see @ref arrayForKey:), the value of @@ -184,11 +184,11 @@ * * @param float_ The float to which the value of the key should be set * @param key The key for which the new value should be set */ - (void)setFloat: (float)float_ - forKey: (OFString*)key; + forKey: (OFString *)key; /*! * @brief Sets the value of the specified key to the specified double. * * If the specified key is a multi-key (see @ref arrayForKey:), the value of @@ -196,11 +196,11 @@ * * @param double_ The double to which the value of the key should be set * @param key The key for which the new value should be set */ - (void)setDouble: (double)double_ - forKey: (OFString*)key; + forKey: (OFString *)key; /*! * @brief Sets the specified multi-key to the specified array of strings. * * It replaces the first occurrence of the multi-key with several key/value @@ -210,20 +210,20 @@ * See also @ref arrayForKey: for more information about multi-keys. * * @param array The array of strings to which the multi-key should be set * @param key The multi-key for which the new values should be set */ -- (void)setArray: (OFArray OF_GENERIC(OFString*)*)array - forKey: (OFString*)key; +- (void)setArray: (OFArray OF_GENERIC(OFString *) *)array + forKey: (OFString *)key; /*! * @brief Removes the value for the specified key * * If the specified key is a multi-key (see @ref arrayForKey:), all key/value * pairs matching the specified key are removed. * * @param key The key of the value to remove */ -- (void)removeValueForKey: (OFString*)key; +- (void)removeValueForKey: (OFString *)key; @end OF_ASSUME_NONNULL_END Index: src/OFINICategory.m ================================================================== --- src/OFINICategory.m +++ src/OFINICategory.m @@ -37,11 +37,11 @@ @public OFString *_comment; } @end -static OFString* +static OFString * escapeString(OFString *string) { OFMutableString *mutableString; /* FIXME: Optimize */ @@ -70,11 +70,11 @@ [mutableString makeImmutable]; return mutableString; } -static OFString* +static OFString * unescapeString(OFString *string) { OFMutableString *mutableString; if (![string hasPrefix: @"\""] || ![string hasSuffix: @"\""]) @@ -146,11 +146,11 @@ [_lines release]; [super dealloc]; } -- (void)OF_parseLine: (OFString*)line +- (void)OF_parseLine: (OFString *)line { if (![line hasPrefix: @";"]) { OFINICategory_Pair *pair = [[[OFINICategory_Pair alloc] init] autorelease]; OFString *key, *value; @@ -181,18 +181,18 @@ [_lines addObject: comment]; } } -- (OFString*)stringForKey: (OFString*)key +- (OFString *)stringForKey: (OFString *)key { return [self stringForKey: key defaultValue: nil]; } -- (OFString*)stringForKey: (OFString*)key - defaultValue: (OFString*)defaultValue +- (OFString *)stringForKey: (OFString *)key + defaultValue: (OFString *)defaultValue { for (id line in _lines) { OFINICategory_Pair *pair; if (![line isKindOfClass: [OFINICategory_Pair class]]) @@ -205,11 +205,11 @@ } return defaultValue; } -- (intmax_t)integerForKey: (OFString*)key +- (intmax_t)integerForKey: (OFString *)key defaultValue: (intmax_t)defaultValue { void *pool = objc_autoreleasePoolPush(); OFString *value = [self stringForKey: key defaultValue: nil]; @@ -226,11 +226,11 @@ objc_autoreleasePoolPop(pool); return ret; } -- (bool)boolForKey: (OFString*)key +- (bool)boolForKey: (OFString *)key defaultValue: (bool)defaultValue { void *pool = objc_autoreleasePoolPush(); OFString *value = [self stringForKey: key defaultValue: nil]; @@ -249,11 +249,11 @@ objc_autoreleasePoolPop(pool); return ret; } -- (float)floatForKey: (OFString*)key +- (float)floatForKey: (OFString *)key defaultValue: (float)defaultValue { void *pool = objc_autoreleasePoolPush(); OFString *value = [self stringForKey: key defaultValue: nil]; @@ -267,11 +267,11 @@ objc_autoreleasePoolPop(pool); return ret; } -- (double)doubleForKey: (OFString*)key +- (double)doubleForKey: (OFString *)key defaultValue: (double)defaultValue { void *pool = objc_autoreleasePoolPush(); OFString *value = [self stringForKey: key defaultValue: nil]; @@ -285,11 +285,11 @@ objc_autoreleasePoolPop(pool); return ret; } -- (OFArray*)arrayForKey: (OFString*)key +- (OFArray *)arrayForKey: (OFString *)key { OFMutableArray *ret = [OFMutableArray array]; void *pool = objc_autoreleasePoolPush(); for (id line in _lines) { @@ -309,12 +309,12 @@ [ret makeImmutable]; return ret; } -- (void)setString: (OFString*)string - forKey: (OFString*)key +- (void)setString: (OFString *)string + forKey: (OFString *)key { void *pool = objc_autoreleasePoolPush(); OFINICategory_Pair *pair; for (id line in _lines) { @@ -351,11 +351,11 @@ objc_autoreleasePoolPop(pool); } - (void)setInteger: (intmax_t)integer - forKey: (OFString*)key + forKey: (OFString *)key { void *pool = objc_autoreleasePoolPush(); [self setString: [OFString stringWithFormat: @"%jd", integer] forKey: key]; @@ -362,18 +362,18 @@ objc_autoreleasePoolPop(pool); } - (void)setBool: (bool)bool_ - forKey: (OFString*)key + forKey: (OFString *)key { [self setString: (bool_ ? @"true" : @"false") forKey: key]; } - (void)setFloat: (float)float_ - forKey: (OFString*)key + forKey: (OFString *)key { void *pool = objc_autoreleasePoolPush(); [self setString: [OFString stringWithFormat: @"%g", float_] forKey: key]; @@ -380,22 +380,22 @@ objc_autoreleasePoolPop(pool); } - (void)setDouble: (double)double_ - forKey: (OFString*)key + forKey: (OFString *)key { void *pool = objc_autoreleasePoolPush(); [self setString: [OFString stringWithFormat: @"%g", double_] forKey: key]; objc_autoreleasePoolPop(pool); } -- (void)setArray: (OFArray*)array - forKey: (OFString*)key +- (void)setArray: (OFArray *)array + forKey: (OFString *)key { void *pool; OFMutableArray *pairs; id const *lines; size_t count; @@ -459,11 +459,11 @@ [_lines addObjectsFromArray: pairs]; objc_autoreleasePoolPop(pool); } -- (void)removeValueForKey: (OFString*)key +- (void)removeValueForKey: (OFString *)key { void *pool = objc_autoreleasePoolPush(); id const *lines = [_lines objects]; size_t count = [_lines count]; @@ -487,11 +487,11 @@ } objc_autoreleasePoolPop(pool); } -- (bool)OF_writeToStream: (OFStream*)stream +- (bool)OF_writeToStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding first: (bool)first { if ([_lines count] == 0) return false; Index: src/OFINIFile.h ================================================================== --- src/OFINIFile.h +++ src/OFINIFile.h @@ -27,21 +27,21 @@ * * @brief A class for reading, creating and modifying INI files. */ @interface OFINIFile: OFObject { - OFMutableArray OF_GENERIC(OFINICategory*) *_categories; + OFMutableArray OF_GENERIC(OFINICategory *) *_categories; } /*! * @brief Creates a new OFINIFile with the contents of the specified file. * * @param path The path to the file whose contents the OFINIFile should contain * * @return A new, autoreleased OFINIFile with the contents of the specified file */ -+ (instancetype)fileWithPath: (OFString*)path; ++ (instancetype)fileWithPath: (OFString *)path; /*! * @brief Creates a new OFINIFile with the contents of the specified file in * the specified encoding. * @@ -48,11 +48,11 @@ * @param path The path to the file whose contents the OFINIFile should contain * @param encoding The encoding of the specified file * * @return A new, autoreleased OFINIFile with the contents of the specified file */ -+ (instancetype)fileWithPath: (OFString*)path ++ (instancetype)fileWithPath: (OFString *)path encoding: (of_string_encoding_t)encoding; /*! * @brief Initializes an already allocated OFINIFile with the contents of the * specified file. @@ -59,11 +59,11 @@ * * @param path The path to the file whose contents the OFINIFile should contain * * @return An initialized OFINIFile with the contents of the specified file */ -- initWithPath: (OFString*)path; +- initWithPath: (OFString *)path; /*! * @brief Initializes an already allocated OFINIFile with the contents of the * specified file in the specified encoding. * @@ -70,11 +70,11 @@ * @param path The path to the file whose contents the OFINIFile should contain * @param encoding The encoding of the specified file * * @return An initialized OFINIFile with the contents of the specified file */ -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path encoding: (of_string_encoding_t)encoding; /*! * @brief Returns an @ref OFINICategory for the category with the specified * name. @@ -82,26 +82,26 @@ * @param name The name of the category for which an @ref OFINICategory should * be returned * * @return An @ref OFINICategory for the category with the specified name */ -- (OFINICategory*)categoryForName: (OFString*)name; +- (OFINICategory *)categoryForName: (OFString *)name; /*! * @brief Writes the contents of the OFINIFile to a file. * * @param path The path of the file to write to */ -- (void)writeToFile: (OFString*)path; +- (void)writeToFile: (OFString *)path; /*! * @brief Writes the contents of the OFINIFile to a file in the specified * encoding. * * @param path The path of the file to write to * @param encoding The encoding to use */ -- (void)writeToFile: (OFString*)path +- (void)writeToFile: (OFString *)path encoding: (of_string_encoding_t)encoding; @end OF_ASSUME_NONNULL_END Index: src/OFINIFile.m ================================================================== --- src/OFINIFile.m +++ src/OFINIFile.m @@ -27,11 +27,11 @@ #import "OFInvalidFormatException.h" #import "OFOpenItemFailedException.h" @interface OFINIFile () -- (void)OF_parseFile: (OFString*)path +- (void)OF_parseFile: (OFString *)path encoding: (of_string_encoding_t)encoding; @end static bool isWhitespaceLine(OFString *line) @@ -53,16 +53,16 @@ return true; } @implementation OFINIFile -+ (instancetype)fileWithPath: (OFString*)path ++ (instancetype)fileWithPath: (OFString *)path { return [[[self alloc] initWithPath: path] autorelease]; } -+ (instancetype)fileWithPath: (OFString*)path ++ (instancetype)fileWithPath: (OFString *)path encoding: (of_string_encoding_t)encoding { return [[[self alloc] initWithPath: path encoding: encoding] autorelease]; } @@ -70,17 +70,17 @@ - init { OF_INVALID_INIT_METHOD } -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path { return [self initWithPath: path encoding: OF_STRING_ENCODING_UTF_8]; } -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path encoding: (of_string_encoding_t)encoding { self = [super init]; @try { @@ -101,11 +101,11 @@ [_categories release]; [super dealloc]; } -- (OFINICategory*)categoryForName: (OFString*)name +- (OFINICategory *)categoryForName: (OFString *)name { void *pool = objc_autoreleasePoolPush(); OFINICategory *category; for (category in _categories) { @@ -127,11 +127,11 @@ objc_autoreleasePoolPop(pool); return [category autorelease]; } -- (void)OF_parseFile: (OFString*)path +- (void)OF_parseFile: (OFString *)path encoding: (of_string_encoding_t)encoding { void *pool = objc_autoreleasePoolPush(); OFFile *file; OFINICategory *category = nil; @@ -174,17 +174,17 @@ } objc_autoreleasePoolPop(pool); } -- (void)writeToFile: (OFString*)path +- (void)writeToFile: (OFString *)path { [self writeToFile: path encoding: OF_STRING_ENCODING_UTF_8]; } -- (void)writeToFile: (OFString*)path +- (void)writeToFile: (OFString *)path encoding: (of_string_encoding_t)encoding { void *pool = objc_autoreleasePoolPush(); OFFile *file = [OFFile fileWithPath: path mode: @"w"]; Index: src/OFIntrospection.h ================================================================== --- src/OFIntrospection.h +++ src/OFIntrospection.h @@ -145,25 +145,25 @@ * * @brief A class for introspecting classes. */ @interface OFIntrospection: OFObject { - OFMutableArray OF_GENERIC(OFMethod*) *_classMethods; - OFMutableArray OF_GENERIC(OFMethod*) *_instanceMethods; - OFMutableArray OF_GENERIC(OFProperty*) *_properties; - OFMutableArray OF_GENERIC(OFInstanceVariable*) *_instanceVariables; + OFMutableArray OF_GENERIC(OFMethod *) *_classMethods; + OFMutableArray OF_GENERIC(OFMethod *) *_instanceMethods; + OFMutableArray OF_GENERIC(OFProperty *) *_properties; + OFMutableArray OF_GENERIC(OFInstanceVariable *) *_instanceVariables; } /*! * The class methods of the class. */ -@property (readonly, nonatomic) OFArray OF_GENERIC(OFMethod*) *classMethods; +@property (readonly, nonatomic) OFArray OF_GENERIC(OFMethod *) *classMethods; /*! * The instance methods of the class. */ -@property (readonly, nonatomic) OFArray OF_GENERIC(OFMethod*) *instanceMethods; +@property (readonly, nonatomic) OFArray OF_GENERIC(OFMethod *) *instanceMethods; /*! * The properties of the class. * * @warning **Do not rely on this, as this behaves differently depending on the @@ -181,17 +181,17 @@ * used. * * @warning GCC does not emit any data for property introspection for the GNU * ABI. */ -@property (readonly, nonatomic) OFArray OF_GENERIC(OFProperty*) *properties; +@property (readonly, nonatomic) OFArray OF_GENERIC(OFProperty *) *properties; /*! * The instance variables of the class. */ @property (readonly, nonatomic) - OFArray OF_GENERIC(OFInstanceVariable*) *instanceVariables; + OFArray OF_GENERIC(OFInstanceVariable *) *instanceVariables; /* TODO: protocols */ /*! * @brief Creates a new introspection for the specified class. Index: src/OFIntrospection.m ================================================================== --- src/OFIntrospection.m +++ src/OFIntrospection.m @@ -26,11 +26,11 @@ @implementation OFMethod @synthesize selector = _selector, name = _name, typeEncoding = _typeEncoding; #if defined(OF_OBJFW_RUNTIME) -- (instancetype)OF_initWithMethod: (struct objc_method*)method +- (instancetype)OF_initWithMethod: (struct objc_method *)method { self = [super init]; @try { _selector = (SEL)&method->sel; @@ -75,11 +75,11 @@ [_name release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"<%@: %@ [%s]>", [self class], _name, _typeEncoding]; } @@ -133,11 +133,11 @@ @implementation OFProperty @synthesize name = _name, attributes = _attributes; @synthesize getter = _getter, setter = _setter; #if defined(OF_OBJFW_RUNTIME) -- (instancetype)OF_initWithProperty: (struct objc_property*)property +- (instancetype)OF_initWithProperty: (struct objc_property *)property { self = [super init]; @try { _name = [[OFString alloc] initWithUTF8String: property->name]; @@ -299,11 +299,11 @@ [_setter release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"<%@: %@\n" @"\tAttributes = 0x%03X\n" @"\tGetter = %@\n" @@ -354,11 +354,11 @@ @implementation OFInstanceVariable @synthesize name = _name, offset = _offset, typeEncoding = _typeEncoding; #if defined(OF_OBJFW_RUNTIME) -- (instancetype)OF_initWithIvar: (struct objc_ivar*)ivar +- (instancetype)OF_initWithIvar: (struct objc_ivar *)ivar { self = [super init]; @try { _name = [[OFString alloc] initWithUTF8String: ivar->name]; @@ -402,11 +402,11 @@ [_name release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"", _name, _typeEncoding, _offset]; } Index: src/OFJSONRepresentation.h ================================================================== --- src/OFJSONRepresentation.h +++ src/OFJSONRepresentation.h @@ -39,11 +39,11 @@ /*! * @brief Returns the JSON representation of the object as a string. * * @return The JSON representation of the object as a string */ -- (OFString*)JSONRepresentation; +- (OFString *)JSONRepresentation; /*! * @brief Returns the JSON representation of the object as a string. * * @param options The options to use when creating a JSON representation.@n @@ -53,9 +53,9 @@ * `OF_JSON_REPRESENTATION_PRETTY` | Optimize for readability * `OF_JSON_REPRESENTATION_JSON5` | Generate JSON5 * * @return The JSON representation of the object as a string */ -- (OFString*)JSONRepresentationWithOptions: (int)options; +- (OFString *)JSONRepresentationWithOptions: (int)options; @end OF_ASSUME_NONNULL_END Index: src/OFKernelEventObserver.h ================================================================== --- src/OFKernelEventObserver.h +++ src/OFKernelEventObserver.h @@ -198,11 +198,11 @@ * @brief Observes all objects until an event happens on an object or the * specified date is reached. * * @param date The until which to observe */ -- (void)observeUntilDate: (OFDate*)date; +- (void)observeUntilDate: (OFDate *)date; /*! * @brief Cancels the currently blocking observe call. * * This is automatically done when a new object is added or removed by another Index: src/OFKernelEventObserver.m ================================================================== --- src/OFKernelEventObserver.m +++ src/OFKernelEventObserver.m @@ -127,18 +127,18 @@ # ifdef OF_WII _cancelAddr.sin_len = 8; # endif # if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) - if (bind(_cancelFD[0], (struct sockaddr*)&_cancelAddr, + if (bind(_cancelFD[0], (struct sockaddr *)&_cancelAddr, sizeof(_cancelAddr)) != 0) @throw [OFInitializationFailedException exceptionWithClass: [self class]]; cancelAddrLen = sizeof(_cancelAddr); - if (of_getsockname(_cancelFD[0], (struct sockaddr*)&_cancelAddr, - &cancelAddrLen) != 0) + if (of_getsockname(_cancelFD[0], + (struct sockaddr *)&_cancelAddr, &cancelAddrLen) != 0) @throw [OFInitializationFailedException exceptionWithClass: [self class]]; # else for (;;) { uint16_t rnd = 0; @@ -146,11 +146,12 @@ while (rnd < 1024) rnd = (uint16_t)rand(); _cancelAddr.sin_port = OF_BSWAP16_IF_LE(rnd); - ret = bind(_cancelFD[0], (struct sockaddr*)&_cancelAddr, + ret = bind(_cancelFD[0], + (struct sockaddr *)&_cancelAddr, sizeof(_cancelAddr)); if (ret == 0) break; @@ -399,11 +400,11 @@ - (void)observeForTimeInterval: (of_time_interval_t)timeInterval { OF_UNRECOGNIZED_SELECTOR } -- (void)observeUntilDate: (OFDate*)date +- (void)observeUntilDate: (OFDate *)date { [self observeForTimeInterval: [date timeIntervalSinceNow]]; } - (void)cancel @@ -411,13 +412,13 @@ #ifdef OF_HAVE_PIPE OF_ENSURE(write(_cancelFD[1], "", 1) > 0); #else # ifndef OF_WII OF_ENSURE(sendto(_cancelFD[1], "", 1, 0, - (struct sockaddr*)&_cancelAddr, sizeof(_cancelAddr)) > 0); + (struct sockaddr *)&_cancelAddr, sizeof(_cancelAddr)) > 0); # else OF_ENSURE(sendto(_cancelFD[1], "", 1, 0, - (struct sockaddr*)&_cancelAddr, 8) > 0); + (struct sockaddr *)&_cancelAddr, 8) > 0); # endif #endif } @end Index: src/OFKernelEventObserver_epoll.m ================================================================== --- src/OFKernelEventObserver_epoll.m +++ src/OFKernelEventObserver_epoll.m @@ -98,11 +98,11 @@ { struct epoll_event event; intptr_t events; events = (intptr_t)[_FDToEvents - objectForKey: (void*)((intptr_t)fd + 1)]; + objectForKey: (void *)((intptr_t)fd + 1)]; memset(&event, 0, sizeof(event)); event.events = (int)events | addEvents; event.data.ptr = object; @@ -109,31 +109,31 @@ if (epoll_ctl(_epfd, (events == 0 ? EPOLL_CTL_ADD : EPOLL_CTL_MOD), fd, &event) == -1) @throw [OFObserveFailedException exceptionWithObserver: self errNo: errno]; - [_FDToEvents setObject: (void*)(events | addEvents) - forKey: (void*)((intptr_t)fd + 1)]; + [_FDToEvents setObject: (void *)(events | addEvents) + forKey: (void *)((intptr_t)fd + 1)]; } - (void)OF_removeObject: (id)object fileDescriptor: (int)fd events: (int)removeEvents { intptr_t events; events = (intptr_t)[_FDToEvents - objectForKey: (void*)((intptr_t)fd + 1)]; + objectForKey: (void *)((intptr_t)fd + 1)]; events &= ~removeEvents; if (events == 0) { if (epoll_ctl(_epfd, EPOLL_CTL_DEL, fd, NULL) == -1) @throw [OFObserveFailedException exceptionWithObserver: self errNo: errno]; - [_FDToEvents removeObjectForKey: (void*)((intptr_t)fd + 1)]; + [_FDToEvents removeObjectForKey: (void *)((intptr_t)fd + 1)]; } else { struct epoll_event event; memset(&event, 0, sizeof(event)); event.events = (int)events; @@ -142,12 +142,12 @@ if (epoll_ctl(_epfd, EPOLL_CTL_MOD, fd, &event) == -1) @throw [OFObserveFailedException exceptionWithObserver: self errNo: errno]; - [_FDToEvents setObject: (void*)events - forKey: (void*)((intptr_t)fd + 1)]; + [_FDToEvents setObject: (void *)events + forKey: (void *)((intptr_t)fd + 1)]; } } - (void)OF_addObjectForReading: (id )object { Index: src/OFKeyValueCoding.h ================================================================== --- src/OFKeyValueCoding.h +++ src/OFKeyValueCoding.h @@ -33,11 +33,11 @@ * @brief Returns the value for the specified key * * @param key The key of the value to return * @return The value for the specified key */ -- (nullable id)valueForKey: (OFString*)key; +- (nullable id)valueForKey: (OFString *)key; /*! * @brief This is called by @ref valueForKey: if the specified key does not * exist. * @@ -44,20 +44,20 @@ * By default, this throws an @ref OFUndefinedKeyException. * * @param key The undefined key of the value to return * @return The value for the specified undefined key */ -- (nullable id)valueForUndefinedKey: (OFString*)key; +- (nullable id)valueForUndefinedKey: (OFString *)key; /*! * @brief Set the value for the specified key * * @param value The value for the specified key * @param key The key of the value to set */ - (void)setValue: (nullable id)value - forKey: (OFString*)key; + forKey: (OFString *)key; /*! * @brief This is called by @ref setValue:forKey: if the specified key does not * exist. * @@ -65,19 +65,19 @@ * * @param value The value for the specified undefined key * @param key The undefined key of the value to set */ - (void)setValue: (nullable id)value - forUndefinedKey: (OFString*)key; + forUndefinedKey: (OFString *)key; /*! * @brief This is called by @ref setValue:forKey: if the specified key is a * scalar, but the value specified is `nil`. * * By default, this throws an @ref OFInvalidArgumentException. * * @param key The key for which the value `nil` was specified */ -- (void)setNilValueForKey: (OFString*)key; +- (void)setNilValueForKey: (OFString *)key; @end OF_ASSUME_NONNULL_END Index: src/OFList.h ================================================================== --- src/OFList.h +++ src/OFList.h @@ -43,11 +43,11 @@ * @class OFList OFList.h ObjFW/OFList.h * * @brief A class which provides easy to use double-linked lists. */ #ifdef OF_HAVE_GENERICS -@interface OFList : +@interface OFList: #else # ifndef DOXYGEN # define ObjectType id # endif @interface OFList: @@ -83,21 +83,21 @@ * @param object The object to append * @return An of_list_object_t, needed to identify the object inside the list. * For example, if you want to remove an object from the list, you need * its of_list_object_t. */ -- (of_list_object_t*)appendObject: (ObjectType)object; +- (of_list_object_t *)appendObject: (ObjectType)object; /*! * @brief Prepends an object to the list. * * @param object The object to prepend * @return An of_list_object_t, needed to identify the object inside the list. * For example, if you want to remove an object from the list, you need * its of_list_object_t. */ -- (of_list_object_t*)prependObject: (ObjectType)object; +- (of_list_object_t *)prependObject: (ObjectType)object; /*! * @brief Inserts an object before another list object. * * @param object The object to insert @@ -105,12 +105,12 @@ * be inserted * @return An of_list_object_t, needed to identify the object inside the list. * For example, if you want to remove an object from the list, you need * its of_list_object_t. */ -- (of_list_object_t*)insertObject: (ObjectType)object - beforeListObject: (of_list_object_t*)listObject; +- (of_list_object_t *)insertObject: (ObjectType)object + beforeListObject: (of_list_object_t *)listObject; /*! * @brief Inserts an object after another list object. * * @param object The object to insert @@ -118,19 +118,19 @@ * inserted * @return An of_list_object_t, needed to identify the object inside the list. * For example, if you want to remove an object from the list, you need * its of_list_object_t. */ -- (of_list_object_t*)insertObject: (ObjectType)object - afterListObject: (of_list_object_t*)listObject; +- (of_list_object_t *)insertObject: (ObjectType)object + afterListObject: (of_list_object_t *)listObject; /*! * @brief Removes the object with the specified list object from the list. * * @param listObject The list object returned by append / prepend */ -- (void)removeListObject: (of_list_object_t*)listObject; +- (void)removeListObject: (of_list_object_t *)listObject; /*! * @brief Checks whether the list contains an object equal to the specified * object. * @@ -151,11 +151,11 @@ /*! * @brief Returns an OFEnumerator to enumerate through all objects of the list. * * @returns An OFEnumerator to enumerate through all objects of the list */ -- (OFEnumerator OF_GENERIC(ObjectType)*)objectEnumerator; +- (OFEnumerator OF_GENERIC(ObjectType) *)objectEnumerator; /*! * @brief Returns the first object of the list or `nil`. * * @warning The returned object is *not* retained and autoreleased for @@ -190,10 +190,10 @@ of_list_object_t *_current; unsigned long _mutations; unsigned long *_mutationsPtr; } -- initWithList: (OFList*)list - mutationsPointer: (unsigned long*)mutationsPtr; +- initWithList: (OFList *)list + mutationsPointer: (unsigned long *)mutationsPtr; @end OF_ASSUME_NONNULL_END Index: src/OFList.m ================================================================== --- src/OFList.m +++ src/OFList.m @@ -34,11 +34,11 @@ + (instancetype)list { return [[[self alloc] init] autorelease]; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { self = [self init]; @try { void *pool = objc_autoreleasePoolPush(); @@ -72,11 +72,11 @@ [iter->object release]; [super dealloc]; } -- (of_list_object_t*)appendObject: (id)object +- (of_list_object_t *)appendObject: (id)object { of_list_object_t *listObject; listObject = [self allocMemoryWithSize: sizeof(of_list_object_t)]; listObject->object = [object retain]; @@ -94,11 +94,11 @@ _mutations++; return listObject; } -- (of_list_object_t*)prependObject: (id)object +- (of_list_object_t *)prependObject: (id)object { of_list_object_t *listObject; listObject = [self allocMemoryWithSize: sizeof(of_list_object_t)]; listObject->object = [object retain]; @@ -116,12 +116,12 @@ _mutations++; return listObject; } -- (of_list_object_t*)insertObject: (id)object - beforeListObject: (of_list_object_t*)listObject +- (of_list_object_t *)insertObject: (id)object + beforeListObject: (of_list_object_t *)listObject { of_list_object_t *newListObject; newListObject = [self allocMemoryWithSize: sizeof(of_list_object_t)]; newListObject->object = [object retain]; @@ -140,12 +140,12 @@ _mutations++; return newListObject; } -- (of_list_object_t*)insertObject: (id)object - afterListObject: (of_list_object_t*)listObject +- (of_list_object_t *)insertObject: (id)object + afterListObject: (of_list_object_t *)listObject { of_list_object_t *newListObject; newListObject = [self allocMemoryWithSize: sizeof(of_list_object_t)]; newListObject->object = [object retain]; @@ -164,11 +164,11 @@ _mutations++; return newListObject; } -- (void)removeListObject: (of_list_object_t*)listObject +- (void)removeListObject: (of_list_object_t *)listObject { if (listObject->previous != NULL) listObject->previous->next = listObject->next; if (listObject->next != NULL) listObject->next->previous = listObject->previous; @@ -317,11 +317,11 @@ OF_HASH_FINALIZE(hash); return hash; } -- (OFString*)description +- (OFString *)description { OFMutableString *ret; if (_count == 0) return @"[]"; @@ -346,11 +346,11 @@ [ret makeImmutable]; return ret; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { OFXMLElement *element = [OFXMLElement elementWithName: [self className] namespace: OF_SERIALIZATION_NS]; @@ -364,12 +364,12 @@ } return element; } -- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state - objects: (id*)objects +- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state + objects: (id *)objects count: (int)count { of_list_object_t *listObject; memcpy(&listObject, state->extra, sizeof(listObject)); @@ -393,21 +393,21 @@ memcpy(state->extra, &listObject, sizeof(listObject)); return count; } -- (OFEnumerator*)objectEnumerator +- (OFEnumerator *)objectEnumerator { return [[[OFListEnumerator alloc] initWithList: self mutationsPointer: &_mutations] autorelease]; } @end @implementation OFListEnumerator -- initWithList: (OFList*)list - mutationsPointer: (unsigned long*)mutationsPtr +- initWithList: (OFList *)list + mutationsPointer: (unsigned long *)mutationsPtr { self = [super init]; _list = [list retain]; _current = [list firstListObject]; Index: src/OFLocalization.h ================================================================== --- src/OFLocalization.h +++ src/OFLocalization.h @@ -38,11 +38,11 @@ { OFString *_language; OFString *_territory; of_string_encoding_t _encoding; OFString *_decimalPoint; - OFMutableArray OF_GENERIC(OFDictionary OF_GENERIC(OFString*, id)*) + OFMutableArray OF_GENERIC(OFDictionary OF_GENERIC(OFString *, id) *) *_localizedStrings; } /** * The language of the locale for messages. @@ -89,20 +89,20 @@ * * If the language is unknown, `nil` is returned. * * @return The language of the locale. */ -+ (nullable OFString*)language; ++ (nullable OFString *)language; /*! * @brief Returns the territory of the locale. * * If the territory is unknown, `nil` is returned. * * @return The territory of the locale. */ -+ (nullable OFString*)territory; ++ (nullable OFString *)territory; /*! * @brief Returns the native 8-bit string encoding for the locale. * * This is useful to encode strings correctly for passing them to operating @@ -117,19 +117,19 @@ /*! * @brief Returns the decimal point of the system's locale. * * @return The decimal point of the system's locale */ -+ (OFString*)decimalPoint; ++ (OFString *)decimalPoint; #ifdef OF_HAVE_FILES /*! * @brief Adds a directory to scan for language files. * * @param path The path to the directory to scan for language files */ -+ (void)addLanguageDirectory: (OFString*)path; ++ (void)addLanguageDirectory: (OFString *)path; #endif /*! * @brief Initializes the OFLocalization singleton with the specified locale. * @@ -146,11 +146,11 @@ /*! * @brief Adds a directory to scan for language files. * * @param path The path to the directory to scan for language files */ -- (void)addLanguageDirectory: (OFString*)path; +- (void)addLanguageDirectory: (OFString *)path; #endif /*! * @brief Returns the localized string for the specified ID, using the fallback * string if it cannot be looked up or is missing. @@ -167,12 +167,13 @@ * @param ID The ID for the localized string * @param fallback The fallback to use in case the localized string cannot be * looked up or is missing * @return The localized string */ -- (OFString*)localizedStringForID: (OFConstantString*)ID - fallback: (OFConstantString*)fallback, ... OF_SENTINEL; +- (OFString *)localizedStringForID: (OFConstantString *)ID + fallback: (OFConstantString *)fallback, ... + OF_SENTINEL; /** * @brief Returns the localized string for the specified ID, using the fallback * string if it cannot be looked up or is missing. * @@ -191,11 +192,11 @@ * @param arguments A va_list of arguments, consisting of pairs of variable * names and values to replace in the localized string, * terminated with `nil` * @return The localized string */ -- (OFString*)localizedStringForID: (OFConstantString*)ID - fallback: (OFConstantString*)fallback - arguments: (va_list)arguments; +- (OFString *)localizedStringForID: (OFConstantString *)ID + fallback: (OFConstantString *)fallback + arguments: (va_list)arguments; @end OF_ASSUME_NONNULL_END Index: src/OFLocalization.m ================================================================== --- src/OFLocalization.m +++ src/OFLocalization.m @@ -80,32 +80,32 @@ + (instancetype)sharedLocalization { return sharedLocalization; } -+ (OFString*)language ++ (OFString *)language { return [sharedLocalization language]; } -+ (OFString*)territory ++ (OFString *)territory { return [sharedLocalization territory]; } + (of_string_encoding_t)encoding { return [sharedLocalization encoding]; } -+ (OFString*)decimalPoint ++ (OFString *)decimalPoint { return [sharedLocalization decimalPoint]; } #ifdef OF_HAVE_FILES -+ (void)addLanguageDirectory: (OFString*)path ++ (void)addLanguageDirectory: (OFString *)path { [sharedLocalization addLanguageDirectory: path]; } #endif @@ -161,11 +161,11 @@ [super dealloc]; } #ifdef OF_HAVE_FILES -- (void)addLanguageDirectory: (OFString*)path +- (void)addLanguageDirectory: (OFString *)path { void *pool; OFString *mapPath, *language, *territory, *languageFile; OFDictionary *map; @@ -201,12 +201,12 @@ objc_autoreleasePoolPop(pool); } #endif -- (OFString*)localizedStringForID: (OFConstantString*)ID - fallback: (OFConstantString*)fallback, ... +- (OFString *)localizedStringForID: (OFConstantString *)ID + fallback: (OFConstantString *)fallback, ... { OFString *ret; va_list args; va_start(args, fallback); @@ -216,13 +216,13 @@ va_end(args); return ret; } -- (OFString*)localizedStringForID: (OFConstantString*)ID - fallback: (OFConstantString*)fallback - arguments: (va_list)arguments +- (OFString *)localizedStringForID: (OFConstantString *)ID + fallback: (OFConstantString *)fallback + arguments: (va_list)arguments { OFMutableString *ret = [OFMutableString string]; void *pool = objc_autoreleasePoolPush(); const char *UTF8String = NULL; size_t last, UTF8StringLength; @@ -283,11 +283,11 @@ * one or maybe two variables, meaning looping * is faster than constructing a dictionary. */ va_copy(argsCopy, arguments); while ((name = va_arg(argsCopy, - OFConstantString*)) != nil) { + OFConstantString *)) != nil) { id value = va_arg(argsCopy, id); if (value == nil) @throw [OFInvalidArgumentException Index: src/OFLocking.h ================================================================== --- src/OFLocking.h +++ src/OFLocking.h @@ -49,16 +49,16 @@ /*! * @brief Sets a name for the lock. * * @param name The name for the lock */ -- (void)setName: (nullable OFString*)name; +- (void)setName: (nullable OFString *)name; /*! * @brief Returns the name for the lock. * * @return The name for the lock */ -- (nullable OFString*)name; +- (nullable OFString *)name; @end OF_ASSUME_NONNULL_END Index: src/OFMD5Hash.m ================================================================== --- src/OFMD5Hash.m +++ src/OFMD5Hash.m @@ -165,11 +165,11 @@ _state[1] = 0xEFCDAB89; _state[2] = 0x98BADCFE; _state[3] = 0x10325476; } -- (void)updateWithBuffer: (const void*)buffer_ +- (void)updateWithBuffer: (const void *)buffer_ length: (size_t)length { const uint8_t *buffer = buffer_; if (_calculated) @@ -195,14 +195,14 @@ _bufferLength = 0; } } } -- (const unsigned char*)digest +- (const unsigned char *)digest { if (_calculated) - return (const uint8_t*)_state; + return (const uint8_t *)_state; _buffer.bytes[_bufferLength] = 0x80; memset(_buffer.bytes + _bufferLength + 1, 0, 64 - _bufferLength - 1); if (_bufferLength >= 56) { @@ -216,11 +216,11 @@ processBlock(_state, _buffer.words); memset(&_buffer, 0, sizeof(_buffer)); byteSwapVectorIfBE(_state, 4); _calculated = true; - return (const uint8_t*)_state; + return (const uint8_t *)_state; } - (void)reset { [self OF_resetState]; Index: src/OFMapTable+Private.h ================================================================== --- src/OFMapTable+Private.h +++ src/OFMapTable+Private.h @@ -22,10 +22,10 @@ { OFMapTableEnumerator *_enumerator; id _object; } -- initWithEnumerator: (OFMapTableEnumerator*)enumerator +- initWithEnumerator: (OFMapTableEnumerator *)enumerator object: (id)object; @end OF_ASSUME_NONNULL_END Index: src/OFMapTable.h ================================================================== --- src/OFMapTable.h +++ src/OFMapTable.h @@ -148,27 +148,27 @@ * @brief Returns the object for the given key or NULL if the key was not found. * * @param key The key whose object should be returned * @return The object for the given key or NULL if the key was not found */ -- (nullable void*)objectForKey: (void*)key; +- (nullable void *)objectForKey: (void *)key; /*! * @brief Sets an object for a key. * * @param key The key to set * @param object The object to set the key to */ -- (void)setObject: (void*)object - forKey: (void*)key; +- (void)setObject: (void *)object + forKey: (void *)key; /*! * @brief Removes the object for the specified key from the map table. * * @param key The key whose object should be removed */ -- (void)removeObjectForKey: (void*)key; +- (void)removeObjectForKey: (void *)key; /*! * @brief Removes all objects. */ - (void)removeAllObjects; @@ -178,37 +178,37 @@ * specified object. * * @param object The object which is checked for being in the map table * @return A boolean whether the map table contains the specified object */ -- (bool)containsObject: (nullable void*)object; +- (bool)containsObject: (nullable void *)object; /*! * @brief Checks whether the map table contains an object with the specified * address. * * @param object The object which is checked for being in the map table * @return A boolean whether the map table contains an object with the * specified address. */ -- (bool)containsObjectIdenticalTo: (nullable void*)object; +- (bool)containsObjectIdenticalTo: (nullable void *)object; /*! * @brief Returns an OFMapTableEnumerator to enumerate through the map table's * keys. * * @return An OFMapTableEnumerator to enumerate through the map table's keys */ -- (OFMapTableEnumerator*)keyEnumerator; +- (OFMapTableEnumerator *)keyEnumerator; /*! * @brief Returns an OFMapTableEnumerator to enumerate through the map table's * objects. * * @return An OFMapTableEnumerator to enumerate through the map table's objects */ -- (OFMapTableEnumerator*)objectEnumerator; +- (OFMapTableEnumerator *)objectEnumerator; #ifdef OF_HAVE_BLOCKS /*! * @brief Executes a block for each key / object pair. * @@ -245,15 +245,15 @@ /*! * @brief Returns the next object. * * @return The next object */ -- (void*)nextObject; +- (void *)nextObject; /*! * @brief Resets the enumerator, so the next call to @ref nextKey returns the * first key again. */ - (void)reset; @end OF_ASSUME_NONNULL_END Index: src/OFMapTable.m ================================================================== --- src/OFMapTable.m +++ src/OFMapTable.m @@ -35,11 +35,11 @@ void *key, *object; uint32_t hash; }; static struct of_map_table_bucket deleted = { 0 }; -static void* +static void * defaultRetain(void *object) { return object; } @@ -59,20 +59,20 @@ { return (object1 == object2); } @interface OFMapTable () -- (void)OF_setObject: (void*)object - forKey: (void*)key +- (void)OF_setObject: (void *)object + forKey: (void *)key hash: (uint32_t)hash; @end @interface OFMapTableEnumerator () -- (instancetype)OF_initWithMapTable: (OFMapTable*)mapTable - buckets: (struct of_map_table_bucket**)buckets +- (instancetype)OF_initWithMapTable: (OFMapTable *)mapTable + buckets: (struct of_map_table_bucket **)buckets capacity: (uint32_t)capacity - mutationsPointer: (unsigned long*)mutationsPtr; + mutationsPointer: (unsigned long *)mutationsPtr; @end @interface OFMapTableKeyEnumerator: OFMapTableEnumerator @end @@ -259,11 +259,11 @@ - (size_t)count { return _count; } -- (void*)objectForKey: (void*)key +- (void *)objectForKey: (void *)key { uint32_t i, hash, last; if (key == NULL) @throw [OFInvalidArgumentException exception]; @@ -355,12 +355,12 @@ [self freeMemory: _buckets]; _buckets = buckets; _capacity = capacity; } -- (void)OF_setObject: (void*)object - forKey: (void*)key +- (void)OF_setObject: (void *)object + forKey: (void *)key hash: (uint32_t)hash { uint32_t i, last; void *old; @@ -443,19 +443,19 @@ old = _buckets[i]->object; _buckets[i]->object = _objectFunctions.retain(object); _objectFunctions.release(old); } -- (void)setObject: (void*)object - forKey: (void*)key +- (void)setObject: (void *)object + forKey: (void *)key { [self OF_setObject: object forKey: key hash: _keyFunctions.hash(key)]; } -- (void)removeObjectForKey: (void*)key +- (void)removeObjectForKey: (void *)key { uint32_t i, hash, last; if (key == NULL) @throw [OFInvalidArgumentException exception]; @@ -544,11 +544,11 @@ #else _rotate = rand() & 31; #endif } -- (bool)containsObject: (void*)object +- (bool)containsObject: (void *)object { if (object == NULL || _count == 0) return false; for (uint32_t i = 0; i < _capacity; i++) @@ -557,11 +557,11 @@ return true; return false; } -- (bool)containsObjectIdenticalTo: (void*)object +- (bool)containsObjectIdenticalTo: (void *)object { if (object == NULL || _count == 0) return false; for (uint32_t i = 0; i < _capacity; i++) @@ -570,30 +570,30 @@ return true; return false; } -- (OFMapTableEnumerator*)keyEnumerator +- (OFMapTableEnumerator *)keyEnumerator { return [[[OFMapTableKeyEnumerator alloc] OF_initWithMapTable: self buckets: _buckets capacity: _capacity mutationsPointer: &_mutations] autorelease]; } -- (OFMapTableEnumerator*)objectEnumerator +- (OFMapTableEnumerator *)objectEnumerator { return [[[OFMapTableObjectEnumerator alloc] OF_initWithMapTable: self buckets: _buckets capacity: _capacity mutationsPointer: &_mutations] autorelease]; } -- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state - objects: (id*)objects +- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state + objects: (id *)objects count: (int)count { uint32_t j = (uint32_t)state->state; int i; @@ -663,14 +663,14 @@ - init { OF_INVALID_INIT_METHOD } -- (instancetype)OF_initWithMapTable: (OFMapTable*)mapTable - buckets: (struct of_map_table_bucket**)buckets +- (instancetype)OF_initWithMapTable: (OFMapTable *)mapTable + buckets: (struct of_map_table_bucket **)buckets capacity: (uint32_t)capacity - mutationsPointer: (unsigned long*)mutationsPtr + mutationsPointer: (unsigned long *)mutationsPtr { self = [super init]; _mapTable = [mapTable retain]; _buckets = buckets; @@ -686,11 +686,11 @@ [_mapTable release]; [super dealloc]; } -- (void*)nextObject +- (void *)nextObject { OF_UNRECOGNIZED_SELECTOR } - (void)reset @@ -702,11 +702,11 @@ _position = 0; } @end @implementation OFMapTableKeyEnumerator -- (void*)nextObject +- (void *)nextObject { if (*_mutationsPtr != _mutations) @throw [OFEnumerationMutationException exceptionWithObject: _mapTable]; @@ -719,11 +719,11 @@ return NULL; } @end @implementation OFMapTableObjectEnumerator -- (void*)nextObject +- (void *)nextObject { if (*_mutationsPtr != _mutations) @throw [OFEnumerationMutationException exceptionWithObject: _mapTable]; @@ -736,11 +736,11 @@ return NULL; } @end @implementation OFMapTable_EnumeratorWrapper -- initWithEnumerator: (OFMapTableEnumerator*)enumerator +- initWithEnumerator: (OFMapTableEnumerator *)enumerator object: (id)object { self = [super init]; _enumerator = [enumerator retain]; Index: src/OFMessagePackExtension.h ================================================================== --- src/OFMessagePackExtension.h +++ src/OFMessagePackExtension.h @@ -51,11 +51,11 @@ * @param type The MessagePack extension type * @param data The data for the extension * @return A new, autoreleased OFMessagePackRepresentation */ + (instancetype)extensionWithType: (int8_t)type - data: (OFDataArray*)data; + data: (OFDataArray *)data; /*! * @brief Initializes an already allocated OFMessagePackRepresentation with the * specified type and data. * @@ -62,9 +62,9 @@ * @param type The MessagePack extension type * @param data The data for the extension * @return An initialized OFMessagePackRepresentation */ - initWithType: (int8_t)type - data: (OFDataArray*)data; + data: (OFDataArray *)data; @end OF_ASSUME_NONNULL_END Index: src/OFMessagePackExtension.m ================================================================== --- src/OFMessagePackExtension.m +++ src/OFMessagePackExtension.m @@ -24,11 +24,11 @@ @implementation OFMessagePackExtension @synthesize type = _type, data = _data; + (instancetype)extensionWithType: (int8_t)type - data: (OFDataArray*)data + data: (OFDataArray *)data { return [[[self alloc] initWithType: type data: data] autorelease]; } @@ -36,11 +36,11 @@ { OF_INVALID_INIT_METHOD } - initWithType: (int8_t)type - data: (OFDataArray*)data + data: (OFDataArray *)data { self = [super init]; @try { if (data == nil || [data itemSize] != 1) @@ -61,11 +61,11 @@ [_data release]; [super dealloc]; } -- (OFDataArray*)messagePackRepresentation +- (OFDataArray *)messagePackRepresentation { OFDataArray *ret; uint8_t prefix; size_t count = [_data count]; @@ -148,11 +148,11 @@ count: [_data count]]; return ret; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"", _type, _data]; } Index: src/OFMessagePackRepresentation.h ================================================================== --- src/OFMessagePackRepresentation.h +++ src/OFMessagePackRepresentation.h @@ -32,9 +32,9 @@ * @brief Returns the MessagePack representation of the object as an * OFDataArray. * * @return The MessagePack representation of the object as an OFDataArray. */ -- (OFDataArray*)messagePackRepresentation; +- (OFDataArray *)messagePackRepresentation; @end OF_ASSUME_NONNULL_END Index: src/OFMutableArray.h ================================================================== --- src/OFMutableArray.h +++ src/OFMutableArray.h @@ -36,11 +36,11 @@ * * @brief An abstract class for storing, adding and removing objects in an * array. */ #ifdef OF_HAVE_GENERICS -@interface OFMutableArray : OFArray +@interface OFMutableArray: OFArray #else # ifndef DOXYGEN # define ObjectType id # endif @interface OFMutableArray: OFArray @@ -73,11 +73,11 @@ /*! * @brief Adds the objects from the specified OFArray to the end of the array. * * @param array An array of objects to add */ -- (void)addObjectsFromArray: (OFArray OF_GENERIC(ObjectType)*)array; +- (void)addObjectsFromArray: (OFArray OF_GENERIC(ObjectType) *)array; /*! * @brief Inserts an object to the OFArray at the specified index. * * @param object An object to add @@ -90,11 +90,11 @@ * @brief Inserts the objects from the specified OFArray at the specified index. * * @param array An array of objects * @param index The index where the objects should be inserted */ -- (void)insertObjectsFromArray: (OFArray OF_GENERIC(ObjectType)*)array +- (void)insertObjectsFromArray: (OFArray OF_GENERIC(ObjectType) *)array atIndex: (size_t)index; /*! * @brief Replaces the first object equivalent to the specified object with the * other specified object. Index: src/OFMutableArray.m ================================================================== --- src/OFMutableArray.m +++ src/OFMutableArray.m @@ -112,23 +112,23 @@ { return (id)[[OFMutableArray_adjacent alloc] initWithObject: firstObject arguments: arguments]; } -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array { return (id)[[OFMutableArray_adjacent alloc] initWithArray: array]; } -- initWithObjects: (id const*)objects +- initWithObjects: (id const *)objects count: (size_t)count { return (id)[[OFMutableArray_adjacent alloc] initWithObjects: objects count: count]; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { return (id)[[OFMutableArray_adjacent alloc] initWithSerialization: element]; } @@ -201,11 +201,11 @@ { [self insertObject: object atIndex: [self count]]; } -- (void)addObjectsFromArray: (OFArray*)array +- (void)addObjectsFromArray: (OFArray *)array { [self insertObjectsFromArray: array atIndex: [self count]]; } @@ -213,11 +213,11 @@ atIndex: (size_t)index { OF_UNRECOGNIZED_SELECTOR } -- (void)insertObjectsFromArray: (OFArray*)array +- (void)insertObjectsFromArray: (OFArray *)array atIndex: (size_t)index { size_t i = 0; for (id object in array) Index: src/OFMutableArray_adjacent.m ================================================================== --- src/OFMutableArray_adjacent.m +++ src/OFMutableArray_adjacent.m @@ -74,11 +74,11 @@ [object retain]; _mutations++; } -- (void)insertObjectsFromArray: (OFArray*)array +- (void)insertObjectsFromArray: (OFArray *)array atIndex: (size_t)index { id const *objects = [array objects]; size_t count = [array count]; @@ -296,12 +296,12 @@ objects[i] = objects[j]; objects[j] = tmp; } } -- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state - objects: (id*)objects +- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state + objects: (id *)objects count: (int)count_ { size_t count = [_array count]; if (count > INT_MAX) { @@ -325,11 +325,11 @@ state->mutationsPtr = &_mutations; return (int)count; } -- (OFEnumerator*)objectEnumerator +- (OFEnumerator *)objectEnumerator { return [[[OFArrayEnumerator alloc] initWithArray: self mutationsPtr: &_mutations] autorelease]; } Index: src/OFMutableDictionary.h ================================================================== --- src/OFMutableDictionary.h +++ src/OFMutableDictionary.h @@ -35,12 +35,12 @@ * @class OFMutableDictionary OFDictionary.h ObjFW/OFDictionary.h * * @brief An abstract class for storing and changing objects in a dictionary. */ #ifdef OF_HAVE_GENERICS -@interface OFMutableDictionary : - OFDictionary +@interface OFMutableDictionary: + OFDictionary #else # ifndef DOXYGEN # define KeyType id # define ObjectType id # endif Index: src/OFMutableDictionary.m ================================================================== --- src/OFMutableDictionary.m +++ src/OFMutableDictionary.m @@ -33,11 +33,11 @@ - init { return (id)[[OFMutableDictionary_hashtable alloc] init]; } -- initWithDictionary: (OFDictionary*)dictionary +- initWithDictionary: (OFDictionary *)dictionary { return (id)[[OFMutableDictionary_hashtable alloc] initWithDictionary: dictionary]; } @@ -46,20 +46,20 @@ { return (id)[[OFMutableDictionary_hashtable alloc] initWithObject: object forKey: key]; } -- initWithObjects: (OFArray*)objects - forKeys: (OFArray*)keys +- initWithObjects: (OFArray *)objects + forKeys: (OFArray *)keys { return (id)[[OFMutableDictionary_hashtable alloc] initWithObjects: objects forKeys: keys]; } -- initWithObjects: (id const*)objects - forKeys: (id const*)keys +- initWithObjects: (id const *)objects + forKeys: (id const *)keys count: (size_t)count { return (id)[[OFMutableDictionary_hashtable alloc] initWithObjects: objects forKeys: keys @@ -86,11 +86,11 @@ return (id)[[OFMutableDictionary_hashtable alloc] initWithKey: firstKey arguments: arguments]; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { return (id)[[OFMutableDictionary_hashtable alloc] initWithSerialization: element]; } Index: src/OFMutableDictionary_hashtable.m ================================================================== --- src/OFMutableDictionary_hashtable.m +++ src/OFMutableDictionary_hashtable.m @@ -52,11 +52,11 @@ #ifdef OF_HAVE_BLOCKS - (void)replaceObjectsUsingBlock: (of_dictionary_replace_block_t)block { @try { [_mapTable replaceObjectsUsingBlock: - ^ void* (void *key, void *object) { + ^ void *(void *key, void *object) { return block(key, object); }]; } @catch (OFEnumerationMutationException *e) { @throw [OFEnumerationMutationException exceptionWithObject: self]; Index: src/OFMutableSet.h ================================================================== --- src/OFMutableSet.h +++ src/OFMutableSet.h @@ -22,11 +22,11 @@ * @class OFMutableSet OFSet.h ObjFW/OFSet.h * * @brief An abstract class for a mutable unordered set of unique objects. */ #ifdef OF_HAVE_GENERICS -@interface OFMutableSet : OFSet +@interface OFMutableSet: OFSet #else # ifndef DOXYGEN # define ObjectType id # endif @interface OFMutableSet: OFSet @@ -66,26 +66,26 @@ /*! * @brief Removes all objects from the receiver which are in the specified set. * * @param set The set whose objects will be removed from the receiver */ -- (void)minusSet: (OFSet OF_GENERIC(ObjectType)*)set; +- (void)minusSet: (OFSet OF_GENERIC(ObjectType) *)set; /*! * @brief Removes all objects from the receiver which are not in the specified * set. * * @param set The set to intersect with */ -- (void)intersectSet: (OFSet OF_GENERIC(ObjectType)*)set; +- (void)intersectSet: (OFSet OF_GENERIC(ObjectType) *)set; /*! * @brief Creates a union of the receiver and the specified set. * * @param set The set to create the union with */ -- (void)unionSet: (OFSet OF_GENERIC(ObjectType)*)set; +- (void)unionSet: (OFSet OF_GENERIC(ObjectType) *)set; /*! * @brief Converts the mutable set to an immutable set. */ - (void)makeImmutable; Index: src/OFMutableSet.m ================================================================== --- src/OFMutableSet.m +++ src/OFMutableSet.m @@ -34,16 +34,16 @@ - init { return (id)[[OFMutableSet_hashtable alloc] init]; } -- initWithSet: (OFSet*)set +- initWithSet: (OFSet *)set { return (id)[[OFMutableSet_hashtable alloc] initWithSet: set]; } -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array { return (id)[[OFMutableSet_hashtable alloc] initWithArray: array]; } - initWithObjects: (id)firstObject, ... @@ -57,11 +57,11 @@ va_end(arguments); return ret; } -- initWithObjects: (id const*)objects +- initWithObjects: (id const *)objects count: (size_t)count { return (id)[[OFMutableSet_hashtable alloc] initWithObjects: objects count: count]; } @@ -71,11 +71,11 @@ { return (id)[[OFMutableSet_hashtable alloc] initWithObject: firstObject arguments: arguments]; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { return (id)[[OFMutableSet_hashtable alloc] initWithSerialization: element]; } @@ -152,17 +152,17 @@ - (void)removeObject: (id)object { OF_UNRECOGNIZED_SELECTOR } -- (void)minusSet: (OFSet*)set +- (void)minusSet: (OFSet *)set { for (id object in set) [self removeObject: object]; } -- (void)intersectSet: (OFSet*)set +- (void)intersectSet: (OFSet *)set { void *pool = objc_autoreleasePoolPush(); size_t count = [self count]; id *cArray; @@ -186,15 +186,15 @@ } objc_autoreleasePoolPop(pool); } -- (void)unionSet: (OFSet*)set +- (void)unionSet: (OFSet *)set { for (id object in set) [self addObject: object]; } - (void)makeImmutable { } @end Index: src/OFMutableSet_hashtable.m ================================================================== --- src/OFMutableSet_hashtable.m +++ src/OFMutableSet_hashtable.m @@ -27,11 +27,11 @@ [self inheritMethodsFromClass: [OFSet_hashtable class]]; } - (void)addObject: (id)object { - [_mapTable setObject: (void*)1 + [_mapTable setObject: (void *)1 forKey: object]; } - (void)removeObject: (id)object { Index: src/OFMutableString.h ================================================================== --- src/OFMutableString.h +++ src/OFMutableString.h @@ -36,45 +36,45 @@ /*! * @brief Appends another OFString to the OFMutableString. * * @param string An OFString to append */ -- (void)appendString: (OFString*)string; +- (void)appendString: (OFString *)string; /*! * @brief Appends the specified characters to the OFMutableString. * * @param characters An array of characters to append * @param length The length of the array of characters */ -- (void)appendCharacters: (const of_unichar_t*)characters +- (void)appendCharacters: (const of_unichar_t *)characters length: (size_t)length; /*! * @brief Appends a UTF-8 encoded C string to the OFMutableString. * * @param UTF8String A UTF-8 encoded C string to append */ -- (void)appendUTF8String: (const char*)UTF8String; +- (void)appendUTF8String: (const char *)UTF8String; /*! * @brief Appends a UTF-8 encoded C string with the specified length to the * OFMutableString. * * @param UTF8String A UTF-8 encoded C string to append * @param UTF8StringLength The length of the UTF-8 encoded C string */ -- (void)appendUTF8String: (const char*)UTF8String +- (void)appendUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength; /*! * @brief Appends a C string with the specified encoding to the OFMutableString. * * @param cString A C string to append * @param encoding The encoding of the C string */ -- (void)appendCString: (const char*)cString +- (void)appendCString: (const char *)cString encoding: (of_string_encoding_t)encoding; /*! * @brief Appends a C string with the specified encoding and length to the * OFMutableString. @@ -81,43 +81,44 @@ * * @param cString A C string to append * @param encoding The encoding of the C string * @param cStringLength The length of the UTF-8 encoded C string */ -- (void)appendCString: (const char*)cString +- (void)appendCString: (const char *)cString encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength; /*! * @brief Appends a formatted string to the OFMutableString. * * See `printf` for the format syntax. As an addition, `%@` is available as * format specifier for objects, `%C` for `of_unichar_t` and `%S` for - * `const of_unichar_t*`. + * `const of_unichar_t *`. * * @param format A format string which generates the string to append */ -- (void)appendFormat: (OFConstantString*)format, ...; +- (void)appendFormat: (OFConstantString *)format, ...; /*! * @brief Appends a formatted string to the OFMutableString. * - * See printf for the format syntax. As an addition, %@ is available as format - * specifier for objects, %C for of_unichar_t and %S for const of_unichar_t*. + * See printf for the format syntax. As an addition, `%@` is available as + * format specifier for objects, `%C` for `of_unichar_t` and `%S` for + * `const of_unichar_t *`. * * @param format A format string which generates the string to append * @param arguments The arguments used in the format string */ -- (void)appendFormat: (OFConstantString*)format +- (void)appendFormat: (OFConstantString *)format arguments: (va_list)arguments; /*! * @brief Prepends another OFString to the OFMutableString. * * @param string An OFString to prepend */ -- (void)prependString: (OFString*)string; +- (void)prependString: (OFString *)string; /*! * @brief Reverses the string. */ - (void)reverse; @@ -145,11 +146,11 @@ * @brief Inserts a string at the specified index. * * @param string The string to insert * @param index The index */ -- (void)insertString: (OFString*)string +- (void)insertString: (OFString *)string atIndex: (size_t)index; /*! * @brief Deletes the characters at the specified range. * @@ -162,20 +163,20 @@ * * @param range The range of the characters which should be replaced * @param replacement The string to the replace the characters with */ - (void)replaceCharactersInRange: (of_range_t)range - withString: (OFString*)replacement; + withString: (OFString *)replacement; /*! * @brief Replaces all occurrences of a string with another string. * * @param string The string to replace * @param replacement The string with which it should be replaced */ -- (void)replaceOccurrencesOfString: (OFString*)string - withString: (OFString*)replacement; +- (void)replaceOccurrencesOfString: (OFString *)string + withString: (OFString *)replacement; /*! * @brief Replaces all occurrences of a string in the specified range with * another string. * @@ -183,12 +184,12 @@ * @param replacement The string with which it should be replaced * @param options Options modifying search behaviour * Possible values: None yet * @param range The range in which the string should be replaced */ -- (void)replaceOccurrencesOfString: (OFString*)string - withString: (OFString*)replacement +- (void)replaceOccurrencesOfString: (OFString *)string + withString: (OFString *)replacement options: (int)options range: (of_range_t)range; /*! * @brief Deletes all whitespaces at the beginning of the string. Index: src/OFMutableString.m ================================================================== --- src/OFMutableString.m +++ src/OFMutableString.m @@ -43,114 +43,114 @@ - init { return (id)[[OFMutableString_UTF8 alloc] init]; } -- initWithUTF8String: (const char*)UTF8String +- initWithUTF8String: (const char *)UTF8String { return (id)[[OFMutableString_UTF8 alloc] initWithUTF8String: UTF8String]; } -- initWithUTF8String: (const char*)UTF8String +- initWithUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength { return (id)[[OFMutableString_UTF8 alloc] initWithUTF8String: UTF8String length: UTF8StringLength]; } -- initWithCString: (const char*)cString +- initWithCString: (const char *)cString encoding: (of_string_encoding_t)encoding { return (id)[[OFMutableString_UTF8 alloc] initWithCString: cString encoding: encoding]; } -- initWithCString: (const char*)cString +- initWithCString: (const char *)cString encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength { return (id)[[OFMutableString_UTF8 alloc] initWithCString: cString encoding: encoding length: cStringLength]; } -- initWithString: (OFString*)string +- initWithString: (OFString *)string { return (id)[[OFMutableString_UTF8 alloc] initWithString: string]; } -- initWithCharacters: (const of_unichar_t*)characters +- initWithCharacters: (const of_unichar_t *)characters length: (size_t)length { return (id)[[OFMutableString_UTF8 alloc] initWithCharacters: characters length: length]; } -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string { return (id)[[OFMutableString_UTF8 alloc] initWithUTF16String: string]; } -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string length: (size_t)length { return (id)[[OFMutableString_UTF8 alloc] initWithUTF16String: string length: length]; } -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string byteOrder: (of_byte_order_t)byteOrder { return (id)[[OFMutableString_UTF8 alloc] initWithUTF16String: string byteOrder: byteOrder]; } -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder { return (id)[[OFMutableString_UTF8 alloc] initWithUTF16String: string length: length byteOrder: byteOrder]; } -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string { return (id)[[OFMutableString_UTF8 alloc] initWithUTF32String: string]; } -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string length: (size_t)length { return (id)[[OFMutableString_UTF8 alloc] initWithUTF32String: string length: length]; } -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string byteOrder: (of_byte_order_t)byteOrder { return (id)[[OFMutableString_UTF8 alloc] initWithUTF32String: string byteOrder: byteOrder]; } -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder { return (id)[[OFMutableString_UTF8 alloc] initWithUTF32String: string length: length byteOrder: byteOrder]; } -- initWithFormat: (OFConstantString*)format, ... +- initWithFormat: (OFConstantString *)format, ... { id ret; va_list arguments; va_start(arguments, format); @@ -159,48 +159,48 @@ va_end(arguments); return ret; } -- initWithFormat: (OFConstantString*)format +- initWithFormat: (OFConstantString *)format arguments: (va_list)arguments { return (id)[[OFMutableString_UTF8 alloc] initWithFormat: format arguments: arguments]; } #ifdef OF_HAVE_FILES -- initWithContentsOfFile: (OFString*)path +- initWithContentsOfFile: (OFString *)path { return (id)[[OFMutableString_UTF8 alloc] initWithContentsOfFile: path]; } -- initWithContentsOfFile: (OFString*)path +- initWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding { return (id)[[OFMutableString_UTF8 alloc] initWithContentsOfFile: path encoding: encoding]; } #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) -- initWithContentsOfURL: (OFURL*)URL +- initWithContentsOfURL: (OFURL *)URL { return (id)[[OFMutableString_UTF8 alloc] initWithContentsOfURL: URL]; } -- initWithContentsOfURL: (OFURL*)URL +- initWithContentsOfURL: (OFURL *)URL encoding: (of_string_encoding_t)encoding { return (id)[[OFMutableString_UTF8 alloc] initWithContentsOfURL: URL encoding: encoding]; } #endif -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { return (id)[[OFMutableString_UTF8 alloc] initWithSerialization: element]; } @@ -330,17 +330,17 @@ withString: string]; objc_autoreleasePoolPop(pool); } -- (void)appendString: (OFString*)string +- (void)appendString: (OFString *)string { [self insertString: string atIndex: [self length]]; } -- (void)appendCharacters: (const of_unichar_t*)characters +- (void)appendCharacters: (const of_unichar_t *)characters length: (size_t)length { void *pool = objc_autoreleasePoolPush(); [self appendString: [OFString stringWithCharacters: characters @@ -347,20 +347,20 @@ length: length]]; objc_autoreleasePoolPop(pool); } -- (void)appendUTF8String: (const char*)UTF8String +- (void)appendUTF8String: (const char *)UTF8String { void *pool = objc_autoreleasePoolPush(); [self appendString: [OFString stringWithUTF8String: UTF8String]]; objc_autoreleasePoolPop(pool); } -- (void)appendUTF8String: (const char*)UTF8String +- (void)appendUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength { void *pool = objc_autoreleasePoolPush(); [self appendString: [OFString stringWithUTF8String: UTF8String @@ -367,11 +367,11 @@ length: UTF8StringLength]]; objc_autoreleasePoolPop(pool); } -- (void)appendCString: (const char*)cString +- (void)appendCString: (const char *)cString encoding: (of_string_encoding_t)encoding { void *pool = objc_autoreleasePoolPush(); [self appendString: [OFString stringWithCString: cString @@ -378,11 +378,11 @@ encoding: encoding]]; objc_autoreleasePoolPop(pool); } -- (void)appendCString: (const char*)cString +- (void)appendCString: (const char *)cString encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength { void *pool = objc_autoreleasePoolPush(); @@ -391,21 +391,21 @@ length: cStringLength]]; objc_autoreleasePoolPop(pool); } -- (void)appendFormat: (OFConstantString*)format, ... +- (void)appendFormat: (OFConstantString *)format, ... { va_list arguments; va_start(arguments, format); [self appendFormat: format arguments: arguments]; va_end(arguments); } -- (void)appendFormat: (OFConstantString*)format +- (void)appendFormat: (OFConstantString *)format arguments: (va_list)arguments { char *UTF8String; int UTF8StringLength; @@ -422,11 +422,11 @@ } @finally { free(UTF8String); } } -- (void)prependString: (OFString*)string +- (void)prependString: (OFString *)string { [self insertString: string atIndex: 0]; } @@ -485,11 +485,11 @@ [self OF_convertWithWordStartFunction: of_ascii_toupper wordMiddleFunction: of_ascii_tolower]; } #endif -- (void)insertString: (OFString*)string +- (void)insertString: (OFString *)string atIndex: (size_t)index { [self replaceCharactersInRange: of_range(index, 0) withString: string]; } @@ -499,26 +499,26 @@ [self replaceCharactersInRange: range withString: @""]; } - (void)replaceCharactersInRange: (of_range_t)range - withString: (OFString*)replacement + withString: (OFString *)replacement { OF_UNRECOGNIZED_SELECTOR } -- (void)replaceOccurrencesOfString: (OFString*)string - withString: (OFString*)replacement +- (void)replaceOccurrencesOfString: (OFString *)string + withString: (OFString *)replacement { [self replaceOccurrencesOfString: string withString: replacement options: 0 range: of_range(0, [self length])]; } -- (void)replaceOccurrencesOfString: (OFString*)string - withString: (OFString*)replacement +- (void)replaceOccurrencesOfString: (OFString *)string + withString: (OFString *)replacement options: (int)options range: (of_range_t)range { void *pool = objc_autoreleasePoolPush(), *pool2; const of_unichar_t *characters; Index: src/OFMutableString_UTF8.m ================================================================== --- src/OFMutableString_UTF8.m +++ src/OFMutableString_UTF8.m @@ -39,11 +39,11 @@ { if (self == [OFMutableString_UTF8 class]) [self inheritMethodsFromClass: [OFString_UTF8 class]]; } -- initWithUTF8StringNoCopy: (char*)UTF8String +- initWithUTF8StringNoCopy: (char *)UTF8String freeWhenDone: (bool)freeWhenDone { @try { self = [self initWithUTF8String: UTF8String]; } @finally { @@ -269,11 +269,11 @@ /* We don't really care, as we only made it smaller */ } } } -- (void)appendUTF8String: (const char*)UTF8String +- (void)appendUTF8String: (const char *)UTF8String { size_t UTF8StringLength = strlen(UTF8String); size_t length; if (UTF8StringLength >= 3 && @@ -299,11 +299,11 @@ _s->cStringLength += UTF8StringLength; _s->length += length; } -- (void)appendUTF8String: (const char*)UTF8String +- (void)appendUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength { size_t length; if (UTF8StringLength >= 3 && @@ -330,19 +330,19 @@ _s->length += length; _s->cString[_s->cStringLength] = 0; } -- (void)appendCString: (const char*)cString +- (void)appendCString: (const char *)cString encoding: (of_string_encoding_t)encoding { [self appendCString: cString encoding: encoding length: strlen(cString)]; } -- (void)appendCString: (const char*)cString +- (void)appendCString: (const char *)cString encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength { if (encoding == OF_STRING_ENCODING_UTF_8) [self appendUTF8String: cString @@ -357,11 +357,11 @@ objc_autoreleasePoolPop(pool); } } -- (void)appendString: (OFString*)string +- (void)appendString: (OFString *)string { size_t UTF8StringLength; if (string == nil) @throw [OFInvalidArgumentException exception]; @@ -380,17 +380,17 @@ _s->cString[_s->cStringLength] = 0; if ([string isKindOfClass: [OFString_UTF8 class]] || [string isKindOfClass: [OFMutableString_UTF8 class]]) { - if (((OFString_UTF8*)string)->_s->isUTF8) + if (((OFString_UTF8 *)string)->_s->isUTF8) _s->isUTF8 = true; } else _s->isUTF8 = true; } -- (void)appendCharacters: (const of_unichar_t*)characters +- (void)appendCharacters: (const of_unichar_t *)characters length: (size_t)length { char *tmp; tmp = [self allocMemoryWithSize: (length * 4) + 1]; @@ -426,11 +426,11 @@ } @finally { [self freeMemory: tmp]; } } -- (void)appendFormat: (OFConstantString*)format +- (void)appendFormat: (OFConstantString *)format arguments: (va_list)arguments { char *UTF8String; int UTF8StringLength; @@ -527,11 +527,11 @@ /* UTF-8 does not allow more than 4 bytes per character */ @throw [OFInvalidEncodingException exception]; } } -- (void)insertString: (OFString*)string +- (void)insertString: (OFString *)string atIndex: (size_t)index { size_t newCStringLength; if (index > _s->length) @@ -555,11 +555,11 @@ _s->cStringLength = newCStringLength; _s->length += [string length]; if ([string isKindOfClass: [OFString_UTF8 class]] || [string isKindOfClass: [OFMutableString_UTF8 class]]) { - if (((OFString_UTF8*)string)->_s->isUTF8) + if (((OFString_UTF8 *)string)->_s->isUTF8) _s->isUTF8 = true; } else _s->isUTF8 = true; } @@ -592,11 +592,11 @@ /* We don't really care, as we only made it smaller */ } } - (void)replaceCharactersInRange: (of_range_t)range - withString: (OFString*)replacement + withString: (OFString *)replacement { size_t start = range.location; size_t end = range.location + range.length; size_t newCStringLength, newLength; @@ -648,18 +648,18 @@ _s->cStringLength = newCStringLength; _s->length = newLength; if ([replacement isKindOfClass: [OFString_UTF8 class]] || [replacement isKindOfClass: [OFMutableString_UTF8 class]]) { - if (((OFString_UTF8*)replacement)->_s->isUTF8) + if (((OFString_UTF8 *)replacement)->_s->isUTF8) _s->isUTF8 = true; } else _s->isUTF8 = true; } -- (void)replaceOccurrencesOfString: (OFString*)string - withString: (OFString*)replacement +- (void)replaceOccurrencesOfString: (OFString *)string + withString: (OFString *)replacement options: (int)options range: (of_range_t)range { const char *searchString = [string UTF8String]; const char *replacementString = [replacement UTF8String]; @@ -735,11 +735,11 @@ _s->cStringLength = newCStringLength; _s->length = newLength; if ([replacement isKindOfClass: [OFString_UTF8 class]] || [replacement isKindOfClass: [OFMutableString_UTF8 class]]) { - if (((OFString_UTF8*)replacement)->_s->isUTF8) + if (((OFString_UTF8 *)replacement)->_s->isUTF8) _s->isUTF8 = true; } else _s->isUTF8 = true; } Index: src/OFMutex.m ================================================================== --- src/OFMutex.m +++ src/OFMutex.m @@ -73,14 +73,14 @@ { if (!of_mutex_unlock(&_mutex)) @throw [OFUnlockFailedException exceptionWithLock: self]; } -- (OFString*)description +- (OFString *)description { if (_name == nil) return [super description]; return [OFString stringWithFormat: @"<%@: %@>", [self className], _name]; } @end Index: src/OFNull.h ================================================================== --- src/OFNull.h +++ src/OFNull.h @@ -32,9 +32,9 @@ /*! * @brief Returns an OFNull singleton. * * @return An OFNull singleton */ -+ (OFNull*)null; ++ (OFNull *)null; @end OF_ASSUME_NONNULL_END Index: src/OFNull.m ================================================================== --- src/OFNull.m +++ src/OFNull.m @@ -22,12 +22,12 @@ #import "OFDataArray.h" #import "OFInvalidArgumentException.h" @interface OFNull () -- (OFString*)OF_JSONRepresentationWithOptions: (int)options - depth: (size_t)depth; +- (OFString *)OF_JSONRepresentationWithOptions: (int)options + depth: (size_t)depth; @end static OFNull *null = nil; @implementation OFNull @@ -34,16 +34,16 @@ + (void)initialize { null = [[self alloc] init]; } -+ (OFNull*)null ++ (OFNull *)null { return null; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { void *pool; [self release]; @@ -56,21 +56,21 @@ objc_autoreleasePoolPop(pool); return [OFNull null]; } -- (OFString*)description +- (OFString *)description { return @""; } - copy { return self; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; element = [OFXMLElement elementWithName: [self className] @@ -81,29 +81,29 @@ objc_autoreleasePoolPop(pool); return [element autorelease]; } -- (OFString*)JSONRepresentation +- (OFString *)JSONRepresentation { return [self OF_JSONRepresentationWithOptions: 0 depth: 0]; } -- (OFString*)JSONRepresentationWithOptions: (int)options +- (OFString *)JSONRepresentationWithOptions: (int)options { return [self OF_JSONRepresentationWithOptions: options depth: 0]; } -- (OFString*)OF_JSONRepresentationWithOptions: (int)options +- (OFString *)OF_JSONRepresentationWithOptions: (int)options depth: (size_t)depth { return @"null"; } -- (OFDataArray*)messagePackRepresentation +- (OFDataArray *)messagePackRepresentation { OFDataArray *data = [OFDataArray dataArrayWithItemSize: 1 capacity: 1]; uint8_t type = 0xC0; Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -90,12 +90,12 @@ default: \ @throw [OFInvalidFormatException exception]; \ } @interface OFNumber () -- (OFString*)OF_JSONRepresentationWithOptions: (int)options - depth: (size_t)depth; +- (OFString *)OF_JSONRepresentationWithOptions: (int)options + depth: (size_t)depth; @end @implementation OFNumber @synthesize type = _type; @@ -522,11 +522,11 @@ _type = OF_NUMBER_TYPE_DOUBLE; return self; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); @@ -763,11 +763,11 @@ OFNumber *number; if (![object isKindOfClass: [OFNumber class]]) @throw [OFInvalidArgumentException exception]; - number = (OFNumber*)object; + number = (OFNumber *)object; if (_type & OF_NUMBER_TYPE_FLOAT || number->_type & OF_NUMBER_TYPE_FLOAT) { double double1 = [self doubleValue]; double double2 = [number doubleValue]; @@ -867,11 +867,11 @@ - copy { return [self retain]; } -- (OFString*)description +- (OFString *)description { OFMutableString *ret; switch (_type) { case OF_NUMBER_TYPE_BOOL: @@ -924,11 +924,11 @@ default: @throw [OFInvalidFormatException exception]; } } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; element = [OFXMLElement elementWithName: [self className] @@ -1008,24 +1008,24 @@ objc_autoreleasePoolPop(pool); return [element autorelease]; } -- (OFString*)JSONRepresentation +- (OFString *)JSONRepresentation { return [self OF_JSONRepresentationWithOptions: 0 depth: 0]; } -- (OFString*)JSONRepresentationWithOptions: (int)options +- (OFString *)JSONRepresentationWithOptions: (int)options { return [self OF_JSONRepresentationWithOptions: options depth: 0]; } -- (OFString*)OF_JSONRepresentationWithOptions: (int)options - depth: (size_t)depth +- (OFString *)OF_JSONRepresentationWithOptions: (int)options + depth: (size_t)depth { double doubleValue; if (_type == OF_NUMBER_TYPE_BOOL) return (_value.bool_ ? @"true" : @"false"); @@ -1042,11 +1042,11 @@ } return [self description]; } -- (OFDataArray*)messagePackRepresentation +- (OFDataArray *)messagePackRepresentation { OFDataArray *data; if (_type == OF_NUMBER_TYPE_BOOL) { uint8_t type; Index: src/OFObject+KeyValueCoding.m ================================================================== --- src/OFObject+KeyValueCoding.m +++ src/OFObject+KeyValueCoding.m @@ -39,11 +39,11 @@ return ret; } @implementation OFObject (KeyValueCoding) -- (id)valueForKey: (OFString*)key +- (id)valueForKey: (OFString *)key { SEL selector = sel_registerName([key UTF8String]); const char *typeEncoding = [self typeEncodingForSelector: selector]; id ret; @@ -83,11 +83,11 @@ ret = [self performSelector: selector]; break; #define CASE(encoding, type, method) \ case encoding: \ { \ - type (*getter)(id, SEL) = (type(*)(id, SEL)) \ + type (*getter)(id, SEL) = (type (*)(id, SEL)) \ [self methodForSelector: selector]; \ ret = [OFNumber method getter(self, selector)]; \ } \ break; CASE('B', bool, numberWithBool:) @@ -113,18 +113,18 @@ return [self valueForUndefinedKey: key]; return ret; } -- (id)valueForUndefinedKey: (OFString*)key +- (id)valueForUndefinedKey: (OFString *)key { @throw [OFUndefinedKeyException exceptionWithObject: self key: key]; } - (void)setValue: (id)value - forKey: (OFString*)key + forKey: (OFString *)key { size_t keyLength; char *name; SEL selector; const char *typeEncoding; @@ -176,20 +176,20 @@ switch (valueType) { case '@': case '#': { - void (*setter)(id, SEL, id) = (void(*)(id, SEL, id)) + void (*setter)(id, SEL, id) = (void (*)(id, SEL, id)) [self methodForSelector: selector]; setter(self, selector, value); } break; #define CASE(encoding, type, method) \ case encoding: \ { \ void (*setter)(id, SEL, type) = \ - (void(*)(id, SEL, type)) \ + (void (*)(id, SEL, type)) \ [self methodForSelector: selector]; \ setter(self, selector, [value method]); \ } \ break; CASE('B', bool, boolValue) @@ -212,17 +212,17 @@ return; } } - (void)setValue: (id)value - forUndefinedKey: (OFString*)key + forUndefinedKey: (OFString *)key { @throw [OFUndefinedKeyException exceptionWithObject: self key: key value: value]; } -- (void)setNilValueForKey: (OFString*)key +- (void)setNilValueForKey: (OFString *)key { @throw [OFInvalidArgumentException exception]; } @end Index: src/OFObject+Serialization.h ================================================================== --- src/OFObject+Serialization.h +++ src/OFObject+Serialization.h @@ -32,9 +32,9 @@ /*! * @brief Creates a string by serializing the receiver. * * @return The object serialized as a string */ -- (OFString*)stringBySerializing; +- (OFString *)stringBySerializing; @end OF_ASSUME_NONNULL_END Index: src/OFObject+Serialization.m ================================================================== --- src/OFObject+Serialization.m +++ src/OFObject+Serialization.m @@ -25,11 +25,11 @@ #import "OFXMLElement.h" int _OFObject_Serialization_reference; @implementation OFObject (Serialization) -- (OFString*)stringBySerializing +- (OFString *)stringBySerializing { void *pool; OFXMLElement *element; OFXMLElement *root; OFString *ret; Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -229,11 +229,11 @@ * @brief Checks whether the object conforms to the specified protocol. * * @param protocol The protocol which should be checked for conformance * @return A boolean whether the object conforms to the specified protocol */ -- (bool)conformsToProtocol: (Protocol*)protocol; +- (bool)conformsToProtocol: (Protocol *)protocol; /*! * @brief Returns the implementation for the specified selector. * * @param selector The selector for which the method should be returned @@ -245,11 +245,11 @@ * @brief Returns the type encoding for the specified selector. * * @param selector The selector for which the type encoding should be returned * @return The type encoding for the specified selector */ -- (nullable const char*)typeEncodingForSelector: (SEL)selector; +- (nullable const char *)typeEncodingForSelector: (SEL)selector; /*! * @brief Performs the specified selector. * * @param selector The selector to perform @@ -443,11 +443,11 @@ /*! * @brief Returns the name of the class as a string. * * @return The name of the class as a string */ -+ (OFString*)className; ++ (OFString *)className; /*! * @brief Returns a boolean whether the class is a subclass of the specified * class. * @@ -476,11 +476,11 @@ * @brief Checks whether the class conforms to a given protocol. * * @param protocol The protocol which should be checked for conformance * @return A boolean whether the class conforms to the specified protocol */ -+ (bool)conformsToProtocol: (Protocol*)protocol; ++ (bool)conformsToProtocol: (Protocol *)protocol; /*! * @brief Returns the implementation of the instance method for the specified * selector. * @@ -495,20 +495,20 @@ * selector. * * @param selector The selector for which the type encoding should be returned * @return The type encoding of the instance method for the specified selector */ -+ (nullable const char*)typeEncodingForInstanceSelector: (SEL)selector; ++ (nullable const char *)typeEncodingForInstanceSelector: (SEL)selector; /*! * @brief Returns a description for the class, which is usually the class name. * * This is mostly for debugging purposes. * * @return A description for the class, which is usually the class name */ -+ (OFString*)description; ++ (OFString *)description; /*! * @brief Replaces a class method with a class method from another class. * * @param selector The selector of the class method to replace @@ -541,11 +541,11 @@ * @param typeEncoding The type encoding for the new method * @return The old implementation or `nil` if the method was added */ + (nullable IMP)replaceClassMethod: (SEL)selector withImplementation: (IMP)implementation - typeEncoding: (const char*)typeEncoding; + typeEncoding: (const char *)typeEncoding; /*! * @brief Replaces or adds an instance method. * * If the method already exists, it is replaced and the old implementation @@ -557,11 +557,11 @@ * @param typeEncoding The type encoding for the new method * @return The old implementation or `nil` if the method was added */ + (nullable IMP)replaceInstanceMethod: (SEL)selector withImplementation: (IMP)implementation - typeEncoding: (const char*)typeEncoding; + typeEncoding: (const char *)typeEncoding; /*! * @brief Adds all methods from the specified class to the class that is the * receiver. * @@ -629,30 +629,30 @@ /*! * @brief Returns the name of the object's class. * * @return The name of the object's class */ -- (OFString*)className; +- (OFString *)className; /*! * @brief Returns a description for the object. * * This is mostly for debugging purposes. * * @return A description for the object */ -- (OFString*)description; +- (OFString *)description; /*! * @brief Allocates memory and stores it in the object's memory pool. * * It will be freed automatically when the object is deallocated. * * @param size The size of the memory to allocate * @return A pointer to the allocated memory */ -- (void*)allocMemoryWithSize: (size_t)size; +- (void *)allocMemoryWithSize: (size_t)size; /*! * @brief Allocates memory for the specified number of items and stores it in * the object's memory pool. * @@ -660,12 +660,12 @@ * * @param size The size of each item to allocate * @param count The number of items to allocate * @return A pointer to the allocated memory */ -- (void*)allocMemoryWithSize: (size_t)size - count: (size_t)count; +- (void *)allocMemoryWithSize: (size_t)size + count: (size_t)count; /*! * @brief Resizes memory in the object's memory pool to the specified size. * * If the pointer is NULL, this is equivalent to allocating memory. @@ -673,12 +673,12 @@ * * @param pointer A pointer to the already allocated memory * @param size The new size for the memory chunk * @return A pointer to the resized memory chunk */ -- (nullable void*)resizeMemory: (nullable void*)pointer - size: (size_t)size; +- (nullable void *)resizeMemory: (nullable void *)pointer + size: (size_t)size; /*! * @brief Resizes memory in the object's memory pool to the specific number of * items of the specified size. * @@ -688,22 +688,22 @@ * @param pointer A pointer to the already allocated memory * @param size The size of each item to resize to * @param count The number of items to resize to * @return A pointer to the resized memory chunk */ -- (nullable void*)resizeMemory: (nullable void*)pointer - size: (size_t)size - count: (size_t)count; +- (nullable void *)resizeMemory: (nullable void *)pointer + size: (size_t)size + count: (size_t)count; /*! * @brief Frees allocated memory and removes it from the object's memory pool. * * Does nothing if the pointer is NULL. * * @param pointer A pointer to the allocated memory */ -- (void)freeMemory: (nullable void*)pointer; +- (void)freeMemory: (nullable void *)pointer; /*! * @brief Deallocates the object. * * It is automatically called when the retain count reaches zero. @@ -757,11 +757,11 @@ * @param selector The selector to perform * @param thread The thread on which to perform the selector * @param waitUntilDone Whether to wait until the perform finished */ - (void)performSelector: (SEL)selector - onThread: (OFThread*)thread + onThread: (OFThread *)thread waitUntilDone: (bool)waitUntilDone; /*! * @brief Performs the specified selector on the specified thread with the * specified object. @@ -771,11 +771,11 @@ * @param object The object that is passed to the method specified by the * selector * @param waitUntilDone Whether to wait until the perform finished */ - (void)performSelector: (SEL)selector - onThread: (OFThread*)thread + onThread: (OFThread *)thread withObject: (nullable id)object waitUntilDone: (bool)waitUntilDone; /*! * @brief Performs the specified selector on the specified thread with the @@ -788,11 +788,11 @@ * @param object2 The second object that is passed to the method specified by * the selector * @param waitUntilDone Whether to wait until the perform finished */ - (void)performSelector: (SEL)selector - onThread: (OFThread*)thread + onThread: (OFThread *)thread withObject: (nullable id)object1 withObject: (nullable id)object2 waitUntilDone: (bool)waitUntilDone; /*! @@ -840,11 +840,11 @@ * @param selector The selector to perform * @param thread The thread on which to perform the selector * @param delay The delay after which the selector will be performed */ - (void)performSelector: (SEL)selector - onThread: (OFThread*)thread + onThread: (OFThread *)thread afterDelay: (of_time_interval_t)delay; /*! * @brief Performs the specified selector on the specified thread with the * specified object after the specified delay. @@ -854,11 +854,11 @@ * @param object The object that is passed to the method specified by the * selector * @param delay The delay after which the selector will be performed */ - (void)performSelector: (SEL)selector - onThread: (OFThread*)thread + onThread: (OFThread *)thread withObject: (nullable id)object afterDelay: (of_time_interval_t)delay; /*! * @brief Performs the specified selector on the specified thread with the @@ -871,11 +871,11 @@ * @param object2 The second object that is passed to the method specified by * the selector * @param delay The delay after which the selector will be performed */ - (void)performSelector: (SEL)selector - onThread: (OFThread*)thread + onThread: (OFThread *)thread withObject: (nullable id)object1 withObject: (nullable id)object2 afterDelay: (of_time_interval_t)delay; #endif Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -85,15 +85,15 @@ id owner; }; #define PRE_IVARS_ALIGN ((sizeof(struct pre_ivar) + \ (OF_BIGGEST_ALIGNMENT - 1)) & ~(OF_BIGGEST_ALIGNMENT - 1)) -#define PRE_IVARS ((struct pre_ivar*)(void*)((char*)self - PRE_IVARS_ALIGN)) +#define PRE_IVARS ((struct pre_ivar *)(void *)((char *)self - PRE_IVARS_ALIGN)) #define PRE_MEM_ALIGN ((sizeof(struct pre_mem) + \ (OF_BIGGEST_ALIGNMENT - 1)) & ~(OF_BIGGEST_ALIGNMENT - 1)) -#define PRE_MEM(mem) ((struct pre_mem*)(void*)((char*)mem - PRE_MEM_ALIGN)) +#define PRE_MEM(mem) ((struct pre_mem *)(void *)((char *)mem - PRE_MEM_ALIGN)) static struct { Class isa; } allocFailedException; @@ -166,40 +166,40 @@ if OF_UNLIKELY (instance == nil) { allocFailedException.isa = [OFAllocFailedException class]; @throw (id)&allocFailedException; } - ((struct pre_ivar*)instance)->retainCount = 1; - ((struct pre_ivar*)instance)->firstMem = NULL; - ((struct pre_ivar*)instance)->lastMem = NULL; + ((struct pre_ivar *)instance)->retainCount = 1; + ((struct pre_ivar *)instance)->firstMem = NULL; + ((struct pre_ivar *)instance)->lastMem = NULL; #if !defined(OF_HAVE_ATOMIC_OPS) && defined(OF_HAVE_THREADS) if OF_UNLIKELY (!of_spinlock_new( - &((struct pre_ivar*)instance)->retainCountSpinlock)) { + &((struct pre_ivar *)instance)->retainCountSpinlock)) { free(instance); @throw [OFInitializationFailedException exceptionWithClass: class]; } #endif - instance = (OFObject*)((char*)instance + PRE_IVARS_ALIGN); + instance = (OFObject *)(void *)((char *)instance + PRE_IVARS_ALIGN); memset(instance, 0, instanceSize); if (!objc_constructInstance(class, instance)) { - free((char*)instance - PRE_IVARS_ALIGN); + free((char *)instance - PRE_IVARS_ALIGN); @throw [OFInitializationFailedException exceptionWithClass: class]; } if OF_UNLIKELY (extra != NULL) - *extra = (char*)instance + instanceSize + extraAlignment; + *extra = (char *)instance + instanceSize + extraAlignment; return instance; } -const char* +const char * _NSPrintForDebugger(id object) { return [[object description] cStringWithEncoding: [OFLocalization encoding]]; } @@ -228,12 +228,12 @@ * * Unfortunately, there is no way to check if a forward handler has * already been set, so this is the best we can do. */ if (&NSFoundationVersionNumber == NULL) - objc_setForwardHandler((void*)&of_forward, - (void*)&of_forward_stret); + objc_setForwardHandler((void *)&of_forward, + (void *)&of_forward_stret); #else objc_setForwardHandler((IMP)&of_forward, (IMP)&of_forward_stret); #endif objc_setEnumerationMutationHandler(enumerationMutationHandler); @@ -278,11 +278,11 @@ + (Class)class { return self; } -+ (OFString*)className ++ (OFString *)className { return [OFString stringWithCString: class_getName(self) encoding: OF_STRING_ENCODING_ASCII]; } @@ -303,11 +303,11 @@ + (bool)instancesRespondToSelector: (SEL)selector { return class_respondsToSelector(self, selector); } -+ (bool)conformsToProtocol: (Protocol*)protocol ++ (bool)conformsToProtocol: (Protocol *)protocol { Class c; for (c = self; c != Nil; c = class_getSuperclass(c)) if (class_conformsToProtocol(c, protocol)) @@ -319,11 +319,11 @@ + (IMP)instanceMethodForSelector: (SEL)selector { return class_getMethodImplementation(self, selector); } -+ (const char*)typeEncodingForInstanceSelector: (SEL)selector ++ (const char *)typeEncodingForInstanceSelector: (SEL)selector { #if defined(OF_OBJFW_RUNTIME) return class_getMethodTypeEncoding(self, selector); #else Method m; @@ -333,11 +333,11 @@ return method_getTypeEncoding(m); #endif } -+ (OFString*)description ++ (OFString *)description { return [self className]; } + (IMP)replaceClassMethod: (SEL)selector @@ -368,19 +368,19 @@ typeEncoding: typeEncoding]; } + (IMP)replaceInstanceMethod: (SEL)selector withImplementation: (IMP)implementation - typeEncoding: (const char*)typeEncoding + typeEncoding: (const char *)typeEncoding { return class_replaceMethod(self, selector, implementation, typeEncoding); } + (IMP)replaceClassMethod: (SEL)selector withImplementation: (IMP)implementation - typeEncoding: (const char*)typeEncoding + typeEncoding: (const char *)typeEncoding { return class_replaceMethod(object_getClass(self), selector, implementation, typeEncoding); } @@ -499,11 +499,11 @@ - (Class)superclass { return class_getSuperclass(object_getClass(self)); } -- (OFString*)className +- (OFString *)className { return [OFString stringWithCString: object_getClassName(self) encoding: OF_STRING_ENCODING_ASCII]; } @@ -525,11 +525,11 @@ - (bool)respondsToSelector: (SEL)selector { return class_respondsToSelector(object_getClass(self), selector); } -- (bool)conformsToProtocol: (Protocol*)protocol +- (bool)conformsToProtocol: (Protocol *)protocol { return [object_getClass(self) conformsToProtocol: protocol]; } - (IMP)methodForSelector: (SEL)selector @@ -538,13 +538,13 @@ } - (id)performSelector: (SEL)selector { #if defined(OF_OBJFW_RUNTIME) - id (*imp)(id, SEL) = (id(*)(id, SEL))objc_msg_lookup(self, selector); + id (*imp)(id, SEL) = (id (*)(id, SEL))objc_msg_lookup(self, selector); #elif defined(OF_APPLE_RUNTIME) - id (*imp)(id, SEL) = (id(*)(id, SEL))objc_msgSend; + id (*imp)(id, SEL) = (id (*)(id, SEL))objc_msgSend; #endif return imp(self, selector); } @@ -551,13 +551,13 @@ - (id)performSelector: (SEL)selector withObject: (id)object { #if defined(OF_OBJFW_RUNTIME) id (*imp)(id, SEL, id) = - (id(*)(id, SEL, id))objc_msg_lookup(self, selector); + (id (*)(id, SEL, id))objc_msg_lookup(self, selector); #elif defined(OF_APPLE_RUNTIME) - id (*imp)(id, SEL, id) = (id(*)(id, SEL, id))objc_msgSend; + id (*imp)(id, SEL, id) = (id (*)(id, SEL, id))objc_msgSend; #endif return imp(self, selector, object); } @@ -565,13 +565,13 @@ withObject: (id)object1 withObject: (id)object2 { #if defined(OF_OBJFW_RUNTIME) id (*imp)(id, SEL, id, id) = - (id(*)(id, SEL, id, id))objc_msg_lookup(self, selector); + (id (*)(id, SEL, id, id))objc_msg_lookup(self, selector); #elif defined(OF_APPLE_RUNTIME) - id (*imp)(id, SEL, id, id) = (id(*)(id, SEL, id, id))objc_msgSend; + id (*imp)(id, SEL, id, id) = (id (*)(id, SEL, id, id))objc_msgSend; #endif return imp(self, selector, object1, object2); } @@ -620,11 +620,11 @@ objc_autoreleasePoolPop(pool); } #ifdef OF_HAVE_THREADS - (void)performSelector: (SEL)selector - onThread: (OFThread*)thread + onThread: (OFThread *)thread waitUntilDone: (bool)waitUntilDone { void *pool = objc_autoreleasePoolPush(); OFTimer *timer = [OFTimer timerWithTimeInterval: 0 target: self @@ -637,11 +637,11 @@ objc_autoreleasePoolPop(pool); } - (void)performSelector: (SEL)selector - onThread: (OFThread*)thread + onThread: (OFThread *)thread withObject: (id)object waitUntilDone: (bool)waitUntilDone { void *pool = objc_autoreleasePoolPush(); OFTimer *timer = [OFTimer timerWithTimeInterval: 0 @@ -656,11 +656,11 @@ objc_autoreleasePoolPop(pool); } - (void)performSelector: (SEL)selector - onThread: (OFThread*)thread + onThread: (OFThread *)thread withObject: (id)object1 withObject: (id)object2 waitUntilDone: (bool)waitUntilDone { void *pool = objc_autoreleasePoolPush(); @@ -731,11 +731,11 @@ objc_autoreleasePoolPop(pool); } - (void)performSelector: (SEL)selector - onThread: (OFThread*)thread + onThread: (OFThread *)thread afterDelay: (of_time_interval_t)delay { void *pool = objc_autoreleasePoolPush(); [[thread runLoop] addTimer: [OFTimer timerWithTimeInterval: delay @@ -745,11 +745,11 @@ objc_autoreleasePoolPop(pool); } - (void)performSelector: (SEL)selector - onThread: (OFThread*)thread + onThread: (OFThread *)thread withObject: (id)object afterDelay: (of_time_interval_t)delay { void *pool = objc_autoreleasePoolPush(); @@ -761,11 +761,11 @@ objc_autoreleasePoolPop(pool); } - (void)performSelector: (SEL)selector - onThread: (OFThread*)thread + onThread: (OFThread *)thread withObject: (id)object1 withObject: (id)object2 afterDelay: (of_time_interval_t)delay { void *pool = objc_autoreleasePoolPush(); @@ -779,11 +779,11 @@ objc_autoreleasePoolPop(pool); } #endif -- (const char*)typeEncodingForSelector: (SEL)selector +- (const char *)typeEncodingForSelector: (SEL)selector { #if defined(OF_OBJFW_RUNTIME) return class_getMethodTypeEncoding(object_getClass(self), selector); #else Method m; @@ -816,18 +816,18 @@ OF_HASH_FINALIZE(hash); return hash; } -- (OFString*)description +- (OFString *)description { /* Classes containing data should reimplement this! */ return [OFString stringWithFormat: @"<%@>", [self className]]; } -- (void*)allocMemoryWithSize: (size_t)size +- (void *)allocMemoryWithSize: (size_t)size { void *pointer; struct pre_mem *preMem; if OF_UNLIKELY (size == 0) @@ -850,24 +850,24 @@ if OF_UNLIKELY (PRE_IVARS->firstMem == NULL) PRE_IVARS->firstMem = preMem; PRE_IVARS->lastMem = preMem; - return (char*)pointer + PRE_MEM_ALIGN; + return (char *)pointer + PRE_MEM_ALIGN; } -- (void*)allocMemoryWithSize: (size_t)size - count: (size_t)count +- (void *)allocMemoryWithSize: (size_t)size + count: (size_t)count { if OF_UNLIKELY (count > SIZE_MAX / size) @throw [OFOutOfRangeException exception]; return [self allocMemoryWithSize: size * count]; } -- (void*)resizeMemory: (void*)pointer - size: (size_t)size +- (void *)resizeMemory: (void *)pointer + size: (size_t)size { void *new; struct pre_mem *preMem; if OF_UNLIKELY (pointer == NULL) @@ -899,16 +899,16 @@ PRE_IVARS->firstMem = preMem; if OF_UNLIKELY (PRE_IVARS->lastMem == PRE_MEM(pointer)) PRE_IVARS->lastMem = preMem; } - return (char*)new + PRE_MEM_ALIGN; + return (char *)new + PRE_MEM_ALIGN; } -- (void*)resizeMemory: (void*)pointer - size: (size_t)size - count: (size_t)count +- (void *)resizeMemory: (void *)pointer + size: (size_t)size + count: (size_t)count { if OF_UNLIKELY (pointer == NULL) return [self allocMemoryWithSize: size count: count]; @@ -922,11 +922,11 @@ return [self resizeMemory: pointer size: size * count]; } -- (void)freeMemory: (void*)pointer +- (void)freeMemory: (void *)pointer { if OF_UNLIKELY (pointer == NULL) return; if OF_UNLIKELY (PRE_MEM(pointer)->owner != self) @@ -1048,25 +1048,25 @@ free(iter); iter = next; } - free((char*)self - PRE_IVARS_ALIGN); + free((char *)self - PRE_IVARS_ALIGN); } /* Required to use properties with the Apple runtime */ -- copyWithZone: (void*)zone +- copyWithZone: (void *)zone { if OF_UNLIKELY (zone != NULL) { [self doesNotRecognizeSelector: _cmd]; abort(); } return [(id)self copy]; } -- mutableCopyWithZone: (void*)zone +- mutableCopyWithZone: (void *)zone { if OF_UNLIKELY (zone != NULL) { [self doesNotRecognizeSelector: _cmd]; abort(); } @@ -1076,35 +1076,35 @@ /* * Those are needed as the root class is the superclass of the root class's * metaclass and thus instance methods can be sent to class objects as well. */ -+ (void*)allocMemoryWithSize: (size_t)size ++ (void *)allocMemoryWithSize: (size_t)size { OF_UNRECOGNIZED_SELECTOR } -+ (void*)allocMemoryWithSize: (size_t)size ++ (void *)allocMemoryWithSize: (size_t)size count: (size_t)count { OF_UNRECOGNIZED_SELECTOR } -+ (void*)resizeMemory: (void*)pointer - size: (size_t)size ++ (void *)resizeMemory: (void *)pointer + size: (size_t)size { OF_UNRECOGNIZED_SELECTOR } -+ (void*)resizeMemory: (void*)pointer - size: (size_t)size - count: (size_t)count ++ (void *)resizeMemory: (void *)pointer + size: (size_t)size + count: (size_t)count { OF_UNRECOGNIZED_SELECTOR } -+ (void)freeMemory: (void*)pointer ++ (void)freeMemory: (void *)pointer { OF_UNRECOGNIZED_SELECTOR } + retain @@ -1134,21 +1134,21 @@ + copy { return self; } -+ mutableCopyWithZone: (void*)zone ++ mutableCopyWithZone: (void *)zone { OF_UNRECOGNIZED_SELECTOR } /* Required to use ObjFW from Swift */ -+ allocWithZone: (void*)zone ++ allocWithZone: (void *)zone { if OF_UNLIKELY (zone != NULL) { [self doesNotRecognizeSelector: _cmd]; abort(); } return [self alloc]; } @end Index: src/OFOptionsParser.h ================================================================== --- src/OFOptionsParser.h +++ src/OFOptionsParser.h @@ -52,12 +52,12 @@ * been specified. */ bool *_Nullable isSpecifiedPtr; /*! - * An optional pointer to an @ref OFString* that is set to the argument - * specified for the option or `nil` for no argument. + * An optional pointer to an @ref OFString * that is set to the + * argument specified for the option or `nil` for no argument. */ OFString *__autoreleasing _Nullable *_Nullable argumentPtr; } of_options_parser_option_t; /*! @@ -67,11 +67,11 @@ */ @interface OFOptionsParser: OFObject { of_options_parser_option_t *_options; OFMapTable *_longOptions; - OFArray OF_GENERIC(OFString*) *_arguments; + OFArray OF_GENERIC(OFString *) *_arguments; size_t _index, _subIndex; of_unichar_t _lastOption; OFString *_lastLongOption, *_argument; bool _done; } @@ -116,11 +116,11 @@ * accepted options, terminated with an option whose short * option is `\0` and long option is `nil`. * * @return A new, autoreleased OFOptionsParser */ -+ (instancetype)parserWithOptions: (const of_options_parser_option_t*)options; ++ (instancetype)parserWithOptions: (const of_options_parser_option_t *)options; /*! * @brief Initializes an already allocated OFOptionsParser so that it accepts * the specified options. * @@ -128,11 +128,11 @@ * accepted options, terminated with an option whose short * option is `\0` and long option is `nil`. * * @return An initialized OFOptionsParser */ -- initWithOptions: (const of_options_parser_option_t*)options; +- initWithOptions: (const of_options_parser_option_t *)options; /*! * @brief Returns the next option. * * If the option is only available as a long option, `-` is returned. @@ -155,9 +155,9 @@ /*! * @brief Returns the arguments following the last option. * * @return The arguments following the last option */ -- (OFArray OF_GENERIC(OFString*)*)remainingArguments; +- (OFArray OF_GENERIC(OFString *) *)remainingArguments; @end OF_ASSUME_NONNULL_END Index: src/OFOptionsParser.m ================================================================== --- src/OFOptionsParser.m +++ src/OFOptionsParser.m @@ -24,34 +24,34 @@ #import "OFInvalidArgumentException.h" static uint32_t stringHash(void *object) { - return [(OFString*)object hash]; + return [(OFString *)object hash]; } static bool stringEqual(void *object1, void *object2) { - return [(OFString*)object1 isEqual: (OFString*)object2]; + return [(OFString *)object1 isEqual: (OFString *)object2]; } @implementation OFOptionsParser @synthesize lastOption = _lastOption, lastLongOption = _lastLongOption; @synthesize argument = _argument; -+ (instancetype)parserWithOptions: (const of_options_parser_option_t*)options ++ (instancetype)parserWithOptions: (const of_options_parser_option_t *)options { return [[[self alloc] initWithOptions: options] autorelease]; } - init { OF_INVALID_INIT_METHOD } -- initWithOptions: (const of_options_parser_option_t*)options +- initWithOptions: (const of_options_parser_option_t *)options { self = [super init]; @try { size_t count = 0; @@ -273,11 +273,11 @@ } return '?'; } -- (OFArray*)remainingArguments +- (OFArray *)remainingArguments { return [_arguments objectsInRange: of_range(_index, [_arguments count] - _index)]; } @end Index: src/OFPlugin.h ================================================================== --- src/OFPlugin.h +++ src/OFPlugin.h @@ -20,11 +20,11 @@ #ifndef OF_WINDOWS # include # define OF_RTLD_LAZY RTLD_LAZY # define OF_RTLD_NOW RTLD_NOW -typedef void* of_plugin_handle_t; +typedef void *of_plugin_handle_t; #else # include # define OF_RTLD_LAZY 0 # define OF_RTLD_NOW 0 typedef HMODULE of_plugin_handle_t; @@ -46,19 +46,19 @@ * @brief Loads a plugin from a file. * * @param path Path to the plugin file. The suffix is appended automatically. * @return The loaded plugin */ -+ (OF_KINDOF(OFPlugin*))pluginFromFile: (OFString*)path; ++ (OF_KINDOF(OFPlugin *))pluginFromFile: (OFString *)path; @end #ifdef __cplusplus extern "C" { #endif extern of_plugin_handle_t of_dlopen(OFString *path, int flags); -extern void* of_dlsym(of_plugin_handle_t handle, const char *symbol); +extern void *of_dlsym(of_plugin_handle_t handle, const char *symbol); extern void of_dlclose(of_plugin_handle_t handle); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/OFPlugin.m ================================================================== --- src/OFPlugin.m +++ src/OFPlugin.m @@ -27,11 +27,11 @@ #import "OFString.h" #import "OFLocalization.h" #import "OFInitializationFailedException.h" -typedef OFPlugin* (*init_plugin_t)(void); +typedef OFPlugin *(*init_plugin_t)(void); of_plugin_handle_t of_dlopen(OFString *path, int flags) { #ifndef OF_WINDOWS @@ -43,17 +43,17 @@ return LoadLibraryW([path UTF16String]); #endif } -void* +void * of_dlsym(of_plugin_handle_t handle, const char *symbol) { #ifndef OF_WINDOWS return dlsym(handle, symbol); #else - return (void*)(uintptr_t)GetProcAddress(handle, symbol); + return (void *)(uintptr_t)GetProcAddress(handle, symbol); #endif } void of_dlclose(of_plugin_handle_t handle) @@ -64,11 +64,11 @@ FreeLibrary(handle); #endif } @implementation OFPlugin -+ (id)pluginFromFile: (OFString*)path ++ (id)pluginFromFile: (OFString *)path { void *pool = objc_autoreleasePoolPush(); of_plugin_handle_t handle; init_plugin_t initPlugin; OFPlugin *plugin; Index: src/OFProcess.h ================================================================== --- src/OFProcess.h +++ src/OFProcess.h @@ -58,11 +58,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. */ -+ (instancetype)processWithProgram: (OFString*)program; ++ (instancetype)processWithProgram: (OFString *)program; /*! * @brief Creates a new OFProcess with the specified program and arguments and * invokes the program. * @@ -70,12 +70,12 @@ * search path specified in PATH is used. * @param arguments The arguments to pass to the program, or `nil` * @return A new, autoreleased OFProcess. */ + (instancetype) - processWithProgram: (OFString*)program - arguments: (nullable OFArray OF_GENERIC(OFString*)*)arguments; + processWithProgram: (OFString *)program + arguments: (nullable OFArray OF_GENERIC(OFString *) *)arguments; /*! * @brief Creates a new OFProcess with the specified program, program name and * arguments and invokes the program. * @@ -85,13 +85,13 @@ * Usually, this is equal to program. * @param arguments The arguments to pass to the program, or `nil` * @return A new, autoreleased OFProcess. */ + (instancetype) - processWithProgram: (OFString*)program - programName: (OFString*)programName - arguments: (nullable OFArray OF_GENERIC(OFString*)*)arguments; + processWithProgram: (OFString *)program + programName: (OFString *)programName + arguments: (nullable OFArray OF_GENERIC(OFString *) *)arguments; /*! * @brief Creates a new OFProcess with the specified program, program name, * arguments and environment and invokes the program. * @@ -106,25 +106,25 @@ * existing environment, you need to get the existing * environment first, copy it, modify it and then pass it. * @return A new, autoreleased OFProcess. */ + (instancetype) - processWithProgram: (OFString*)program - programName: (OFString*)programName - arguments: (nullable OFArray OF_GENERIC(OFString*)*)arguments + processWithProgram: (OFString *)program + programName: (OFString *)programName + arguments: (nullable OFArray OF_GENERIC(OFString *) *)arguments environment: (nullable OFDictionary - OF_GENERIC(OFString*, OFString*)*)environment; + OF_GENERIC(OFString *, OFString *) *)environment; /*! * @brief Initializes an already allocated OFProcess with the specified program * and invokes the program. * * @param program The program to execute. If it does not start with a slash, the * search path specified in PATH is used. * @return An initialized OFProcess. */ -- initWithProgram: (OFString*)program; +- initWithProgram: (OFString *)program; /*! * @brief Initializes an already allocated OFProcess with the specified program * and arguments and invokes the program. * @@ -131,12 +131,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 An initialized OFProcess. */ -- initWithProgram: (OFString*)program - arguments: (nullable OFArray OF_GENERIC(OFString*)*)arguments; +- initWithProgram: (OFString *)program + arguments: (nullable OFArray OF_GENERIC(OFString *) *)arguments; /*! * @brief Initializes an already allocated OFProcess with the specified program, * program name and arguments and invokes the program. * @@ -145,13 +145,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 An initialized OFProcess. */ -- initWithProgram: (OFString*)program - programName: (OFString*)programName - arguments: (nullable OFArray OF_GENERIC(OFString*)*)arguments; +- initWithProgram: (OFString *)program + programName: (OFString *)programName + arguments: (nullable OFArray OF_GENERIC(OFString *) *)arguments; /*! * @brief Initializes an already allocated OFProcess with the specified program, * program name, arguments and environment and invokes the program. * @@ -165,15 +165,15 @@ * override the environment. If you want to add to the * existing environment, you need to get the existing * environment first, copy it, modify it and then pass it. * @return An initialized OFProcess. */ -- initWithProgram: (OFString*)program - programName: (OFString*)programName - arguments: (nullable OFArray OF_GENERIC(OFString*)*)arguments +- initWithProgram: (OFString *)program + programName: (OFString *)programName + arguments: (nullable OFArray OF_GENERIC(OFString *) *)arguments environment: (nullable OFDictionary - OF_GENERIC(OFString*, OFString*)*)environment; + OF_GENERIC(OFString *, OFString *) *)environment; /*! * @brief Closes the write direction of the process. * * This method needs to be called for some programs before data can be read, Index: src/OFProcess.m ================================================================== --- src/OFProcess.m +++ src/OFProcess.m @@ -56,45 +56,45 @@ extern char **environ; #endif @interface OFProcess () #ifndef OF_WINDOWS -- (void)OF_getArgV: (char***)argv - forProgramName: (OFString*)programName - andArguments: (OFArray*)arguments; -- (char**)OF_environmentForDictionary: (OFDictionary*)dictionary; +- (void)OF_getArgV: (char ***)argv + forProgramName: (OFString *)programName + andArguments: (OFArray *)arguments; +- (char **)OF_environmentForDictionary: (OFDictionary *)dictionary; #else -- (of_char16_t*)OF_environmentForDictionary: (OFDictionary*)dictionary; +- (of_char16_t *)OF_environmentForDictionary: (OFDictionary *)dictionary; #endif @end @implementation OFProcess -+ (instancetype)processWithProgram: (OFString*)program ++ (instancetype)processWithProgram: (OFString *)program { return [[[self alloc] initWithProgram: program] autorelease]; } -+ (instancetype)processWithProgram: (OFString*)program - arguments: (OFArray*)arguments ++ (instancetype)processWithProgram: (OFString *)program + arguments: (OFArray *)arguments { return [[[self alloc] initWithProgram: program arguments: arguments] autorelease]; } -+ (instancetype)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]; } -+ (instancetype)processWithProgram: (OFString*)program - programName: (OFString*)programName - arguments: (OFArray*)arguments - environment: (OFDictionary*)environment ++ (instancetype)processWithProgram: (OFString *)program + programName: (OFString *)programName + arguments: (OFArray *)arguments + environment: (OFDictionary *)environment { return [[[self alloc] initWithProgram: program programName: programName arguments: arguments environment: environment] autorelease]; @@ -103,41 +103,41 @@ - init { OF_INVALID_INIT_METHOD } -- initWithProgram: (OFString*)program +- initWithProgram: (OFString *)program { return [self initWithProgram: program programName: program arguments: nil environment: nil]; } -- initWithProgram: (OFString*)program - arguments: (OFArray*)arguments +- initWithProgram: (OFString *)program + arguments: (OFArray *)arguments { return [self initWithProgram: program programName: program arguments: arguments environment: nil]; } -- initWithProgram: (OFString*)program - programName: (OFString*)programName - arguments: (OFArray*)arguments +- initWithProgram: (OFString *)program + programName: (OFString *)programName + arguments: (OFArray *)arguments { return [self initWithProgram: program programName: program arguments: arguments environment: nil]; } -- initWithProgram: (OFString*)program - programName: (OFString*)programName - arguments: (OFArray*)arguments - environment: (OFDictionary*)environment +- initWithProgram: (OFString *)program + programName: (OFString *)programName + arguments: (OFArray *)arguments + environment: (OFDictionary *)environment { self = [super init]; @try { #ifndef OF_WINDOWS @@ -336,33 +336,33 @@ [super dealloc]; } #ifndef OF_WINDOWS -- (void)OF_getArgV: (char***)argv - forProgramName: (OFString*)programName - andArguments: (OFArray*)arguments +- (void)OF_getArgV: (char ***)argv + forProgramName: (OFString *)programName + andArguments: (OFArray *)arguments { OFString *const *objects = [arguments objects]; size_t i, count = [arguments count]; of_string_encoding_t encoding; - *argv = [self allocMemoryWithSize: sizeof(char*) + *argv = [self allocMemoryWithSize: sizeof(char *) count: count + 2]; encoding = [OFLocalization encoding]; - (*argv)[0] = (char*)[programName cStringWithEncoding: encoding]; + (*argv)[0] = (char *)[programName cStringWithEncoding: encoding]; for (i = 0; i < count; i++) (*argv)[i + 1] = - (char*)[objects[i] cStringWithEncoding: encoding]; + (char *)[objects[i] cStringWithEncoding: encoding]; (*argv)[i + 1] = NULL; } -- (char**)OF_environmentForDictionary: (OFDictionary*)environment +- (char **)OF_environmentForDictionary: (OFDictionary *)environment { OFEnumerator *keyEnumerator, *objectEnumerator; char **envp; size_t i, count; of_string_encoding_t encoding; @@ -371,11 +371,11 @@ return NULL; encoding = [OFLocalization encoding]; count = [environment count]; - envp = [self allocMemoryWithSize: sizeof(char*) + envp = [self allocMemoryWithSize: sizeof(char *) count: count + 1]; keyEnumerator = [environment keyEnumerator]; objectEnumerator = [environment objectEnumerator]; @@ -402,11 +402,11 @@ envp[i] = NULL; return envp; } #else -- (of_char16_t*)OF_environmentForDictionary: (OFDictionary*)environment +- (of_char16_t *)OF_environmentForDictionary: (OFDictionary *)environment { OFDataArray *env; OFEnumerator *keyEnumerator, *objectEnumerator; OFString *key, *object; const of_char16_t equal = '='; @@ -447,11 +447,11 @@ return true; return _atEndOfStream; } -- (size_t)lowlevelReadIntoBuffer: (void*)buffer +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { #ifndef OF_WINDOWS ssize_t ret; @@ -488,11 +488,11 @@ _atEndOfStream = true; return ret; } -- (void)lowlevelWriteBuffer: (const void*)buffer +- (void)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { #ifndef OF_WINDOWS if (_writePipe[1] == -1 || _atEndOfStream) @throw [OFWriteFailedException exceptionWithObject: self Index: src/OFRIPEMD160Hash.m ================================================================== --- src/OFRIPEMD160Hash.m +++ src/OFRIPEMD160Hash.m @@ -180,11 +180,11 @@ _state[2] = 0x98BADCFE; _state[3] = 0x10325476; _state[4] = 0xC3D2E1F0; } -- (void)updateWithBuffer: (const void*)buffer_ +- (void)updateWithBuffer: (const void *)buffer_ length: (size_t)length { const uint8_t *buffer = buffer_; if (_calculated) @@ -210,14 +210,14 @@ _bufferLength = 0; } } } -- (const unsigned char*)digest +- (const unsigned char *)digest { if (_calculated) - return (const uint8_t*)_state; + return (const uint8_t *)_state; _buffer.bytes[_bufferLength] = 0x80; memset(_buffer.bytes + _bufferLength + 1, 0, 64 - _bufferLength - 1); if (_bufferLength >= 56) { @@ -231,11 +231,11 @@ processBlock(_state, _buffer.words); memset(&_buffer, 0, sizeof(_buffer)); byteSwapVectorIfBE(_state, 5); _calculated = true; - return (const uint8_t*)_state; + return (const uint8_t *)_state; } - (void)reset { [self OF_resetState]; Index: src/OFRecursiveMutex.m ================================================================== --- src/OFRecursiveMutex.m +++ src/OFRecursiveMutex.m @@ -73,14 +73,14 @@ { if (!of_rmutex_unlock(&_rmutex)) @throw [OFUnlockFailedException exceptionWithLock: self]; } -- (OFString*)description +- (OFString *)description { if (_name == nil) return [super description]; return [OFString stringWithFormat: @"<%@: %@>", [self className], _name]; } @end Index: src/OFRunLoop+Private.h ================================================================== --- src/OFRunLoop+Private.h +++ src/OFRunLoop+Private.h @@ -21,56 +21,56 @@ #endif OF_ASSUME_NONNULL_BEGIN @interface OFRunLoop () -+ (void)OF_setMainRunLoop: (OFRunLoop*)runLoop; ++ (void)OF_setMainRunLoop: (OFRunLoop *)runLoop; #ifdef OF_HAVE_SOCKETS -+ (void)OF_addAsyncReadForStream: (OFStream*)stream - buffer: (void*)buffer ++ (void)OF_addAsyncReadForStream: (OFStream *)stream + buffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector; -+ (void)OF_addAsyncReadForStream: (OFStream*)stream - buffer: (void*)buffer ++ (void)OF_addAsyncReadForStream: (OFStream *)stream + buffer: (void *)buffer exactLength: (size_t)length target: (id)target selector: (SEL)selector; -+ (void)OF_addAsyncReadLineForStream: (OFStream*)stream ++ (void)OF_addAsyncReadLineForStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding target: (id)target selector: (SEL)selector; -+ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket*)socket ++ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket *)socket target: (id)target selector: (SEL)selector; -+ (void)OF_addAsyncReceiveForUDPSocket: (OFUDPSocket*)socket - buffer: (void*)buffer ++ (void)OF_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket + buffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector; # ifdef OF_HAVE_BLOCKS -+ (void)OF_addAsyncReadForStream: (OFStream*)stream - buffer: (void*)buffer ++ (void)OF_addAsyncReadForStream: (OFStream *)stream + buffer: (void *)buffer length: (size_t)length block: (of_stream_async_read_block_t)block; -+ (void)OF_addAsyncReadForStream: (OFStream*)stream - buffer: (void*)buffer ++ (void)OF_addAsyncReadForStream: (OFStream *)stream + buffer: (void *)buffer exactLength: (size_t)length block: (of_stream_async_read_block_t)block; -+ (void)OF_addAsyncReadLineForStream: (OFStream*)stream ++ (void)OF_addAsyncReadLineForStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding block: (of_stream_async_read_line_block_t)block; -+ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket*)socket ++ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket *)socket block: (of_tcp_socket_async_accept_block_t) block; -+ (void)OF_addAsyncReceiveForUDPSocket: (OFUDPSocket*)socket - buffer: (void*)buffer ++ (void)OF_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket + buffer: (void *)buffer length: (size_t)length block: (of_udp_socket_async_receive_block_t) block; # endif + (void)OF_cancelAsyncRequestsForObject: (id)object; #endif -- (void)OF_removeTimer: (OFTimer*)timer; +- (void)OF_removeTimer: (OFTimer *)timer; @end OF_ASSUME_NONNULL_END Index: src/OFRunLoop.h ================================================================== --- src/OFRunLoop.h +++ src/OFRunLoop.h @@ -59,25 +59,25 @@ /*! * @brief Returns the run loop for the main thread. * * @return The run loop for the main thread */ -+ (OFRunLoop*)mainRunLoop; ++ (OFRunLoop *)mainRunLoop; /*! * @brief Returns the run loop for the current thread. * * @return The run loop for the current thread */ -+ (OFRunLoop*)currentRunLoop; ++ (OFRunLoop *)currentRunLoop; /*! * @brief Adds an OFTimer to the run loop. * * @param timer The timer to add */ -- (void)addTimer: (OFTimer*)timer; +- (void)addTimer: (OFTimer *)timer; /*! * @brief Starts the run loop. */ - (void)run; @@ -85,15 +85,15 @@ /*! * @brief Run the run loop until the specified deadline. * * @param deadline The date until which the run loop should run */ -- (void)runUntilDate: (nullable OFDate*)deadline; +- (void)runUntilDate: (nullable OFDate *)deadline; /*! * @brief Stops the run loop. If there is still an operation being executed, it * is finished before the run loop stops. */ - (void)stop; @end OF_ASSUME_NONNULL_END Index: src/OFRunLoop.m ================================================================== --- src/OFRunLoop.m +++ src/OFRunLoop.m @@ -130,12 +130,13 @@ # ifdef OF_HAVE_BLOCKS if (_block != NULL) return _block(object, _buffer, length, exception); else { # endif - bool (*func)(id, SEL, OFStream*, void*, size_t, OFException*) = - (bool(*)(id, SEL, OFStream*, void*, size_t, OFException*)) + bool (*func)(id, SEL, OFStream *, void *, size_t, + OFException *) = (bool (*)(id, SEL, OFStream *, void *, + size_t, OFException *)) [_target methodForSelector: _selector]; return func(_target, _selector, object, _buffer, length, exception); # ifdef OF_HAVE_BLOCKS @@ -158,11 +159,11 @@ { size_t length; OFException *exception = nil; @try { - length = [object readIntoBuffer: (char*)_buffer + _readLength + length = [object readIntoBuffer: (char *)_buffer + _readLength length: _exactLength - _readLength]; } @catch (OFException *e) { length = 0; exception = e; } @@ -180,12 +181,13 @@ _readLength = 0; return true; } else { # endif - bool (*func)(id, SEL, OFStream*, void*, size_t, OFException*) = - (bool(*)(id, SEL, OFStream*, void*, size_t, OFException*)) + bool (*func)(id, SEL, OFStream *, void *, size_t, + OFException *) = (bool (*)(id, SEL, OFStream *, void *, + size_t, OFException *)) [_target methodForSelector: _selector]; if (!func(_target, _selector, object, _buffer, _readLength, exception)) return false; @@ -226,12 +228,12 @@ # ifdef OF_HAVE_BLOCKS if (_block != NULL) return _block(object, line, exception); else { # endif - bool (*func)(id, SEL, OFStream*, OFString*, OFException*) = - (bool(*)(id, SEL, OFStream*, OFString*, OFException*)) + bool (*func)(id, SEL, OFStream *, OFString *, OFException *) = + (bool (*)(id, SEL, OFStream *, OFString *, OFException *)) [_target methodForSelector: _selector]; return func(_target, _selector, object, line, exception); # ifdef OF_HAVE_BLOCKS } @@ -264,13 +266,13 @@ # ifdef OF_HAVE_BLOCKS if (_block != NULL) return _block(object, newSocket, exception); else { # endif - bool (*func)(id, SEL, OFTCPSocket*, OFTCPSocket*, - OFException*) = - (bool(*)(id, SEL, OFTCPSocket*, OFTCPSocket*, OFException*)) + bool (*func)(id, SEL, OFTCPSocket *, OFTCPSocket *, + OFException *) = (bool (*)(id, SEL, OFTCPSocket *, + OFTCPSocket *, OFException *)) [_target methodForSelector: _selector]; return func(_target, _selector, object, newSocket, exception); # ifdef OF_HAVE_BLOCKS } @@ -306,14 +308,14 @@ # ifdef OF_HAVE_BLOCKS if (_block != NULL) return _block(object, _buffer, length, address, exception); else { # endif - bool (*func)(id, SEL, OFUDPSocket*, void*, size_t, - of_udp_socket_address_t address, OFException*) = - (bool(*)(id, SEL, OFUDPSocket*, void*, size_t, - of_udp_socket_address_t, OFException*)) + bool (*func)(id, SEL, OFUDPSocket *, void *, size_t, + of_udp_socket_address_t address, OFException *) = + (bool (*)(id, SEL, OFUDPSocket *, void *, size_t, + of_udp_socket_address_t, OFException *)) [_target methodForSelector: _selector]; return func(_target, _selector, object, _buffer, length, address, exception); # ifdef OF_HAVE_BLOCKS @@ -331,25 +333,25 @@ # endif @end #endif @implementation OFRunLoop -+ (OFRunLoop*)mainRunLoop ++ (OFRunLoop *)mainRunLoop { return [[mainRunLoop retain] autorelease]; } -+ (OFRunLoop*)currentRunLoop ++ (OFRunLoop *)currentRunLoop { #ifdef OF_HAVE_THREADS return [[OFThread currentThread] runLoop]; #else return [self mainRunLoop]; #endif } -+ (void)OF_setMainRunLoop: (OFRunLoop*)runLoop ++ (void)OF_setMainRunLoop: (OFRunLoop *)runLoop { mainRunLoop = [runLoop retain]; } #ifdef OF_HAVE_SOCKETS @@ -373,12 +375,12 @@ code \ [queue appendObject: queueItem]; \ \ objc_autoreleasePoolPop(pool); -+ (void)OF_addAsyncReadForStream: (OFStream*)stream - buffer: (void*)buffer ++ (void)OF_addAsyncReadForStream: (OFStream *)stream + buffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector { ADD_READ(OFRunLoop_ReadQueueItem, stream, { @@ -387,12 +389,12 @@ queueItem->_buffer = buffer; queueItem->_length = length; }) } -+ (void)OF_addAsyncReadForStream: (OFStream*)stream - buffer: (void*)buffer ++ (void)OF_addAsyncReadForStream: (OFStream *)stream + buffer: (void *)buffer exactLength: (size_t)exactLength target: (id)target selector: (SEL)selector { ADD_READ(OFRunLoop_ExactReadQueueItem, stream, { @@ -401,11 +403,11 @@ queueItem->_buffer = buffer; queueItem->_exactLength = exactLength; }) } -+ (void)OF_addAsyncReadLineForStream: (OFStream*)stream ++ (void)OF_addAsyncReadLineForStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding target: (id)target selector: (SEL)selector { ADD_READ(OFRunLoop_ReadLineQueueItem, stream, { @@ -413,22 +415,22 @@ queueItem->_selector = selector; queueItem->_encoding = encoding; }) } -+ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket*)stream ++ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket *)stream target: (id)target selector: (SEL)selector { ADD_READ(OFRunLoop_AcceptQueueItem, stream, { queueItem->_target = [target retain]; queueItem->_selector = selector; }) } -+ (void)OF_addAsyncReceiveForUDPSocket: (OFUDPSocket*)socket - buffer: (void*)buffer ++ (void)OF_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket + buffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector { ADD_READ(OFRunLoop_UDPReceiveQueueItem, socket, { @@ -438,12 +440,12 @@ queueItem->_selector = selector; }) } # ifdef OF_HAVE_BLOCKS -+ (void)OF_addAsyncReadForStream: (OFStream*)stream - buffer: (void*)buffer ++ (void)OF_addAsyncReadForStream: (OFStream *)stream + buffer: (void *)buffer length: (size_t)length block: (of_stream_async_read_block_t)block { ADD_READ(OFRunLoop_ReadQueueItem, stream, { queueItem->_block = [block copy]; @@ -450,12 +452,12 @@ queueItem->_buffer = buffer; queueItem->_length = length; }) } -+ (void)OF_addAsyncReadForStream: (OFStream*)stream - buffer: (void*)buffer ++ (void)OF_addAsyncReadForStream: (OFStream *)stream + buffer: (void *)buffer exactLength: (size_t)exactLength block: (of_stream_async_read_block_t)block { ADD_READ(OFRunLoop_ExactReadQueueItem, stream, { queueItem->_block = [block copy]; @@ -462,30 +464,30 @@ queueItem->_buffer = buffer; queueItem->_exactLength = exactLength; }) } -+ (void)OF_addAsyncReadLineForStream: (OFStream*)stream ++ (void)OF_addAsyncReadLineForStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding block: (of_stream_async_read_line_block_t)block { ADD_READ(OFRunLoop_ReadLineQueueItem, stream, { queueItem->_block = [block copy]; queueItem->_encoding = encoding; }) } -+ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket*)stream ++ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket *)stream block: (of_tcp_socket_async_accept_block_t)block { ADD_READ(OFRunLoop_AcceptQueueItem, stream, { queueItem->_block = [block copy]; }) } -+ (void)OF_addAsyncReceiveForUDPSocket: (OFUDPSocket*)socket - buffer: (void*)buffer ++ (void)OF_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket + buffer: (void *)buffer length: (size_t)length block: (of_udp_socket_async_receive_block_t) block { ADD_READ(OFRunLoop_UDPReceiveQueueItem, socket, { @@ -560,11 +562,11 @@ #endif [super dealloc]; } -- (void)addTimer: (OFTimer*)timer +- (void)addTimer: (OFTimer *)timer { #ifdef OF_HAVE_THREADS [_timersQueueLock lock]; @try { #endif @@ -582,11 +584,11 @@ #elif defined(OF_HAVE_THREADS) [_condition signal]; #endif } -- (void)OF_removeTimer: (OFTimer*)timer +- (void)OF_removeTimer: (OFTimer *)timer { #ifdef OF_HAVE_THREADS [_timersQueueLock lock]; @try { #endif @@ -611,11 +613,11 @@ { /* * Retain the queue so that it doesn't disappear from us because the * handler called -[cancelAsyncRequests]. */ - OFList OF_GENERIC(OF_KINDOF(OFRunLoop_ReadQueueItem*)) *queue = + OFList OF_GENERIC(OF_KINDOF(OFRunLoop_ReadQueueItem *)) *queue = [[_readQueues objectForKey: object] retain]; assert(queue != nil); @try { @@ -647,11 +649,11 @@ - (void)run { [self runUntilDate: nil]; } -- (void)runUntilDate: (OFDate*)deadline +- (void)runUntilDate: (OFDate *)deadline { _stop = false; for (;;) { void *pool = objc_autoreleasePoolPush(); Index: src/OFSHA1Hash.m ================================================================== --- src/OFSHA1Hash.m +++ src/OFSHA1Hash.m @@ -140,11 +140,11 @@ _state[2] = 0x98BADCFE; _state[3] = 0x10325476; _state[4] = 0xC3D2E1F0; } -- (void)updateWithBuffer: (const void*)buffer_ +- (void)updateWithBuffer: (const void *)buffer_ length: (size_t)length { const uint8_t *buffer = buffer_; if (_calculated) @@ -170,14 +170,14 @@ _bufferLength = 0; } } } -- (const unsigned char*)digest +- (const unsigned char *)digest { if (_calculated) - return (const uint8_t*)_state; + return (const uint8_t *)_state; _buffer.bytes[_bufferLength] = 0x80; memset(_buffer.bytes + _bufferLength + 1, 0, 64 - _bufferLength - 1); if (_bufferLength >= 56) { @@ -191,11 +191,11 @@ processBlock(_state, _buffer.words); memset(&_buffer, 0, sizeof(_buffer)); byteSwapVectorIfLE(_state, 5); _calculated = true; - return (const uint8_t*)_state; + return (const uint8_t *)_state; } - (void)reset { [self OF_resetState]; Index: src/OFSHA224Or256Hash.m ================================================================== --- src/OFSHA224Or256Hash.m +++ src/OFSHA224Or256Hash.m @@ -163,11 +163,11 @@ copy->_calculated = _calculated; return copy; } -- (void)updateWithBuffer: (const void*)buffer_ +- (void)updateWithBuffer: (const void *)buffer_ length: (size_t)length { const uint8_t *buffer = buffer_; if (_calculated) @@ -193,14 +193,14 @@ _bufferLength = 0; } } } -- (const unsigned char*)digest +- (const unsigned char *)digest { if (_calculated) - return (const uint8_t*)_state; + return (const uint8_t *)_state; _buffer.bytes[_bufferLength] = 0x80; memset(_buffer.bytes + _bufferLength + 1, 0, 64 - _bufferLength - 1); if (_bufferLength >= 56) { @@ -214,11 +214,11 @@ processBlock(_state, _buffer.words); memset(&_buffer, 0, sizeof(_buffer)); byteSwapVectorIfLE(_state, 8); _calculated = true; - return (const uint8_t*)_state; + return (const uint8_t *)_state; } - (void)reset { [self OF_resetState]; Index: src/OFSHA384Or512Hash.m ================================================================== --- src/OFSHA384Or512Hash.m +++ src/OFSHA384Or512Hash.m @@ -174,11 +174,11 @@ copy->_calculated = _calculated; return copy; } -- (void)updateWithBuffer: (const void*)buffer_ +- (void)updateWithBuffer: (const void *)buffer_ length: (size_t)length { const uint8_t *buffer = buffer_; if (_calculated) @@ -206,14 +206,14 @@ _bufferLength = 0; } } } -- (const unsigned char*)digest +- (const unsigned char *)digest { if (_calculated) - return (const uint8_t*)_state; + return (const uint8_t *)_state; _buffer.bytes[_bufferLength] = 0x80; memset(_buffer.bytes + _bufferLength + 1, 0, 128 - _bufferLength - 1); if (_bufferLength >= 112) { @@ -227,11 +227,11 @@ processBlock(_state, _buffer.words); memset(&_buffer, 0, sizeof(_buffer)); byteSwapVectorIfLE(_state, 8); _calculated = true; - return (const uint8_t*)_state; + return (const uint8_t *)_state; } - (void)reset { [self OF_resetState]; Index: src/OFSandbox.h ================================================================== --- src/OFSandbox.h +++ src/OFSandbox.h @@ -134,10 +134,10 @@ /*! * @brief Returns the string for OpenBSD's pledge() call. * * @warning Only available on systems with the pledge() call! */ -- (OFString*)pledgeString; +- (OFString *)pledgeString; #endif @end OF_ASSUME_NONNULL_END Index: src/OFSandbox.m ================================================================== --- src/OFSandbox.m +++ src/OFSandbox.m @@ -203,11 +203,11 @@ return hash; } #ifdef OF_HAVE_PLEDGE -- (OFString*)pledgeString +- (OFString *)pledgeString { void *pool = objc_autoreleasePoolPush(); OFMutableArray *pledges = [OFMutableArray array]; OFString *ret; Index: src/OFSerialization.h ================================================================== --- src/OFSerialization.h +++ src/OFSerialization.h @@ -32,16 +32,16 @@ * @brief Initializes the object with the specified XML element serialization. * * @param element An OFXMLElement with the serialized object * @return An initialized object */ -- initWithSerialization: (OFXMLElement*)element; +- initWithSerialization: (OFXMLElement *)element; /*! * @brief Serializes the object into an XML element. * * @return The object serialized into an XML element */ -- (OFXMLElement*)XMLElementBySerializing; +- (OFXMLElement *)XMLElementBySerializing; @end OF_ASSUME_NONNULL_END Index: src/OFSet.h ================================================================== --- src/OFSet.h +++ src/OFSet.h @@ -59,11 +59,11 @@ * * @warning Do not mutate objects that are in a set! Changing the hash of * objects in a set breaks the internal representation of the set! */ #ifdef OF_HAVE_GENERICS -@interface OFSet : +@interface OFSet: #else # ifndef DOXYGEN # define ObjectType id # endif @interface OFSet: @@ -80,19 +80,19 @@ * @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 */ -+ (instancetype)setWithSet: (OFSet OF_GENERIC(ObjectType)*)set; ++ (instancetype)setWithSet: (OFSet OF_GENERIC(ObjectType) *)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 */ -+ (instancetype)setWithArray: (OFArray OF_GENERIC(ObjectType)*)array; ++ (instancetype)setWithArray: (OFArray OF_GENERIC(ObjectType) *)array; /*! * @brief Creates a new set with the specified objects. * * @param firstObject The first object for the set @@ -114,19 +114,19 @@ * @brief Initializes an already allocated set with the specified set. * * @param set The set to initialize the set with * @return An initialized set with the specified set */ -- initWithSet: (OFSet OF_GENERIC(ObjectType)*)set; +- initWithSet: (OFSet OF_GENERIC(ObjectType) *)set; /*! * @brief Initializes an already allocated set with the specified array. * * @param array The array to initialize the set with * @return An initialized set with the specified array */ -- initWithArray: (OFArray OF_GENERIC(ObjectType)*)array; +- initWithArray: (OFArray OF_GENERIC(ObjectType) *)array; /*! * @brief Initializes an already allocated set with the specified objects. * * @param firstObject The first object for the set @@ -158,54 +158,54 @@ /*! * @brief Returns whether the receiver is a subset of the specified set. * * @return Whether the receiver is a subset of the specified set */ -- (bool)isSubsetOfSet: (OFSet OF_GENERIC(ObjectType)*)set; +- (bool)isSubsetOfSet: (OFSet OF_GENERIC(ObjectType) *)set; /*! * @brief Returns whether the receiver and the specified set have at least one * object in common. * * @return Whether the receiver and the specified set have at least one object * in common */ -- (bool)intersectsSet: (OFSet OF_GENERIC(ObjectType)*)set; +- (bool)intersectsSet: (OFSet OF_GENERIC(ObjectType) *)set; /*! * @brief Creates a new set which contains the objects which are in the * receiver, but not in the specified set. * * @param set The set whose objects will not be in the new set */ -- (OFSet OF_GENERIC(ObjectType)*)setBySubtractingSet: - (OFSet OF_GENERIC(ObjectType)*)set; +- (OFSet OF_GENERIC(ObjectType) *)setBySubtractingSet: + (OFSet OF_GENERIC(ObjectType) *)set; /*! * @brief Creates a new set by creating the intersection of the receiver and * the specified set. * * @param set The set to intersect with */ -- (OFSet OF_GENERIC(ObjectType)*)setByIntersectingWithSet: - (OFSet OF_GENERIC(ObjectType)*)set; +- (OFSet OF_GENERIC(ObjectType) *)setByIntersectingWithSet: + (OFSet OF_GENERIC(ObjectType) *)set; /*! * @brief Creates a new set by creating the union of the receiver and the * specified set. * * @param set The set to create the union with */ -- (OFSet OF_GENERIC(ObjectType)*)setByAddingSet: - (OFSet OF_GENERIC(ObjectType)*)set; +- (OFSet OF_GENERIC(ObjectType) *)setByAddingSet: + (OFSet OF_GENERIC(ObjectType) *)set; /*! * @brief Returns an array of all objects in the set. * * @return An array of all objects in the set */ -- (OFArray OF_GENERIC(ObjectType)*)allObjects; +- (OFArray OF_GENERIC(ObjectType) *)allObjects; /*! * @brief Returns an arbitrary object in the set. * * @return An arbitrary object in the set @@ -232,11 +232,11 @@ * @note Unlike with @ref OFArray, any nil values are removed! * * @param key The key of the value to return * @return The value for the specified key */ -- (nullable id)valueForKey: (OFString*)key; +- (nullable id)valueForKey: (OFString *)key; /*! * @brief Set the value for the specified key * * If the key starts with an `@`, the `@` is stripped and @@ -248,18 +248,18 @@ * * @param value The value for the specified key * @param key The key of the value to set */ - (void)setValue: (nullable id)value - forKey: (OFString*)key; + forKey: (OFString *)key; /*! * @brief Returns an OFEnumerator to enumerate through all objects of the set. * * @returns An OFEnumerator to enumerate through all objects of the set */ -- (OFEnumerator OF_GENERIC(ObjectType)*)objectEnumerator; +- (OFEnumerator OF_GENERIC(ObjectType) *)objectEnumerator; #ifdef OF_HAVE_BLOCKS /*! * @brief Executes a block for each object in the set. * @@ -272,11 +272,11 @@ * returns true. * * @param block A block which determines if the object should be in the new set * @return A new, autoreleased OFSet */ -- (OFSet OF_GENERIC(ObjectType)*)filteredSetUsingBlock: +- (OFSet OF_GENERIC(ObjectType) *)filteredSetUsingBlock: (of_set_filter_block_t)block; #endif @end #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef ObjectType Index: src/OFSet.m ================================================================== --- src/OFSet.m +++ src/OFSet.m @@ -36,16 +36,16 @@ - init { return (id)[[OFSet_hashtable alloc] init]; } -- initWithSet: (OFSet*)set +- initWithSet: (OFSet *)set { return (id)[[OFSet_hashtable alloc] initWithSet: set]; } -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array { return (id)[[OFSet_hashtable alloc] initWithArray: array]; } - initWithObjects: (id)firstObject, ... @@ -59,11 +59,11 @@ va_end(arguments); return ret; } -- initWithObjects: (id const*)objects +- initWithObjects: (id const *)objects count: (size_t)count { return (id)[[OFSet_hashtable alloc] initWithObjects: objects count: count]; } @@ -73,11 +73,11 @@ { return (id)[[OFSet_hashtable alloc] initWithObject: firstObject arguments: arguments]; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { return (id)[[OFSet_hashtable alloc] initWithSerialization: element]; } - retain @@ -118,16 +118,16 @@ + (instancetype)set { return [[[self alloc] init] autorelease]; } -+ (instancetype)setWithSet: (OFSet*)set ++ (instancetype)setWithSet: (OFSet *)set { return [[[self alloc] initWithSet: set] autorelease]; } -+ (instancetype)setWithArray: (OFArray*)array ++ (instancetype)setWithArray: (OFArray *)array { return [[[self alloc] initWithArray: array] autorelease]; } + (instancetype)setWithObjects: (id)firstObject, ... @@ -141,11 +141,11 @@ va_end(arguments); return ret; } -+ (instancetype)setWithObjects: (id const*)objects ++ (instancetype)setWithObjects: (id const *)objects count: (size_t)count { return [[[self alloc] initWithObjects: objects count: count] autorelease]; } @@ -164,21 +164,21 @@ } return [super init]; } -- initWithSet: (OFSet*)set +- initWithSet: (OFSet *)set { OF_INVALID_INIT_METHOD } -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array { OF_INVALID_INIT_METHOD } -- initWithObjects: (id const*)objects +- initWithObjects: (id const *)objects count: (size_t)count { OF_INVALID_INIT_METHOD } @@ -199,21 +199,21 @@ arguments: (va_list)arguments { OF_INVALID_INIT_METHOD } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { OF_INVALID_INIT_METHOD } - (size_t)count { OF_UNRECOGNIZED_SELECTOR } -- (id)valueForKey: (OFString*)key +- (id)valueForKey: (OFString *)key { OFMutableSet *ret; if ([key hasPrefix: @"@"]) { void *pool = objc_autoreleasePoolPush(); @@ -240,11 +240,11 @@ return ret; } - (void)setValue: (id)value - forKey: (OFString*)key + forKey: (OFString *)key { if ([key hasPrefix: @"@"]) { void *pool = objc_autoreleasePoolPush(); key = [key substringWithRange: of_range(1, [key length] - 1)]; @@ -266,17 +266,17 @@ - (bool)containsObject: (id)object { OF_UNRECOGNIZED_SELECTOR } -- (OFEnumerator*)objectEnumerator +- (OFEnumerator *)objectEnumerator { OF_UNRECOGNIZED_SELECTOR } -- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state - objects: (id*)objects +- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state + objects: (id *)objects count: (int)count { OF_UNRECOGNIZED_SELECTOR } @@ -306,11 +306,11 @@ objc_autoreleasePoolPop(pool); return hash; } -- (OFString*)description +- (OFString *)description { void *pool; OFMutableString *ret; size_t i, count = [self count]; @@ -351,29 +351,29 @@ - mutableCopy { return [[OFMutableSet alloc] initWithSet: self]; } -- (bool)isSubsetOfSet: (OFSet*)set +- (bool)isSubsetOfSet: (OFSet *)set { for (id object in self) if (![set containsObject: object]) return false; return true; } -- (bool)intersectsSet: (OFSet*)set +- (bool)intersectsSet: (OFSet *)set { for (id object in self) if ([set containsObject: object]) return true; return false; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; if ([self isKindOfClass: [OFMutableSet class]]) @@ -396,11 +396,11 @@ objc_autoreleasePoolPop(pool); return [element autorelease]; } -- (OFSet*)setBySubtractingSet: (OFSet*)set +- (OFSet *)setBySubtractingSet: (OFSet *)set { OFMutableSet *new; new = [[self mutableCopy] autorelease]; [new minusSet: set]; @@ -408,11 +408,11 @@ [new makeImmutable]; return new; } -- (OFSet*)setByIntersectingWithSet: (OFSet*)set +- (OFSet *)setByIntersectingWithSet: (OFSet *)set { OFMutableSet *new; new = [[self mutableCopy] autorelease]; [new intersectSet: set]; @@ -420,11 +420,11 @@ [new makeImmutable]; return new; } -- (OFSet*)setByAddingSet: (OFSet*)set +- (OFSet *)setByAddingSet: (OFSet *)set { OFMutableSet *new; new = [[self mutableCopy] autorelease]; [new unionSet: set]; @@ -432,11 +432,11 @@ [new makeImmutable]; return new; } -- (OFArray*)allObjects +- (OFArray *)allObjects { void *pool = objc_autoreleasePoolPush(); OFArray *ret = [[[self objectEnumerator] allObjects] retain]; objc_autoreleasePoolPop(pool); @@ -463,11 +463,11 @@ if (stop) break; } } -- (OFSet*)filteredSetUsingBlock: (of_set_filter_block_t)block +- (OFSet *)filteredSetUsingBlock: (of_set_filter_block_t)block { OFMutableSet *ret = [OFMutableSet set]; [self enumerateObjectsUsingBlock: ^ (id object, bool *stop) { if (block(object)) Index: src/OFSet_hashtable.m ================================================================== --- src/OFSet_hashtable.m +++ src/OFSet_hashtable.m @@ -26,11 +26,11 @@ #import "OFXMLElement.h" #import "OFInvalidArgumentException.h" #import "OFEnumerationMutationException.h" -static void* +static void * retain(void *object) { return [(id)object retain]; } @@ -81,11 +81,11 @@ } return self; } -- initWithSet: (OFSet*)set +- initWithSet: (OFSet *)set { size_t count; if (set == nil) return [self init]; @@ -99,21 +99,21 @@ self = [self initWithCapacity: count]; @try { for (id object in set) - [_mapTable setObject: (void*)1 + [_mapTable setObject: (void *)1 forKey: object]; } @catch (id e) { [self release]; @throw e; } return self; } -- initWithArray: (OFArray*)array +- initWithArray: (OFArray *)array { size_t count; if (array == nil) return self; @@ -127,28 +127,28 @@ self = [self initWithCapacity: count]; @try { for (id object in array) - [_mapTable setObject: (void*)1 + [_mapTable setObject: (void *)1 forKey: object]; } @catch (id e) { [self release]; @throw e; } return self; } -- initWithObjects: (id const*)objects +- initWithObjects: (id const *)objects count: (size_t)count { self = [self initWithCapacity: count]; @try { for (size_t i = 0; i < count; i++) - [_mapTable setObject: (void*)1 + [_mapTable setObject: (void *)1 forKey: objects[i]]; } @catch (id e) { [self release]; @throw e; } @@ -173,25 +173,25 @@ _mapTable = [[OFMapTable alloc] initWithKeyFunctions: keyFunctions objectFunctions: objectFunctions capacity: count]; - [_mapTable setObject: (void*)1 + [_mapTable setObject: (void *)1 forKey: firstObject]; while ((object = va_arg(arguments, id)) != nil) - [_mapTable setObject: (void*)1 + [_mapTable setObject: (void *)1 forKey: object]; } @catch (id e) { [self release]; @throw e; } return self; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { self = [self init]; @try { void *pool = objc_autoreleasePoolPush(); @@ -203,11 +203,11 @@ for (OFXMLElement *child in [element elementsForNamespace: OF_SERIALIZATION_NS]) { void *pool2 = objc_autoreleasePoolPush(); - [_mapTable setObject: (void*)1 + [_mapTable setObject: (void *)1 forKey: [child objectByDeserializing]]; objc_autoreleasePoolPop(pool2); } @@ -265,19 +265,19 @@ objc_autoreleasePoolPop(pool); return [object autorelease]; } -- (OFEnumerator*)objectEnumerator +- (OFEnumerator *)objectEnumerator { return [[[OFMapTable_EnumeratorWrapper alloc] initWithEnumerator: [_mapTable keyEnumerator] object: self] autorelease]; } -- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state - objects: (id*)objects +- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state + objects: (id *)objects count: (int)count { return [_mapTable countByEnumeratingWithState: state objects: objects count: count]; Index: src/OFSettings.h ================================================================== --- src/OFSettings.h +++ src/OFSettings.h @@ -48,105 +48,105 @@ * * @param applicationName The name of the application whose settings should be * accessed * @return A new, autoreleased OFSettings instance */ -+ (instancetype)settingsWithApplicationName: (OFString*)applicationName; ++ (instancetype)settingsWithApplicationName: (OFString *)applicationName; /*! * @brief Initializes an already allocated OFSettings instance with the * specified application name. * * @param applicationName The name of the application whose settings should be * accessed * @return An initialized OFSettings instance */ -- initWithApplicationName: (OFString*)applicationName; +- initWithApplicationName: (OFString *)applicationName; /*! * @brief Sets the specified path to the specified string. * * @param string The string to set * @param path The path to store the string at */ -- (void)setString: (OFString*)string - forPath: (OFString*)path; +- (void)setString: (OFString *)string + forPath: (OFString *)path; /*! * @brief Sets the specified path to the specified integer. * * @param integer The integer to set * @param path The path to store the integer at */ - (void)setInteger: (intmax_t)integer - forPath: (OFString*)path; + forPath: (OFString *)path; /*! * @brief Sets the specified path to the specified bool. * * @param bool_ The bool to set * @param path The path to store the bool at */ - (void)setBool: (bool)bool_ - forPath: (OFString*)path; + forPath: (OFString *)path; /*! * @brief Sets the specified path to the specified float. * * @param float_ The float to set * @param path The path to store the float at */ - (void)setFloat: (float)float_ - forPath: (OFString*)path; + forPath: (OFString *)path; /*! * @brief Sets the specified path to the specified double. * * @param double_ The double to set * @param path The path to store the double at */ - (void)setDouble: (double)double_ - forPath: (OFString*)path; + forPath: (OFString *)path; /*! * @brief Sets the specified path to the specified array of strings. * * @param array The array of strings to set * @param path The path to store the array of strings at */ -- (void)setArray: (OFArray OF_GENERIC(OFString*)*)array - forPath: (OFString*)path; +- (void)setArray: (OFArray OF_GENERIC(OFString *) *)array + forPath: (OFString *)path; /*! * @brief Returns the string for the specified path, or `nil` if the path does * not exist. * * @param path The path for which the string value should be returned * @return The string value of the specified path */ -- (nullable OFString*)stringForPath: (OFString*)path; +- (nullable OFString *)stringForPath: (OFString *)path; /*! * @brief Returns the string for the specified path, or the default value if * the path does not exist. * * @param path The path for which the string value should be returned * @param defaultValue The default value to return if the path does not exist * @return The string value of the specified path */ -- (nullable OFString*)stringForPath: (OFString*)path - defaultValue: (nullable OFString*)defaultValue; +- (nullable OFString *)stringForPath: (OFString *)path + defaultValue: (nullable OFString *)defaultValue; /*! * @brief Returns the integer for the specified path, or the default value if * the path does not exist. * * @param path The path for which the integer value should be returned * @param defaultValue The default value to return if the path does not exist * @return The integer value of the specified path */ -- (intmax_t)integerForPath: (OFString*)path +- (intmax_t)integerForPath: (OFString *)path defaultValue: (intmax_t)defaultValue; /*! * @brief Returns the bool for the specified path, or the default value if the * path does not exist. @@ -153,11 +153,11 @@ * * @param path The path for which the bool value should be returned * @param defaultValue The default value to return if the path does not exist * @return The bool value of the specified path */ -- (bool)boolForPath: (OFString*)path +- (bool)boolForPath: (OFString *)path defaultValue: (bool)defaultValue; /*! * @brief Returns the float for the specified path, or the default value if the * path does not exist. @@ -164,11 +164,11 @@ * * @param path The path for which the float value should be returned * @param defaultValue The default value to return if the path does not exist * @return The float value of the specified path */ -- (float)floatForPath: (OFString*)path +- (float)floatForPath: (OFString *)path defaultValue: (float)defaultValue; /*! * @brief Returns the double for the specified path, or the default value if * the path does not exist. @@ -175,28 +175,28 @@ * * @param path The path for which the double value should be returned * @param defaultValue The default value to return if the path does not exist * @return The double value of the specified path */ -- (double)doubleForPath: (OFString*)path +- (double)doubleForPath: (OFString *)path defaultValue: (double)defaultValue; /*! * @brief Returns the array of strings for the specified path, or an empty * array if the path does not exist. * * @param path The path for which the array of strings should be returned * @return The array of strings of the specified path */ -- (OFArray OF_GENERIC(OFString*)*)arrayForPath: (OFString*)path; +- (OFArray OF_GENERIC(OFString *) *)arrayForPath: (OFString *)path; /*! * @brief Removes the value for the specified path. * * @param path The path for which the value should be removed */ -- (void)removeValueForPath: (OFString*)path; +- (void)removeValueForPath: (OFString *)path; /*! * @brief Saves the settings to disk. * * @warning Some backends might save the settings instantly, others might not Index: src/OFSettings.m ================================================================== --- src/OFSettings.m +++ src/OFSettings.m @@ -29,11 +29,11 @@ return [OFSettings_INIFile alloc]; return [super alloc]; } -+ (instancetype)settingsWithApplicationName: (OFString*)applicationName ++ (instancetype)settingsWithApplicationName: (OFString *)applicationName { return [[[self alloc] initWithApplicationName: applicationName] autorelease]; } @@ -40,11 +40,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithApplicationName: (OFString*)applicationName +- initWithApplicationName: (OFString *)applicationName { self = [super init]; @try { _applicationName = [applicationName copy]; @@ -61,92 +61,92 @@ [_applicationName release]; [super dealloc]; } -- (void)setString: (OFString*)string - forPath: (OFString*)path +- (void)setString: (OFString *)string + forPath: (OFString *)path { OF_UNRECOGNIZED_SELECTOR } - (void)setInteger: (intmax_t)integer - forPath: (OFString*)path + forPath: (OFString *)path { OF_UNRECOGNIZED_SELECTOR } - (void)setBool: (bool)bool_ - forPath: (OFString*)path + forPath: (OFString *)path { OF_UNRECOGNIZED_SELECTOR } - (void)setFloat: (float)float_ - forPath: (OFString*)path + forPath: (OFString *)path { OF_UNRECOGNIZED_SELECTOR } - (void)setDouble: (double)double_ - forPath: (OFString*)path + forPath: (OFString *)path { OF_UNRECOGNIZED_SELECTOR } -- (void)setArray: (OFArray*)array - forPath: (OFString*)path +- (void)setArray: (OFArray *)array + forPath: (OFString *)path { OF_UNRECOGNIZED_SELECTOR } -- (OFString*)stringForPath: (OFString*)path +- (OFString *)stringForPath: (OFString *)path { return [self stringForPath: path defaultValue: nil]; } -- (OFString*)stringForPath: (OFString*)path - defaultValue: (OFString*)defaultValue +- (OFString *)stringForPath: (OFString *)path + defaultValue: (OFString *)defaultValue { OF_UNRECOGNIZED_SELECTOR } -- (intmax_t)integerForPath: (OFString*)path +- (intmax_t)integerForPath: (OFString *)path defaultValue: (intmax_t)defaultValue { OF_UNRECOGNIZED_SELECTOR } -- (bool)boolForPath: (OFString*)path +- (bool)boolForPath: (OFString *)path defaultValue: (bool)defaultValue { OF_UNRECOGNIZED_SELECTOR } -- (float)floatForPath: (OFString*)path +- (float)floatForPath: (OFString *)path defaultValue: (float)defaultValue { OF_UNRECOGNIZED_SELECTOR } -- (double)doubleForPath: (OFString*)path +- (double)doubleForPath: (OFString *)path defaultValue: (double)defaultValue { OF_UNRECOGNIZED_SELECTOR } -- (OFArray*)arrayForPath: (OFString*)path +- (OFArray *)arrayForPath: (OFString *)path { OF_UNRECOGNIZED_SELECTOR } -- (void)removeValueForPath: (OFString*)path +- (void)removeValueForPath: (OFString *)path { OF_UNRECOGNIZED_SELECTOR } - (void)save { OF_UNRECOGNIZED_SELECTOR } @end Index: src/OFSettings_INIFile.m ================================================================== --- src/OFSettings_INIFile.m +++ src/OFSettings_INIFile.m @@ -21,11 +21,11 @@ #import "OFArray.h" #import "OFINIFile.h" #import "OFSystemInfo.h" @implementation OFSettings_INIFile -- initWithApplicationName: (OFString*)applicationName +- initWithApplicationName: (OFString *)applicationName { self = [super initWithApplicationName: applicationName]; @try { void *pool = objc_autoreleasePoolPush(); @@ -51,13 +51,13 @@ [_INIFile release]; [super dealloc]; } -- (void)OF_getCategory: (OFString**)category - andKey: (OFString**)key - forPath: (OFString*)path +- (void)OF_getCategory: (OFString **)category + andKey: (OFString **)key + forPath: (OFString *)path { size_t pos = [path rangeOfString: @"." options: OF_STRING_SEARCH_BACKWARDS].location; if (pos == OF_NOT_FOUND) { @@ -69,12 +69,12 @@ *category = [path substringWithRange: of_range(0, pos)]; *key = [path substringWithRange: of_range(pos + 1, [path length] - pos - 1)]; } -- (void)setString: (OFString*)string - forPath: (OFString*)path +- (void)setString: (OFString *)string + forPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; [self OF_getCategory: &category @@ -86,11 +86,11 @@ objc_autoreleasePoolPop(pool); } - (void)setInteger: (intmax_t)integer - forPath: (OFString*)path + forPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; [self OF_getCategory: &category @@ -102,11 +102,11 @@ objc_autoreleasePoolPop(pool); } - (void)setBool: (bool)bool_ - forPath: (OFString*)path + forPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; [self OF_getCategory: &category @@ -118,11 +118,11 @@ objc_autoreleasePoolPop(pool); } - (void)setFloat: (float)float_ - forPath: (OFString*)path + forPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; [self OF_getCategory: &category @@ -134,11 +134,11 @@ objc_autoreleasePoolPop(pool); } - (void)setDouble: (double)double_ - forPath: (OFString*)path + forPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; [self OF_getCategory: &category @@ -149,12 +149,12 @@ forKey: key]; objc_autoreleasePoolPop(pool); } -- (void)setArray: (OFArray*)array - forPath: (OFString*)path +- (void)setArray: (OFArray *)array + forPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; [self OF_getCategory: &category @@ -165,12 +165,12 @@ forKey: key]; objc_autoreleasePoolPop(pool); } -- (OFString*)stringForPath: (OFString*)path - defaultValue: (OFString*)defaultValue +- (OFString *)stringForPath: (OFString *)path + defaultValue: (OFString *)defaultValue { void *pool = objc_autoreleasePoolPush(); OFString *category, *key, *ret; [self OF_getCategory: &category @@ -183,11 +183,11 @@ [ret retain]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } -- (intmax_t)integerForPath: (OFString*)path +- (intmax_t)integerForPath: (OFString *)path defaultValue: (intmax_t)defaultValue { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; intmax_t ret; @@ -203,11 +203,11 @@ objc_autoreleasePoolPop(pool); return ret; } -- (bool)boolForPath: (OFString*)path +- (bool)boolForPath: (OFString *)path defaultValue: (bool)defaultValue { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; bool ret; @@ -222,11 +222,11 @@ objc_autoreleasePoolPop(pool); return ret; } -- (float)floatForPath: (OFString*)path +- (float)floatForPath: (OFString *)path defaultValue: (float)defaultValue { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; float ret; @@ -241,11 +241,11 @@ objc_autoreleasePoolPop(pool); return ret; } -- (double)doubleForPath: (OFString*)path +- (double)doubleForPath: (OFString *)path defaultValue: (double)defaultValue { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; double ret; @@ -260,11 +260,11 @@ objc_autoreleasePoolPop(pool); return ret; } -- (OFArray*)arrayForPath: (OFString*)path +- (OFArray *)arrayForPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; OFArray *ret; @@ -277,11 +277,11 @@ [ret retain]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } -- (void)removeValueForPath: (OFString*)path +- (void)removeValueForPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; [self OF_getCategory: &category Index: src/OFSortedList.h ================================================================== --- src/OFSortedList.h +++ src/OFSortedList.h @@ -25,11 +25,11 @@ * * @warning Because the list is sorted, all methods inserting an object at a * specific place are unavailable, even though they exist in OFList! */ #ifdef OF_HAVE_GENERICS -@interface OFSortedList : OFList +@interface OFSortedList: OFList #else # ifndef DOXYGEN # define ObjectType id # endif @interface OFSortedList: OFList @@ -38,12 +38,12 @@ * @brief Inserts the object to the list while keeping the list sorted. * * @param object The object to insert * @return The list object for the object just added */ -- (of_list_object_t*)insertObject: (ObjectType )object; +- (of_list_object_t *)insertObject: (ObjectType )object; @end #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef ObjectType #endif OF_ASSUME_NONNULL_END Index: src/OFSortedList.m ================================================================== --- src/OFSortedList.m +++ src/OFSortedList.m @@ -17,33 +17,33 @@ #include "config.h" #import "OFSortedList.h" @implementation OFSortedList -- (of_list_object_t*)appendObject: (id)object +- (of_list_object_t *)appendObject: (id)object +{ + OF_UNRECOGNIZED_SELECTOR +} + +- (of_list_object_t *)prependObject: (id)object { OF_UNRECOGNIZED_SELECTOR } -- (of_list_object_t*)prependObject: (id)object +- (of_list_object_t *)insertObject: (id)object + beforeListObject: (of_list_object_t *)listObject { OF_UNRECOGNIZED_SELECTOR } -- (of_list_object_t*)insertObject: (id)object - beforeListObject: (of_list_object_t*)listObject +- (of_list_object_t *)insertObject: (id)object + afterListObject: (of_list_object_t *)listObject { OF_UNRECOGNIZED_SELECTOR } -- (of_list_object_t*)insertObject: (id)object - afterListObject: (of_list_object_t*)listObject -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (of_list_object_t*)insertObject: (id )object +- (of_list_object_t *)insertObject: (id )object { of_list_object_t *iter; for (iter = _lastListObject; iter != NULL; iter = iter->previous) { if ([object compare: iter->object] != OF_ORDERED_ASCENDING) Index: src/OFStdIOStream.h ================================================================== --- src/OFStdIOStream.h +++ src/OFStdIOStream.h @@ -70,11 +70,11 @@ /*! * @brief The standard error as an OFStream. */ extern OFStdIOStream *_Nullable of_stderr; -extern void of_log(OFConstantString*, ...); +extern void of_log(OFConstantString *, ...); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/OFStdIOStream.m ================================================================== --- src/OFStdIOStream.m +++ src/OFStdIOStream.m @@ -110,11 +110,11 @@ return true; return _atEndOfStream; } -- (size_t)lowlevelReadIntoBuffer: (void*)buffer +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { ssize_t ret; if (_fd == -1 || _atEndOfStream) @@ -140,11 +140,11 @@ _atEndOfStream = true; return ret; } -- (void)lowlevelWriteBuffer: (const void*)buffer +- (void)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { if (_fd == -1 || _atEndOfStream) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length]; Index: src/OFStdIOStream_Win32Console.m ================================================================== --- src/OFStdIOStream_Win32Console.m +++ src/OFStdIOStream_Win32Console.m @@ -98,11 +98,11 @@ } return self; } -- (size_t)lowlevelReadIntoBuffer: (void*)buffer_ +- (size_t)lowlevelReadIntoBuffer: (void *)buffer_ length: (size_t)length { void *pool = objc_autoreleasePoolPush(); char *buffer = buffer_; of_char16_t *UTF16; @@ -214,11 +214,11 @@ objc_autoreleasePoolPop(pool); return j; } -- (void)lowlevelWriteBuffer: (const void*)buffer_ +- (void)lowlevelWriteBuffer: (const void *)buffer_ length: (size_t)length { const char *buffer = buffer_; of_char16_t *tmp; size_t i = 0, j = 0; Index: src/OFStream.h ================================================================== --- src/OFStream.h +++ src/OFStream.h @@ -120,11 +120,11 @@ * @param buffer The buffer into which the data is read * @param length The length of the data that should be read at most. * The buffer *must* be *at least* this big! * @return The number of bytes read */ -- (size_t)readIntoBuffer: (void*)buffer +- (size_t)readIntoBuffer: (void *)buffer length: (size_t)length; /*! * @brief Reads exactly the specified length bytes from the stream into a * buffer. @@ -138,11 +138,11 @@ * * @param buffer The buffer into which the data is read * @param length The length of the data that should be read. * The buffer *must* be *at least* this big! */ - - (void)readIntoBuffer: (void*)buffer + - (void)readIntoBuffer: (void *)buffer exactLength: (size_t)length; #ifdef OF_HAVE_SOCKETS /*! * @brief Asynchronously reads *at most* size bytes from the stream into a @@ -169,11 +169,11 @@ * false from the method. * @param selector The selector to call on the target. The signature must be * `bool (OFStream *stream, void *buffer, size_t length, * OFException *exception)`. */ -- (void)asyncReadIntoBuffer: (void*)buffer +- (void)asyncReadIntoBuffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector; /*! @@ -199,11 +199,11 @@ * false from the method. * @param selector The selector to call on the target. The signature must be * `bool (OFStream *stream, void *buffer, size_t size, * OFException *exception)`. */ -- (void)asyncReadIntoBuffer: (void*)buffer +- (void)asyncReadIntoBuffer: (void *)buffer exactLength: (size_t)length target: (id)target selector: (SEL)selector; # ifdef OF_HAVE_BLOCKS @@ -228,11 +228,11 @@ * If the block returns true, it will be called again with the same * buffer and maximum length when more data has been received. If * you want the next block in the queue to handle the data * received next, you need to return false from the block. */ -- (void)asyncReadIntoBuffer: (void*)buffer +- (void)asyncReadIntoBuffer: (void *)buffer length: (size_t)length block: (of_stream_async_read_block_t)block; /*! * @brief Asynchronously reads exactly the specified length bytes from the @@ -253,11 +253,11 @@ * If the block returns true, it will be called again with the same * buffer and exact length when more data has been received. If * you want the next block in the queue to handle the data * received next, you need to return false from the block. */ - - (void)asyncReadIntoBuffer: (void*)buffer + - (void)asyncReadIntoBuffer: (void *)buffer exactLength: (size_t)length block: (of_stream_async_read_block_t)block; # endif #endif @@ -331,11 +331,11 @@ * @param buffer A buffer of sufficient size to store the specified number of * uint16_ts * @param count The number of uint16_ts to read * @return The number of bytes read */ -- (size_t)readBigEndianInt16sIntoBuffer: (uint16_t*)buffer +- (size_t)readBigEndianInt16sIntoBuffer: (uint16_t *)buffer count: (size_t)count; /*! * @brief Reads the specified number of uint32_ts from the stream which are * encoded in big endian. @@ -346,11 +346,11 @@ * @param buffer A buffer of sufficient size to store the specified number of * uint32_ts * @param count The number of uint32_ts to read * @return The number of bytes read */ -- (size_t)readBigEndianInt32sIntoBuffer: (uint32_t*)buffer +- (size_t)readBigEndianInt32sIntoBuffer: (uint32_t *)buffer count: (size_t)count; /*! * @brief Reads the specified number of uint64_ts from the stream which are * encoded in big endian. @@ -361,11 +361,11 @@ * @param buffer A buffer of sufficient size to store the specified number of * uint64_ts * @param count The number of uint64_ts to read * @return The number of bytes read */ -- (size_t)readBigEndianInt64sIntoBuffer: (uint64_t*)buffer +- (size_t)readBigEndianInt64sIntoBuffer: (uint64_t *)buffer count: (size_t)count; /*! * @brief Reads the specified number of floats from the stream which are encoded * in big endian. @@ -376,11 +376,11 @@ * @param buffer A buffer of sufficient size to store the specified number of * floats * @param count The number of floats to read * @return The number of bytes read */ -- (size_t)readBigEndianFloatsIntoBuffer: (float*)buffer +- (size_t)readBigEndianFloatsIntoBuffer: (float *)buffer count: (size_t)count; /*! * @brief Reads the specified number of doubles from the stream which are * encoded in big endian. @@ -391,11 +391,11 @@ * @param buffer A buffer of sufficient size to store the specified number of * doubles * @param count The number of doubles to read * @return The number of bytes read */ -- (size_t)readBigEndianDoublesIntoBuffer: (double*)buffer +- (size_t)readBigEndianDoublesIntoBuffer: (double *)buffer count: (size_t)count; /*! * @brief Reads a uint16_t from the stream which is encoded in little endian. * @@ -456,11 +456,11 @@ * @param buffer A buffer of sufficient size to store the specified number of * uint16_ts * @param count The number of uint16_ts to read * @return The number of bytes read */ -- (size_t)readLittleEndianInt16sIntoBuffer: (uint16_t*)buffer +- (size_t)readLittleEndianInt16sIntoBuffer: (uint16_t *)buffer count: (size_t)count; /*! * @brief Reads the specified number of uint32_ts from the stream which are * encoded in little endian. @@ -471,11 +471,11 @@ * @param buffer A buffer of sufficient size to store the specified number of * uint32_ts * @param count The number of uint32_ts to read * @return The number of bytes read */ -- (size_t)readLittleEndianInt32sIntoBuffer: (uint32_t*)buffer +- (size_t)readLittleEndianInt32sIntoBuffer: (uint32_t *)buffer count: (size_t)count; /*! * @brief Reads the specified number of uint64_ts from the stream which are * encoded in little endian. @@ -486,11 +486,11 @@ * @param buffer A buffer of sufficient size to store the specified number of * uint64_ts * @param count The number of uint64_ts to read * @return The number of bytes read */ -- (size_t)readLittleEndianInt64sIntoBuffer: (uint64_t*)buffer +- (size_t)readLittleEndianInt64sIntoBuffer: (uint64_t *)buffer count: (size_t)count; /*! * @brief Reads the specified number of floats from the stream which are * encoded in little endian. @@ -501,11 +501,11 @@ * @param buffer A buffer of sufficient size to store the specified number of * floats * @param count The number of floats to read * @return The number of bytes read */ -- (size_t)readLittleEndianFloatsIntoBuffer: (float*)buffer +- (size_t)readLittleEndianFloatsIntoBuffer: (float *)buffer count: (size_t)count; /*! * @brief Reads the specified number of doubles from the stream which are * encoded in little endian. @@ -516,11 +516,11 @@ * @param buffer A buffer of sufficient size to store the specified number of * doubles * @param count The number of doubles to read * @return The number of bytes read */ -- (size_t)readLittleEndianDoublesIntoBuffer: (double*)buffer +- (size_t)readLittleEndianDoublesIntoBuffer: (double *)buffer count: (size_t)count; /*! * @brief Reads the specified number of items with an item size of 1 from the * stream and returns them in an OFDataArray. @@ -529,11 +529,11 @@ * Otherwise you will get an exception! * * @param count The number of items to read * @return An OFDataArray with count items. */ -- (OFDataArray*)readDataArrayWithCount: (size_t)count; +- (OFDataArray *)readDataArrayWithCount: (size_t)count; /*! * @brief Reads the specified number of items with the specified item size from * the stream and returns them in an OFDataArray. * @@ -542,20 +542,20 @@ * * @param itemSize The size of each item * @param count The number of items to read * @return An OFDataArray with count items. */ -- (OFDataArray*)readDataArrayWithItemSize: (size_t)itemSize - count: (size_t)count; +- (OFDataArray *)readDataArrayWithItemSize: (size_t)itemSize + count: (size_t)count; /*! * @brief Returns an OFDataArray with all the remaining data of the stream. * * @return An OFDataArray with an item size of 1 with all the data of the * stream until the end of the stream is reached. */ -- (OFDataArray*)readDataArrayTillEndOfStream; +- (OFDataArray *)readDataArrayTillEndOfStream; /*! * @brief Reads a string with the specified length from the stream. * * If `\0` appears in the stream, the string will be truncated at the `\0` and @@ -567,11 +567,11 @@ * Otherwise you will get an exception! * * @param length The length (in bytes) of the string to read from the stream * @return A string with the specified length */ -- (OFString*)readStringWithLength: (size_t)length; +- (OFString *)readStringWithLength: (size_t)length; /*! * @brief Reads a string with the specified encoding and length from the stream. * * If a `\0` appears in the stream, the string will be truncated at the `\0` @@ -584,30 +584,30 @@ * * @param encoding The encoding of the string to read from the stream * @param length The length (in bytes) of the string to read from the stream * @return A string with the specified length */ -- (OFString*)readStringWithLength: (size_t)length - encoding: (of_string_encoding_t)encoding; +- (OFString *)readStringWithLength: (size_t)length + encoding: (of_string_encoding_t)encoding; /*! * @brief Reads until a newline, `\0` or end of stream occurs. * * @return The line that was read, autoreleased, or `nil` if the end of the * stream has been reached. */ -- (nullable OFString*)readLine; +- (nullable OFString *)readLine; /*! * @brief Reads with the specified encoding until a newline, `\0` or end of * stream occurs. * * @param encoding The encoding used by the stream * @return The line that was read, autoreleased, or `nil` if the end of the * stream has been reached. */ -- (nullable OFString*)readLineWithEncoding: (of_string_encoding_t)encoding; +- (nullable OFString *)readLineWithEncoding: (of_string_encoding_t)encoding; #ifdef OF_HAVE_SOCKETS /*! * @brief Asynchronously reads until a newline, `\0`, end of stream or an * exception occurs. @@ -688,11 +688,11 @@ * `nil` if no complete line has been received yet. * * @return The line that was read, autoreleased, or `nil` if the line is not * complete yet */ -- (nullable OFString*)tryReadLine; +- (nullable OFString *)tryReadLine; /*! * @brief Tries to read a line from the stream with the specified encoding (see * @ref readLineWithEncoding:) and returns `nil` if no complete line has * been received yet. @@ -699,21 +699,21 @@ * * @param encoding The encoding used by the stream * @return The line that was read, autoreleased, or `nil` if the line is not * complete yet */ -- (nullable OFString*)tryReadLineWithEncoding: (of_string_encoding_t)encoding; +- (nullable OFString *)tryReadLineWithEncoding: (of_string_encoding_t)encoding; /*! * @brief Reads until the specified string or `\0` is found or the end of * stream occurs. * * @param delimiter The delimiter * @return The line that was read, autoreleased, or `nil` if the end of the * stream has been reached. */ -- (nullable OFString*)readTillDelimiter: (OFString*)delimiter; +- (nullable OFString *)readTillDelimiter: (OFString *)delimiter; /*! * @brief Reads until the specified string or `\0` is found or the end of * stream occurs. * @@ -720,12 +720,12 @@ * @param delimiter The delimiter * @param encoding The encoding used by the stream * @return The line that was read, autoreleased, or `nil` if the end of the * stream has been reached. */ -- (nullable OFString*)readTillDelimiter: (OFString*)delimiter - encoding: (of_string_encoding_t)encoding; +- (nullable OFString *)readTillDelimiter: (OFString *)delimiter + encoding: (of_string_encoding_t)encoding; /*! * @brief Tries to reads until the specified string or `\0` is found or the end * of stream (see @ref readTillDelimiter:) and returns `nil` if not * enough data has been received yet. @@ -732,11 +732,11 @@ * * @param delimiter The delimiter * @return The line that was read, autoreleased, or `nil` if the end of the * stream has been reached. */ -- (nullable OFString*)tryReadTillDelimiter: (OFString*)delimiter; +- (nullable OFString *)tryReadTillDelimiter: (OFString *)delimiter; /*! * @brief Tries to read until the specified string or `\0` is found or the end * of stream occurs (see @ref readTillDelimiter:encoding:) and returns * `nil` if not enough data has been received yet. @@ -744,12 +744,12 @@ * @param delimiter The delimiter * @param encoding The encoding used by the stream * @return The line that was read, autoreleased, or `nil` if the end of the * stream has been reached. */ -- (nullable OFString*)tryReadTillDelimiter: (OFString*)delimiter - encoding: (of_string_encoding_t)encoding; +- (nullable OFString *)tryReadTillDelimiter: (OFString *)delimiter + encoding: (of_string_encoding_t)encoding; /*! * @brief Returns a boolean whether writes are buffered. * * @return A boolean whether writes are buffered @@ -772,11 +772,11 @@ * @brief Writes from a buffer into the stream. * * @param buffer The buffer from which the data is written to the stream * @param length The length of the data that should be written */ -- (void)writeBuffer: (const void*)buffer +- (void)writeBuffer: (const void *)buffer length: (size_t)length; /*! * @brief Writes a uint8_t into the stream. * @@ -826,11 +826,11 @@ * @param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary * @param count The number of uint16_ts to write * @return The number of bytes written to the stream */ -- (size_t)writeBigEndianInt16s: (const uint16_t*)buffer +- (size_t)writeBigEndianInt16s: (const uint16_t *)buffer count: (size_t)count; /*! * @brief Writes the specified number of uint32_ts into the stream, encoded in * big endian. @@ -838,11 +838,11 @@ * @param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary * @param count The number of uint32_ts to write * @return The number of bytes written to the stream */ -- (size_t)writeBigEndianInt32s: (const uint32_t*)buffer +- (size_t)writeBigEndianInt32s: (const uint32_t *)buffer count: (size_t)count; /*! * @brief Writes the specified number of uint64_ts into the stream, encoded in * big endian. @@ -850,11 +850,11 @@ * @param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary * @param count The number of uint64_ts to write * @return The number of bytes written to the stream */ -- (size_t)writeBigEndianInt64s: (const uint64_t*)buffer +- (size_t)writeBigEndianInt64s: (const uint64_t *)buffer count: (size_t)count; /*! * @brief Writes the specified number of floats into the stream, encoded in big * endian. @@ -862,11 +862,11 @@ * @param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary * @param count The number of floats to write * @return The number of bytes written to the stream */ -- (size_t)writeBigEndianFloats: (const float*)buffer +- (size_t)writeBigEndianFloats: (const float *)buffer count: (size_t)count; /*! * @brief Writes the specified number of doubles into the stream, encoded in * big endian. @@ -874,11 +874,11 @@ * @param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary * @param count The number of doubles to write * @return The number of bytes written to the stream */ -- (size_t)writeBigEndianDoubles: (const double*)buffer +- (size_t)writeBigEndianDoubles: (const double *)buffer count: (size_t)count; /*! * @brief Writes a uint16_t into the stream, encoded in little endian. * @@ -921,11 +921,11 @@ * @param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary * @param count The number of uint16_ts to write * @return The number of bytes written to the stream */ -- (size_t)writeLittleEndianInt16s: (const uint16_t*)buffer +- (size_t)writeLittleEndianInt16s: (const uint16_t *)buffer count: (size_t)count; /*! * @brief Writes the specified number of uint32_ts into the stream, encoded in * little endian. @@ -933,11 +933,11 @@ * @param count The number of uint32_ts to write * @param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary * @return The number of bytes written to the stream */ -- (size_t)writeLittleEndianInt32s: (const uint32_t*)buffer +- (size_t)writeLittleEndianInt32s: (const uint32_t *)buffer count: (size_t)count; /*! * @brief Writes the specified number of uint64_ts into the stream, encoded in * little endian. @@ -945,11 +945,11 @@ * @param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary * @param count The number of uint64_ts to write * @return The number of bytes written to the stream */ -- (size_t)writeLittleEndianInt64s: (const uint64_t*)buffer +- (size_t)writeLittleEndianInt64s: (const uint64_t *)buffer count: (size_t)count; /*! * @brief Writes the specified number of floats into the stream, encoded in * little endian. @@ -957,11 +957,11 @@ * @param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary * @param count The number of floats to write * @return The number of bytes written to the stream */ -- (size_t)writeLittleEndianFloats: (const float*)buffer +- (size_t)writeLittleEndianFloats: (const float *)buffer count: (size_t)count; /*! * @brief Writes the specified number of doubles into the stream, encoded in * little endian. @@ -969,81 +969,83 @@ * @param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary * @param count The number of doubles to write * @return The number of bytes written to the stream */ -- (size_t)writeLittleEndianDoubles: (const double*)buffer +- (size_t)writeLittleEndianDoubles: (const double *)buffer count: (size_t)count; /*! * @brief Writes from an OFDataArray into the stream. * * @param dataArray The OFDataArray to write into the stream * @return The number of bytes written */ -- (size_t)writeDataArray: (OFDataArray*)dataArray; +- (size_t)writeDataArray: (OFDataArray *)dataArray; /*! * @brief Writes a string into the stream, without the trailing zero. * * @param string The string from which the data is written to the stream * @return The number of bytes written */ -- (size_t)writeString: (OFString*)string; +- (size_t)writeString: (OFString *)string; /*! * @brief Writes a string into the stream in the specified encoding, without * the trailing zero. * * @param string The string from which the data is written to the stream * @param encoding The encoding in which to write the string to the stream * @return The number of bytes written */ -- (size_t)writeString: (OFString*)string +- (size_t)writeString: (OFString *)string encoding: (of_string_encoding_t)encoding; /*! * @brief Writes a string into the stream with a trailing newline. * * @param string The string from which the data is written to the stream * @return The number of bytes written */ -- (size_t)writeLine: (OFString*)string; +- (size_t)writeLine: (OFString *)string; /*! * @brief Writes a string into the stream in the specified encoding with a * trailing newline. * * @param string The string from which the data is written to the stream * @param encoding The encoding in which to write the string to the stream * @return The number of bytes written */ -- (size_t)writeLine: (OFString*)string +- (size_t)writeLine: (OFString *)string encoding: (of_string_encoding_t)encoding; /*! * @brief Writes a formatted string into the stream. * - * See printf for the format syntax. As an addition, %@ is available as format - * specifier for objects, %C for of_unichar_t and %S for const of_unichar_t*. + * See printf for the format syntax. As an addition, `%@` is available as + * format specifier for objects, `%C` for `of_unichar_t` and `%S` for + * `const of_unichar_t *`. * * @param format A string used as format * @return The number of bytes written */ -- (size_t)writeFormat: (OFConstantString*)format, ...; +- (size_t)writeFormat: (OFConstantString *)format, ...; /*! * @brief Writes a formatted string into the stream. * - * See printf for the format syntax. As an addition, %@ is available as format - * specifier for objects, %C for of_unichar_t and %S for const of_unichar_t*. + * See printf for the format syntax. As an addition, `%@` is available as + * format specifier for objects, `%C` for `of_unichar_t` and `%S` for + * `const of_unichar_t *`. * * @param format A string used as format * @param arguments The arguments used in the format string * @return The number of bytes written */ -- (size_t)writeFormat: (OFConstantString*)format +- (size_t)writeFormat: (OFConstantString *)format arguments: (va_list)arguments; /*! * @brief Returns whether data is present in the internal read buffer. * @@ -1108,11 +1110,11 @@ * unread. * * @param buffer The buffer to unread * @param length The length of the buffer to unread */ -- (void)unreadFromBuffer: (const void*)buffer +- (void)unreadFromBuffer: (const void *)buffer length: (size_t)length; /*! * @brief Closes the stream. * @@ -1130,11 +1132,11 @@ * * @param buffer The buffer for the data to read * @param length The length of the buffer * @return The number of bytes read */ -- (size_t)lowlevelReadIntoBuffer: (void*)buffer +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length; /*! * @brief Performs a lowlevel write. * @@ -1144,11 +1146,11 @@ * subclassing! * * @param buffer The buffer with the data to write * @param length The length of the data to write */ -- (void)lowlevelWriteBuffer: (const void*)buffer +- (void)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length; /*! * @brief Returns whether the lowlevel is at the end of the stream. * Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -86,17 +86,17 @@ - (bool)lowlevelIsAtEndOfStream { OF_UNRECOGNIZED_SELECTOR } -- (size_t)lowlevelReadIntoBuffer: (void*)buffer +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { OF_UNRECOGNIZED_SELECTOR } -- (void)lowlevelWriteBuffer: (const void*)buffer +- (void)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { OF_UNRECOGNIZED_SELECTOR } @@ -111,11 +111,11 @@ return false; return [self lowlevelIsAtEndOfStream]; } -- (size_t)readIntoBuffer: (void*)buffer +- (size_t)readIntoBuffer: (void *)buffer length: (size_t)length { if (_readBufferLength == 0) { /* * For small sizes, it is cheaper to read more and cache the @@ -169,22 +169,22 @@ return length; } } -- (void)readIntoBuffer: (void*)buffer +- (void)readIntoBuffer: (void *)buffer exactLength: (size_t)length { size_t readLength = 0; while (readLength < length) - readLength += [self readIntoBuffer: (char*)buffer + readLength + readLength += [self readIntoBuffer: (char *)buffer + readLength length: length - readLength]; } #ifdef OF_HAVE_SOCKETS -- (void)asyncReadIntoBuffer: (void*)buffer +- (void)asyncReadIntoBuffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector { [OFRunLoop OF_addAsyncReadForStream: self @@ -192,11 +192,11 @@ length: length target: target selector: selector]; } -- (void)asyncReadIntoBuffer: (void*)buffer +- (void)asyncReadIntoBuffer: (void *)buffer exactLength: (size_t)length target: (id)target selector: (SEL)selector { [OFRunLoop OF_addAsyncReadForStream: self @@ -205,21 +205,21 @@ target: target selector: selector]; } # ifdef OF_HAVE_BLOCKS -- (void)asyncReadIntoBuffer: (void*)buffer +- (void)asyncReadIntoBuffer: (void *)buffer length: (size_t)length block: (of_stream_async_read_block_t)block { [OFRunLoop OF_addAsyncReadForStream: self buffer: buffer length: length block: block]; } -- (void)asyncReadIntoBuffer: (void*)buffer +- (void)asyncReadIntoBuffer: (void *)buffer exactLength: (size_t)length block: (of_stream_async_read_block_t)block { [OFRunLoop OF_addAsyncReadForStream: self buffer: buffer @@ -231,67 +231,67 @@ - (uint8_t)readInt8 { uint8_t ret; - [self readIntoBuffer: (char*)&ret + [self readIntoBuffer: (char *)&ret exactLength: 1]; return ret; } - (uint16_t)readBigEndianInt16 { uint16_t ret; - [self readIntoBuffer: (char*)&ret + [self readIntoBuffer: (char *)&ret exactLength: 2]; return OF_BSWAP16_IF_LE(ret); } - (uint32_t)readBigEndianInt32 { uint32_t ret; - [self readIntoBuffer: (char*)&ret + [self readIntoBuffer: (char *)&ret exactLength: 4]; return OF_BSWAP32_IF_LE(ret); } - (uint64_t)readBigEndianInt64 { uint64_t ret; - [self readIntoBuffer: (char*)&ret + [self readIntoBuffer: (char *)&ret exactLength: 8]; return OF_BSWAP64_IF_LE(ret); } - (float)readBigEndianFloat { float ret; - [self readIntoBuffer: (char*)&ret + [self readIntoBuffer: (char *)&ret exactLength: 4]; return OF_BSWAP_FLOAT_IF_LE(ret); } - (double)readBigEndianDouble { double ret; - [self readIntoBuffer: (char*)&ret + [self readIntoBuffer: (char *)&ret exactLength: 8]; return OF_BSWAP_DOUBLE_IF_LE(ret); } -- (size_t)readBigEndianInt16sIntoBuffer: (uint16_t*)buffer +- (size_t)readBigEndianInt16sIntoBuffer: (uint16_t *)buffer count: (size_t)count { size_t size = count * sizeof(uint16_t); [self readIntoBuffer: buffer @@ -303,11 +303,11 @@ #endif return size; } -- (size_t)readBigEndianInt32sIntoBuffer: (uint32_t*)buffer +- (size_t)readBigEndianInt32sIntoBuffer: (uint32_t *)buffer count: (size_t)count { size_t size = count * sizeof(uint32_t); [self readIntoBuffer: buffer @@ -319,11 +319,11 @@ #endif return size; } -- (size_t)readBigEndianInt64sIntoBuffer: (uint64_t*)buffer +- (size_t)readBigEndianInt64sIntoBuffer: (uint64_t *)buffer count: (size_t)count { size_t size = count * sizeof(uint64_t); [self readIntoBuffer: buffer @@ -335,11 +335,11 @@ #endif return size; } -- (size_t)readBigEndianFloatsIntoBuffer: (float*)buffer +- (size_t)readBigEndianFloatsIntoBuffer: (float *)buffer count: (size_t)count { size_t size = count * sizeof(float); [self readIntoBuffer: buffer @@ -351,11 +351,11 @@ #endif return size; } -- (size_t)readBigEndianDoublesIntoBuffer: (double*)buffer +- (size_t)readBigEndianDoublesIntoBuffer: (double *)buffer count: (size_t)count { size_t size = count * sizeof(double); [self readIntoBuffer: buffer @@ -371,57 +371,57 @@ - (uint16_t)readLittleEndianInt16 { uint16_t ret; - [self readIntoBuffer: (char*)&ret + [self readIntoBuffer: (char *)&ret exactLength: 2]; return OF_BSWAP16_IF_BE(ret); } - (uint32_t)readLittleEndianInt32 { uint32_t ret; - [self readIntoBuffer: (char*)&ret + [self readIntoBuffer: (char *)&ret exactLength: 4]; return OF_BSWAP32_IF_BE(ret); } - (uint64_t)readLittleEndianInt64 { uint64_t ret; - [self readIntoBuffer: (char*)&ret + [self readIntoBuffer: (char *)&ret exactLength: 8]; return OF_BSWAP64_IF_BE(ret); } - (float)readLittleEndianFloat { float ret; - [self readIntoBuffer: (char*)&ret + [self readIntoBuffer: (char *)&ret exactLength: 4]; return OF_BSWAP_FLOAT_IF_BE(ret); } - (double)readLittleEndianDouble { double ret; - [self readIntoBuffer: (char*)&ret + [self readIntoBuffer: (char *)&ret exactLength: 8]; return OF_BSWAP_DOUBLE_IF_BE(ret); } -- (size_t)readLittleEndianInt16sIntoBuffer: (uint16_t*)buffer +- (size_t)readLittleEndianInt16sIntoBuffer: (uint16_t *)buffer count: (size_t)count { size_t size = count * sizeof(uint16_t); [self readIntoBuffer: buffer @@ -433,11 +433,11 @@ #endif return size; } -- (size_t)readLittleEndianInt32sIntoBuffer: (uint32_t*)buffer +- (size_t)readLittleEndianInt32sIntoBuffer: (uint32_t *)buffer count: (size_t)count { size_t size = count * sizeof(uint32_t); [self readIntoBuffer: buffer @@ -449,11 +449,11 @@ #endif return size; } -- (size_t)readLittleEndianInt64sIntoBuffer: (uint64_t*)buffer +- (size_t)readLittleEndianInt64sIntoBuffer: (uint64_t *)buffer count: (size_t)count { size_t size = count * sizeof(uint64_t); [self readIntoBuffer: buffer @@ -465,11 +465,11 @@ #endif return size; } -- (size_t)readLittleEndianFloatsIntoBuffer: (float*)buffer +- (size_t)readLittleEndianFloatsIntoBuffer: (float *)buffer count: (size_t)count { size_t size = count * sizeof(float); [self readIntoBuffer: buffer @@ -481,11 +481,11 @@ #endif return size; } -- (size_t)readLittleEndianDoublesIntoBuffer: (double*)buffer +- (size_t)readLittleEndianDoublesIntoBuffer: (double *)buffer count: (size_t)count { size_t size = count * sizeof(double); [self readIntoBuffer: buffer @@ -497,18 +497,18 @@ #endif return size; } -- (OFDataArray*)readDataArrayWithCount: (size_t)count +- (OFDataArray *)readDataArrayWithCount: (size_t)count { return [self readDataArrayWithItemSize: 1 count: count]; } -- (OFDataArray*)readDataArrayWithItemSize: (size_t)itemSize - count: (size_t)count +- (OFDataArray *)readDataArrayWithItemSize: (size_t)itemSize + count: (size_t)count { OFDataArray *dataArray; char *tmp; dataArray = [OFDataArray dataArrayWithItemSize: itemSize]; @@ -526,11 +526,11 @@ } return dataArray; } -- (OFDataArray*)readDataArrayTillEndOfStream +- (OFDataArray *)readDataArrayTillEndOfStream { OFDataArray *dataArray; size_t pageSize; char *buffer; @@ -552,18 +552,18 @@ } return dataArray; } -- (OFString*)readStringWithLength: (size_t)length +- (OFString *)readStringWithLength: (size_t)length { return [self readStringWithLength: length encoding: OF_STRING_ENCODING_UTF_8]; } -- (OFString*)readStringWithLength: (size_t)length - encoding: (of_string_encoding_t)encoding +- (OFString *)readStringWithLength: (size_t)length + encoding: (of_string_encoding_t)encoding { OFString *ret; char *buffer = [self allocMemoryWithSize: length + 1]; buffer[length] = 0; @@ -578,11 +578,11 @@ } return ret; } -- (OFString*)tryReadLineWithEncoding: (of_string_encoding_t)encoding +- (OFString *)tryReadLineWithEncoding: (of_string_encoding_t)encoding { size_t pageSize, bufferLength, retLength; char *retCString, *buffer, *readBuffer; OFString *ret; @@ -731,16 +731,16 @@ _waitingForDelimiter = true; return nil; } -- (OFString*)readLine +- (OFString *)readLine { return [self readLineWithEncoding: OF_STRING_ENCODING_UTF_8]; } -- (OFString*)readLineWithEncoding: (of_string_encoding_t)encoding +- (OFString *)readLineWithEncoding: (of_string_encoding_t)encoding { OFString *line = nil; while ((line = [self tryReadLineWithEncoding: encoding]) == nil) if ([self isAtEndOfStream]) @@ -783,17 +783,17 @@ block: block]; } # endif #endif -- (OFString*)tryReadLine +- (OFString *)tryReadLine { return [self tryReadLineWithEncoding: OF_STRING_ENCODING_UTF_8]; } -- (OFString*)tryReadTillDelimiter: (OFString*)delimiter - encoding: (of_string_encoding_t)encoding +- (OFString *)tryReadTillDelimiter: (OFString *)delimiter + encoding: (of_string_encoding_t)encoding { const char *delimiterCString; size_t j, delimiterLength, pageSize, bufferLength, retLength; char *retCString, *buffer, *readBuffer; OFString *ret; @@ -927,18 +927,18 @@ _waitingForDelimiter = true; return nil; } -- (OFString*)readTillDelimiter: (OFString*)delimiter +- (OFString *)readTillDelimiter: (OFString *)delimiter { return [self readTillDelimiter: delimiter encoding: OF_STRING_ENCODING_UTF_8]; } -- (OFString*)readTillDelimiter: (OFString*)delimiter - encoding: (of_string_encoding_t)encoding +- (OFString *)readTillDelimiter: (OFString *)delimiter + encoding: (of_string_encoding_t)encoding { OFString *ret = nil; while ((ret = [self tryReadTillDelimiter: delimiter @@ -947,11 +947,11 @@ return nil; return ret; } -- (OFString*)tryReadTillDelimiter: (OFString*)delimiter +- (OFString *)tryReadTillDelimiter: (OFString *)delimiter { return [self tryReadTillDelimiter: delimiter encoding: OF_STRING_ENCODING_UTF_8]; } @@ -976,11 +976,11 @@ [self freeMemory: _writeBuffer]; _writeBuffer = NULL; _writeBufferLength = 0; } -- (void)writeBuffer: (const void*)buffer +- (void)writeBuffer: (const void *)buffer length: (size_t)length { if (!_writeBuffered) [self lowlevelWriteBuffer: buffer length: length]; @@ -992,55 +992,55 @@ } } - (void)writeInt8: (uint8_t)int8 { - [self writeBuffer: (char*)&int8 + [self writeBuffer: (char *)&int8 length: 1]; } - (void)writeBigEndianInt16: (uint16_t)int16 { int16 = OF_BSWAP16_IF_LE(int16); - [self writeBuffer: (char*)&int16 + [self writeBuffer: (char *)&int16 length: 2]; } - (void)writeBigEndianInt32: (uint32_t)int32 { int32 = OF_BSWAP32_IF_LE(int32); - [self writeBuffer: (char*)&int32 + [self writeBuffer: (char *)&int32 length: 4]; } - (void)writeBigEndianInt64: (uint64_t)int64 { int64 = OF_BSWAP64_IF_LE(int64); - [self writeBuffer: (char*)&int64 + [self writeBuffer: (char *)&int64 length: 8]; } - (void)writeBigEndianFloat: (float)float_ { float_ = OF_BSWAP_FLOAT_IF_LE(float_); - [self writeBuffer: (char*)&float_ + [self writeBuffer: (char *)&float_ length: 4]; } - (void)writeBigEndianDouble: (double)double_ { double_ = OF_BSWAP_DOUBLE_IF_LE(double_); - [self writeBuffer: (char*)&double_ + [self writeBuffer: (char *)&double_ length: 8]; } -- (size_t)writeBigEndianInt16s: (const uint16_t*)buffer +- (size_t)writeBigEndianInt16s: (const uint16_t *)buffer count: (size_t)count { size_t size = count * sizeof(uint16_t); #ifdef OF_BIG_ENDIAN @@ -1062,11 +1062,11 @@ #endif return size; } -- (size_t)writeBigEndianInt32s: (const uint32_t*)buffer +- (size_t)writeBigEndianInt32s: (const uint32_t *)buffer count: (size_t)count { size_t size = count * sizeof(uint32_t); #ifdef OF_BIG_ENDIAN @@ -1088,11 +1088,11 @@ #endif return size; } -- (size_t)writeBigEndianInt64s: (const uint64_t*)buffer +- (size_t)writeBigEndianInt64s: (const uint64_t *)buffer count: (size_t)count { size_t size = count * sizeof(uint64_t); #ifdef OF_BIG_ENDIAN @@ -1114,11 +1114,11 @@ #endif return size; } -- (size_t)writeBigEndianFloats: (const float*)buffer +- (size_t)writeBigEndianFloats: (const float *)buffer count: (size_t)count { size_t size = count * sizeof(float); #ifdef OF_FLOAT_BIG_ENDIAN @@ -1140,11 +1140,11 @@ #endif return size; } -- (size_t)writeBigEndianDoubles: (const double*)buffer +- (size_t)writeBigEndianDoubles: (const double *)buffer count: (size_t)count { size_t size = count * sizeof(double); #ifdef OF_FLOAT_BIG_ENDIAN @@ -1170,47 +1170,47 @@ - (void)writeLittleEndianInt16: (uint16_t)int16 { int16 = OF_BSWAP16_IF_BE(int16); - [self writeBuffer: (char*)&int16 + [self writeBuffer: (char *)&int16 length: 2]; } - (void)writeLittleEndianInt32: (uint32_t)int32 { int32 = OF_BSWAP32_IF_BE(int32); - [self writeBuffer: (char*)&int32 + [self writeBuffer: (char *)&int32 length: 4]; } - (void)writeLittleEndianInt64: (uint64_t)int64 { int64 = OF_BSWAP64_IF_BE(int64); - [self writeBuffer: (char*)&int64 + [self writeBuffer: (char *)&int64 length: 8]; } - (void)writeLittleEndianFloat: (float)float_ { float_ = OF_BSWAP_FLOAT_IF_BE(float_); - [self writeBuffer: (char*)&float_ + [self writeBuffer: (char *)&float_ length: 4]; } - (void)writeLittleEndianDouble: (double)double_ { double_ = OF_BSWAP_DOUBLE_IF_BE(double_); - [self writeBuffer: (char*)&double_ + [self writeBuffer: (char *)&double_ length: 8]; } -- (size_t)writeLittleEndianInt16s: (const uint16_t*)buffer +- (size_t)writeLittleEndianInt16s: (const uint16_t *)buffer count: (size_t)count { size_t size = count * sizeof(uint16_t); #ifndef OF_BIG_ENDIAN @@ -1232,11 +1232,11 @@ #endif return size; } -- (size_t)writeLittleEndianInt32s: (const uint32_t*)buffer +- (size_t)writeLittleEndianInt32s: (const uint32_t *)buffer count: (size_t)count { size_t size = count * sizeof(uint32_t); #ifndef OF_BIG_ENDIAN @@ -1258,11 +1258,11 @@ #endif return size; } -- (size_t)writeLittleEndianInt64s: (const uint64_t*)buffer +- (size_t)writeLittleEndianInt64s: (const uint64_t *)buffer count: (size_t)count { size_t size = count * sizeof(uint64_t); #ifndef OF_BIG_ENDIAN @@ -1284,11 +1284,11 @@ #endif return size; } -- (size_t)writeLittleEndianFloats: (const float*)buffer +- (size_t)writeLittleEndianFloats: (const float *)buffer count: (size_t)count { size_t size = count * sizeof(float); #ifndef OF_FLOAT_BIG_ENDIAN @@ -1310,11 +1310,11 @@ #endif return size; } -- (size_t)writeLittleEndianDoubles: (const double*)buffer +- (size_t)writeLittleEndianDoubles: (const double *)buffer count: (size_t)count { size_t size = count * sizeof(double); #ifndef OF_FLOAT_BIG_ENDIAN @@ -1336,27 +1336,27 @@ #endif return size; } -- (size_t)writeDataArray: (OFDataArray*)dataArray +- (size_t)writeDataArray: (OFDataArray *)dataArray { size_t length = [dataArray count] * [dataArray itemSize]; [self writeBuffer: [dataArray items] length: length]; return length; } -- (size_t)writeString: (OFString*)string +- (size_t)writeString: (OFString *)string { return [self writeString: string encoding: OF_STRING_ENCODING_UTF_8]; } -- (size_t)writeString: (OFString*)string +- (size_t)writeString: (OFString *)string encoding: (of_string_encoding_t)encoding { size_t length = [string cStringLengthWithEncoding: encoding]; [self writeBuffer: [string cStringWithEncoding: encoding] @@ -1363,17 +1363,17 @@ length: length]; return length; } -- (size_t)writeLine: (OFString*)string +- (size_t)writeLine: (OFString *)string { return [self writeLine: string encoding: OF_STRING_ENCODING_UTF_8]; } -- (size_t)writeLine: (OFString*)string +- (size_t)writeLine: (OFString *)string encoding: (of_string_encoding_t)encoding { size_t stringLength = [string cStringLengthWithEncoding: encoding]; char *buffer; @@ -1391,11 +1391,11 @@ } return stringLength + 1; } -- (size_t)writeFormat: (OFConstantString*)format, ... +- (size_t)writeFormat: (OFConstantString *)format, ... { va_list arguments; size_t ret; va_start(arguments, format); @@ -1404,11 +1404,11 @@ va_end(arguments); return ret; } -- (size_t)writeFormat: (OFConstantString*)format +- (size_t)writeFormat: (OFConstantString *)format arguments: (va_list)arguments { char *UTF8String; int length; @@ -1519,11 +1519,11 @@ { [OFRunLoop OF_cancelAsyncRequestsForObject: self]; } #endif -- (void)unreadFromBuffer: (const void*)buffer +- (void)unreadFromBuffer: (const void *)buffer length: (size_t)length { char *readBuffer; if (length > SIZE_MAX - _readBufferLength) Index: src/OFStreamSocket.m ================================================================== --- src/OFStreamSocket.m +++ src/OFStreamSocket.m @@ -51,11 +51,11 @@ - (bool)lowlevelIsAtEndOfStream { return _atEndOfStream; } -- (size_t)lowlevelReadIntoBuffer: (void*)buffer +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { ssize_t ret; if (_socket == INVALID_SOCKET) @@ -87,11 +87,11 @@ _atEndOfStream = true; return ret; } -- (void)lowlevelWriteBuffer: (const void*)buffer +- (void)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; Index: src/OFString+CryptoHashing.h ================================================================== --- src/OFString+CryptoHashing.h +++ src/OFString+CryptoHashing.h @@ -30,51 +30,51 @@ /*! * @brief Returns the MD5 hash of the string as an autoreleased OFString. * * @return The MD5 hash of the string as an autoreleased OFString */ -- (OFString*)MD5Hash; +- (OFString *)MD5Hash; /*! * @brief Returns the RIPEMD-160 hash of the string as an autoreleased OFString. * * @return The RIPEMD-160 hash of the string as an autoreleased OFString */ -- (OFString*)RIPEMD160Hash; +- (OFString *)RIPEMD160Hash; /*! * @brief Returns the SHA-1 hash of the string as an autoreleased OFString. * * @return The SHA-1 hash of the string as an autoreleased OFString */ -- (OFString*)SHA1Hash; +- (OFString *)SHA1Hash; /*! * @brief Returns the SHA-224 hash of the string as an autoreleased OFString. * * @return The SHA-224 hash of the string as an autoreleased OFString */ -- (OFString*)SHA224Hash; +- (OFString *)SHA224Hash; /*! * @brief Returns the SHA-256 hash of the string as an autoreleased OFString. * * @return The SHA-256 hash of the string as an autoreleased OFString */ -- (OFString*)SHA256Hash; +- (OFString *)SHA256Hash; /*! * @brief Returns the SHA-384 hash of the string as an autoreleased OFString. * * @return The SHA-384 hash of the string as an autoreleased OFString */ -- (OFString*)SHA384Hash; +- (OFString *)SHA384Hash; /*! * @brief Returns the SHA-512 hash of the string as an autoreleased OFString. * * @return The SHA-512 hash of the string as an autoreleased OFString */ -- (OFString*)SHA512Hash; +- (OFString *)SHA512Hash; @end OF_ASSUME_NONNULL_END Index: src/OFString+CryptoHashing.m ================================================================== --- src/OFString+CryptoHashing.m +++ src/OFString+CryptoHashing.m @@ -27,11 +27,11 @@ #import "OFSHA512Hash.h" int _OFString_CryptoHashing_reference; @implementation OFString (CryptoHashing) -- (OFString*)OF_cryptoHashWithClass: (Class )class +- (OFString *)OF_cryptoHashWithClass: (Class )class { void *pool = objc_autoreleasePoolPush(); id hash = [class cryptoHash]; size_t digestSize = [class digestSize]; const unsigned char *digest; @@ -56,40 +56,40 @@ return [OFString stringWithCString: cString encoding: OF_STRING_ENCODING_ASCII length: digestSize * 2]; } -- (OFString*)MD5Hash +- (OFString *)MD5Hash { return [self OF_cryptoHashWithClass: [OFMD5Hash class]]; } -- (OFString*)RIPEMD160Hash +- (OFString *)RIPEMD160Hash { return [self OF_cryptoHashWithClass: [OFRIPEMD160Hash class]]; } -- (OFString*)SHA1Hash +- (OFString *)SHA1Hash { return [self OF_cryptoHashWithClass: [OFSHA1Hash class]]; } -- (OFString*)SHA224Hash +- (OFString *)SHA224Hash { return [self OF_cryptoHashWithClass: [OFSHA224Hash class]]; } -- (OFString*)SHA256Hash +- (OFString *)SHA256Hash { return [self OF_cryptoHashWithClass: [OFSHA256Hash class]]; } -- (OFString*)SHA384Hash +- (OFString *)SHA384Hash { return [self OF_cryptoHashWithClass: [OFSHA384Hash class]]; } -- (OFString*)SHA512Hash +- (OFString *)SHA512Hash { return [self OF_cryptoHashWithClass: [OFSHA512Hash class]]; } @end Index: src/OFString+JSONValue.m ================================================================== --- src/OFString+JSONValue.m +++ src/OFString+JSONValue.m @@ -135,11 +135,11 @@ return 0xFFFF; return ret; } -static inline OFString* +static inline OFString * parseString(const char **pointer, const char *stop, size_t *line) { char *buffer; size_t i = 0; char delimiter = **pointer; @@ -286,11 +286,11 @@ free(buffer); return nil; } -static inline OFString* +static inline OFString * parseIdentifier(const char **pointer, const char *stop) { char *buffer; size_t i = 0; @@ -386,11 +386,11 @@ * reach stop. */ return nil; } -static inline OFMutableArray* +static inline OFMutableArray * parseArray(const char **pointer, const char *stop, size_t *line, size_t depth, size_t depthLimit) { OFMutableArray *array = [OFMutableArray array]; @@ -443,11 +443,11 @@ (*pointer)++; return array; } -static inline OFMutableDictionary* +static inline OFMutableDictionary * parseDictionary(const char **pointer, const char *stop, size_t *line, size_t depth, size_t depthLimit) { OFMutableDictionary *dictionary = [OFMutableDictionary dictionary]; @@ -522,11 +522,11 @@ (*pointer)++; return dictionary; } -static inline OFNumber* +static inline OFNumber * parseNumber(const char **pointer, const char *stop, size_t *line) { bool isHex = (*pointer + 1 < stop && (*pointer)[1] == 'x'); bool hasDecimal = false; size_t i; Index: src/OFString+URLEncoding.h ================================================================== --- src/OFString+URLEncoding.h +++ src/OFString+URLEncoding.h @@ -30,26 +30,26 @@ /*! * @brief Encodes a string for use in a URL. * * @return A new autoreleased string */ -- (OFString*)stringByURLEncoding; +- (OFString *)stringByURLEncoding; /*! * @brief Encodes a string for use in a URL, but does not escape the specified * ignored characters. * * @param allowed A C string of characters that should not be escaped * * @return A new autoreleased string */ -- (OFString*)stringByURLEncodingWithAllowedCharacters: (const char*)allowed; +- (OFString *)stringByURLEncodingWithAllowedCharacters: (const char *)allowed; /*! * @brief Decodes a string used in a URL. * * @return A new autoreleased string */ -- (OFString*)stringByURLDecoding; +- (OFString *)stringByURLDecoding; @end OF_ASSUME_NONNULL_END Index: src/OFString+URLEncoding.m ================================================================== --- src/OFString+URLEncoding.m +++ src/OFString+URLEncoding.m @@ -26,16 +26,16 @@ /* Reference for static linking */ int _OFString_URLEncoding_reference; @implementation OFString (URLEncoding) -- (OFString*)stringByURLEncoding +- (OFString *)stringByURLEncoding { return [self stringByURLEncodingWithAllowedCharacters: "$-_.!*()"]; } -- (OFString*)stringByURLEncodingWithAllowedCharacters: (const char*)allowed +- (OFString *)stringByURLEncodingWithAllowedCharacters: (const char *)allowed { void *pool = objc_autoreleasePoolPush(); const char *string = [self UTF8String]; char *retCString; size_t i; @@ -84,11 +84,11 @@ } return ret; } -- (OFString*)stringByURLDecoding +- (OFString *)stringByURLDecoding { void *pool = objc_autoreleasePoolPush(); OFString *ret; const char *string = [self UTF8String]; char *retCString; Index: src/OFString+XMLEscaping.h ================================================================== --- src/OFString+XMLEscaping.h +++ src/OFString+XMLEscaping.h @@ -30,9 +30,9 @@ /*! * @brief Escapes a string for use in an XML document. * * @return A new autoreleased string */ -- (OFString*)stringByXMLEscaping; +- (OFString *)stringByXMLEscaping; @end OF_ASSUME_NONNULL_END Index: src/OFString+XMLEscaping.m ================================================================== --- src/OFString+XMLEscaping.m +++ src/OFString+XMLEscaping.m @@ -25,11 +25,11 @@ #import "OFOutOfMemoryException.h" int _OFString_XMLEscaping_reference; @implementation OFString (XMLEscaping) -- (OFString*)stringByXMLEscaping +- (OFString *)stringByXMLEscaping { void *pool = objc_autoreleasePoolPush(); char *retCString; const char *string, *append; size_t length, retLength, appendLen; Index: src/OFString+XMLUnescaping.h ================================================================== --- src/OFString+XMLUnescaping.h +++ src/OFString+XMLUnescaping.h @@ -58,37 +58,37 @@ * * @param string The string which contains the unknown entity * @param entity The name of the entity that is unknown * @return A substitution for the entity or `nil` */ -- (OFString*)string: (OFString*)string - containsUnknownEntityNamed: (OFString*)entity; +- (OFString *)string: (OFString *)string + containsUnknownEntityNamed: (OFString *)entity; @end @interface OFString (XMLUnescaping) /*! * @brief Unescapes XML in the string. */ -- (OFString*)stringByXMLUnescaping; +- (OFString *)stringByXMLUnescaping; /*! * @brief Unescapes XML in the string and uses the specified delegate for * unknown entities. * * @param delegate An OFXMLUnescapingDelegate as a handler for unknown entities */ -- (OFString*)stringByXMLUnescapingWithDelegate: +- (OFString *)stringByXMLUnescapingWithDelegate: (nullable id )delegate; #ifdef OF_HAVE_BLOCKS /*! * @brief Unescapes XML in the string and uses the specified block for unknown * entities. * * @param block A block which handles unknown entities */ -- (OFString*)stringByXMLUnescapingWithBlock: +- (OFString *)stringByXMLUnescapingWithBlock: (of_string_xml_unescaping_block_t)block; #endif @end OF_ASSUME_NONNULL_END Index: src/OFString+XMLUnescaping.m ================================================================== --- src/OFString+XMLUnescaping.m +++ src/OFString+XMLUnescaping.m @@ -23,11 +23,11 @@ #import "OFInvalidFormatException.h" #import "OFUnknownXMLEntityException.h" int _OFString_XMLUnescaping_reference; -static OF_INLINE OFString* +static OF_INLINE OFString * parseNumericEntity(const char *entity, size_t length) { of_unichar_t c; size_t i; char buffer[5]; @@ -71,12 +71,12 @@ return [OFString stringWithUTF8String: buffer length: i]; } -static OFString* -parseEntities(OFString *self, id (*lookup)(void*, OFString*, OFString*), +static OFString * +parseEntities(OFString *self, id (*lookup)(void *, OFString *, OFString *), void *context) { OFMutableString *ret; void *pool; const char *string; @@ -203,24 +203,24 @@ return block(self, entity); } #endif @implementation OFString (XMLUnescaping) -- (OFString*)stringByXMLUnescaping +- (OFString *)stringByXMLUnescaping { return [self stringByXMLUnescapingWithDelegate: nil]; } -- (OFString*)stringByXMLUnescapingWithDelegate: +- (OFString *)stringByXMLUnescapingWithDelegate: (id )delegate { return parseEntities(self, lookupUsingDelegate, delegate); } #ifdef OF_HAVE_BLOCKS -- (OFString*)stringByXMLUnescapingWithBlock: +- (OFString *)stringByXMLUnescapingWithBlock: (of_string_xml_unescaping_block_t)block { return parseEntities(self, lookupUsingBlock, block); } #endif @end Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -121,21 +121,21 @@ * @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 */ -+ (instancetype)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 */ -+ (instancetype)stringWithUTF8String: (const char*)UTF8String ++ (instancetype)stringWithUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength; /*! * @brief Creates a new OFString from a UTF-8 encoded C string without copying * the string. @@ -143,21 +143,21 @@ * @param UTF8String A UTF-8 encoded C string to initialize the OFString with * @param freeWhenDone Whether to free the C string when the OFString gets * deallocated * @return A new autoreleased OFString */ -+ (instancetype)stringWithUTF8StringNoCopy: (char*)UTF8String ++ (instancetype)stringWithUTF8StringNoCopy: (char *)UTF8String freeWhenDone: (bool)freeWhenDone; /*! * @brief Creates a new OFString from a C string with the specified encoding. * * @param cString A C string to initialize the OFString with * @param encoding The encoding of the C string * @return A new autoreleased OFString */ -+ (instancetype)stringWithCString: (const char*)cString ++ (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. @@ -165,50 +165,50 @@ * @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 */ -+ (instancetype)stringWithCString: (const char*)cString ++ (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 */ -+ (instancetype)stringWithString: (OFString*)string; ++ (instancetype)stringWithString: (OFString *)string; /*! * @brief Creates a new OFString from a Unicode string with the specified * length. * * @param characters An array of Unicode characters * @param length The length of the Unicode character array * @return A new autoreleased OFString */ -+ (instancetype)stringWithCharacters: (const of_unichar_t*)characters ++ (instancetype)stringWithCharacters: (const of_unichar_t *)characters 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 */ -+ (instancetype)stringWithUTF16String: (const of_char16_t*)string; ++ (instancetype)stringWithUTF16String: (const of_char16_t *)string; /*! * @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 UTF-16 string * @return A new autoreleased OFString */ -+ (instancetype)stringWithUTF16String: (const of_char16_t*)string ++ (instancetype)stringWithUTF16String: (const of_char16_t *)string length: (size_t)length; /*! * @brief Creates a new OFString from a UTF-16 encoded string, assuming the * specified byte order if no byte order mark is found. @@ -215,11 +215,11 @@ * * @param string The UTF-16 string * @param byteOrder The byte order to assume if there is no byte order mark * @return A new autoreleased OFString */ -+ (instancetype)stringWithUTF16String: (const of_char16_t*)string ++ (instancetype)stringWithUTF16String: (const of_char16_t *)string byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Creates a new OFString from a UTF-16 encoded string with the * specified length, assuming the specified byte order if no byte order @@ -228,31 +228,31 @@ * @param string The UTF-16 string * @param length The length of the UTF-16 string * @param byteOrder The byte order to assume if there is no byte order mark * @return A new autoreleased OFString */ -+ (instancetype)stringWithUTF16String: (const of_char16_t*)string ++ (instancetype)stringWithUTF16String: (const of_char16_t *)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Creates a new OFString from a UTF-32 encoded string. * * @param string The UTF-32 string * @return A new autoreleased OFString */ -+ (instancetype)stringWithUTF32String: (const of_char32_t*)string; ++ (instancetype)stringWithUTF32String: (const of_char32_t *)string; /*! * @brief Creates a new OFString from a UTF-32 encoded string with the * specified length. * * @param string The UTF-32 string * @param length The length of the UTF-32 string * @return A new autoreleased OFString */ -+ (instancetype)stringWithUTF32String: (const of_char32_t*)string ++ (instancetype)stringWithUTF32String: (const of_char32_t *)string length: (size_t)length; /*! * @brief Creates a new OFString from a UTF-32 encoded string, assuming the * specified byte order if no byte order mark is found. @@ -259,11 +259,11 @@ * * @param string The UTF-32 string * @param byteOrder The byte order to assume if there is no byte order mark * @return A new autoreleased OFString */ -+ (instancetype)stringWithUTF32String: (const of_char32_t*)string ++ (instancetype)stringWithUTF32String: (const of_char32_t *)string byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Creates a new OFString from a UTF-32 encoded string with the * specified length, assuming the specified byte order if no byte order @@ -272,44 +272,45 @@ * @param string The UTF-32 string * @param length The length of the UTF-32 string * @param byteOrder The byte order to assume if there is no byte order mark * @return A new autoreleased OFString */ -+ (instancetype)stringWithUTF32String: (const of_char32_t*)string ++ (instancetype)stringWithUTF32String: (const of_char32_t *)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Creates a new OFString from a format string. * - * See printf for the format syntax. As an addition, %@ is available as format - * specifier for objects, %C for of_unichar_t and %S for const of_unichar_t*. + * See printf for the format syntax. As an addition, `%@` is available as + * format specifier for objects, `%C` for `of_unichar_t` and `%S` for + * `const of_unichar_t *`. * * @param format A string used as format to initialize the OFString * @return A new autoreleased OFString */ -+ (instancetype)stringWithFormat: (OFConstantString*)format, ...; ++ (instancetype)stringWithFormat: (OFConstantString *)format, ...; #ifdef OF_HAVE_FILES /*! * @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 */ -+ (instancetype)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 */ -+ (instancetype)stringWithContentsOfFile: (OFString*)path ++ (instancetype)stringWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding; #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) /*! @@ -322,50 +323,50 @@ * UTF-8. * * @param URL The URL to the contents for the string * @return A new autoreleased OFString */ -+ (instancetype)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 */ -+ (instancetype)stringWithContentsOfURL: (OFURL*)URL ++ (instancetype)stringWithContentsOfURL: (OFURL *)URL encoding: (of_string_encoding_t)encoding; #endif /*! * @brief Creates a path from the specified path components. * * @param components An array of components for the path * @return A new autoreleased OFString */ -+ (OFString*)pathWithComponents: (OFArray OF_GENERIC(OFString*)*)components; ++ (OFString *)pathWithComponents: (OFArray OF_GENERIC(OFString *) *)components; /*! * @brief Initializes an already allocated OFString from a UTF-8 encoded C * string. * * @param UTF8String A UTF-8 encoded C string to initialize the OFString with * @return An initialized OFString */ -- initWithUTF8String: (const char*)UTF8String; +- initWithUTF8String: (const char *)UTF8String; /*! * @brief Initializes an already allocated 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 An initialized OFString */ -- initWithUTF8String: (const char*)UTF8String +- initWithUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength; /*! * @brief Initializes an already allocated OFString from an UTF-8 encoded C * string without copying it, if possible. @@ -375,11 +376,11 @@ * @param UTF8String A UTF-8 encoded C string to initialize the OFString with * @param freeWhenDone Whether to free the C string when it is not needed * anymore * @return An initialized OFString */ -- initWithUTF8StringNoCopy: (char*)UTF8String +- initWithUTF8StringNoCopy: (char *)UTF8String freeWhenDone: (bool)freeWhenDone; /*! * @brief Initializes an already allocated OFString from a C string with the * specified encoding. @@ -386,11 +387,11 @@ * * @param cString A C string to initialize the OFString with * @param encoding The encoding of the C string * @return An initialized OFString */ -- initWithCString: (const char*)cString +- initWithCString: (const char *)cString encoding: (of_string_encoding_t)encoding; /*! * @brief Initializes an already allocated OFString from a C string with the * specified encoding and length. @@ -398,50 +399,50 @@ * @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 An initialized OFString */ -- initWithCString: (const char*)cString +- initWithCString: (const char *)cString encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength; /*! * @brief Initializes an already allocated OFString with another string. * * @param string A string to initialize the OFString with * @return An initialized OFString */ -- initWithString: (OFString*)string; +- initWithString: (OFString *)string; /*! * @brief Initializes an already allocated OFString with a Unicode string with * the specified length. * * @param characters An array of Unicode characters * @param length The length of the Unicode character array * @return An initialized OFString */ -- initWithCharacters: (const of_unichar_t*)characters +- initWithCharacters: (const of_unichar_t *)characters length: (size_t)length; /*! * @brief Initializes an already allocated OFString with a UTF-16 string. * * @param string The UTF-16 string * @return An initialized OFString */ -- initWithUTF16String: (const of_char16_t*)string; +- initWithUTF16String: (const of_char16_t *)string; /*! * @brief Initializes an already allocated OFString with a UTF-16 string with * the specified length. * * @param string The UTF-16 string * @param length The length of the UTF-16 string * @return An initialized OFString */ -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string length: (size_t)length; /*! * @brief Initializes an already allocated OFString with a UTF-16 string, * assuming the specified byte order if no byte order mark is found. @@ -448,11 +449,11 @@ * * @param string The UTF-16 string * @param byteOrder The byte order to assume if there is no byte order mark * @return An initialized OFString */ -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Initializes an already allocated OFString with a UTF-16 string with * the specified length, assuming the specified byte order if no byte @@ -461,31 +462,31 @@ * @param string The UTF-16 string * @param length The length of the UTF-16 string * @param byteOrder The byte order to assume if there is no byte order mark * @return An initialized OFString */ -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Initializes an already allocated OFString with a UTF-32 string. * * @param string The UTF-32 string * @return An initialized OFString */ -- initWithUTF32String: (const of_char32_t*)string; +- initWithUTF32String: (const of_char32_t *)string; /*! * @brief Initializes an already allocated OFString with a UTF-32 string with * the specified length * * @param string The UTF-32 string * @param length The length of the UTF-32 string * @return An initialized OFString */ -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string length: (size_t)length; /*! * @brief Initializes an already allocated OFString with a UTF-32 string, * assuming the specified byte order if no byte order mark is found. @@ -492,11 +493,11 @@ * * @param string The UTF-32 string * @param byteOrder The byte order to assume if there is no byte order mark * @return An initialized OFString */ -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Initializes an already allocated OFString with a UTF-32 string with * the specified length, assuming the specified byte order if no byte @@ -505,36 +506,38 @@ * @param string The UTF-32 string * @param length The length of the UTF-32 string * @param byteOrder The byte order to assume if there is no byte order mark * @return An initialized OFString */ -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Initializes an already allocated OFString with a format string. * - * See printf for the format syntax. As an addition, %@ is available as format - * specifier for objects, %C for of_unichar_t and %S for const of_unichar_t*. + * See printf for the format syntax. As an addition, `%@` is available as + * format specifier for objects, `%C` for `of_unichar_t` and `%S` for + * `const of_unichar_t *`. * * @param format A string used as format to initialize the OFString * @return An initialized OFString */ -- initWithFormat: (OFConstantString*)format, ...; +- initWithFormat: (OFConstantString *)format, ...; /*! * @brief Initializes an already allocated OFString with a format string. * - * See printf for the format syntax. As an addition, %@ is available as format - * specifier for objects, %C for of_unichar_t and %S for const of_unichar_t*. + * See printf for the format syntax. As an addition, `%@` is available as + * format specifier for objects, `%C` for `of_unichar_t` and `%S` for + * `const of_unichar_t *`. * * @param format A string used as format to initialize the OFString * @param arguments The arguments used in the format string * @return An initialized OFString */ -- initWithFormat: (OFConstantString*)format +- initWithFormat: (OFConstantString *)format arguments: (va_list)arguments; #ifdef OF_HAVE_FILES /*! * @brief Initializes an already allocated OFString with the contents of the @@ -541,21 +544,21 @@ * specified file in the specified encoding. * * @param path The path to the file * @return An initialized OFString */ -- initWithContentsOfFile: (OFString*)path; +- initWithContentsOfFile: (OFString *)path; /*! * @brief Initializes an already allocated 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 An initialized OFString */ -- initWithContentsOfFile: (OFString*)path +- initWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding; #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) /*! @@ -569,21 +572,21 @@ * UTF-8. * * @param URL The URL to the contents for the string * @return An initialized OFString */ -- initWithContentsOfURL: (OFURL*)URL; +- initWithContentsOfURL: (OFURL *)URL; /*! * @brief Initializes an already allocated 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 An initialized OFString */ -- initWithContentsOfURL: (OFURL*)URL +- initWithContentsOfURL: (OFURL *)URL encoding: (of_string_encoding_t)encoding; #endif /*! * @brief Writes the OFString into the specified C string with the specified @@ -594,11 +597,11 @@ * including the terminating zero * @param encoding The encoding to use for writing into the C string * @return The number of bytes written into the C string, without the * terminating zero */ -- (size_t)getCString: (char*)cString +- (size_t)getCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding; /*! * @brief Writes the OFString into the specified C string with the specified @@ -610,11 +613,11 @@ * including the terminating zero * @param encoding The encoding to use for writing into the C string * @return The number of bytes written into the C string, without the * terminating zero */ -- (size_t)getLossyCString: (char*)cString +- (size_t)getLossyCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding; /*! * @brief Returns the OFString as a C string in the specified encoding. @@ -624,11 +627,11 @@ * copy it. * * @param encoding The encoding for the C string * @return The OFString as a C string in the specified encoding */ -- (const char*)cStringWithEncoding: (of_string_encoding_t)encoding +- (const char *)cStringWithEncoding: (of_string_encoding_t)encoding OF_RETURNS_INNER_POINTER; /*! * @brief Returns the OFString as a C string in the specified encoding, * replacing characters that cannot be represented in the specified @@ -639,11 +642,11 @@ * copy it. * * @param encoding The encoding for the C string * @return The OFString as a C string in the specified encoding */ -- (const char*)lossyCStringWithEncoding: (of_string_encoding_t)encoding +- (const char *)lossyCStringWithEncoding: (of_string_encoding_t)encoding OF_RETURNS_INNER_POINTER; /*! * @brief Returns the OFString as a UTF-8 encoded C string. * @@ -651,11 +654,11 @@ * use the result outside the scope of the current autorelease pool, you have to * copy it. * * @return The OFString as a UTF-8 encoded C string */ -- (const char*)UTF8String OF_RETURNS_INNER_POINTER; +- (const char *)UTF8String OF_RETURNS_INNER_POINTER; /*! * @brief Returns the length of the string in Unicode characters. * * @return The length of the string in Unicode characters @@ -683,11 +686,11 @@ * case. * * @param otherString A string to compare with * @return An of_comparison_result_t */ -- (of_comparison_result_t)caseInsensitiveCompare: (OFString*)otherString; +- (of_comparison_result_t)caseInsensitiveCompare: (OFString *)otherString; /*! * @brief Returns the Unicode character at the specified index. * * @param index The index of the Unicode character to return @@ -700,21 +703,21 @@ * buffer. * * @param buffer The buffer to store the Unicode characters * @param range The range of the Unicode characters to copy */ -- (void)getCharacters: (of_unichar_t*)buffer +- (void)getCharacters: (of_unichar_t *)buffer inRange: (of_range_t)range; /*! * @brief Returns the range of the first occurrence of the string. * * @param string The string to search * @return The range of the first occurrence of the string or a range with * `OF_NOT_FOUND` as start position if it was not found */ -- (of_range_t)rangeOfString: (OFString*)string; +- (of_range_t)rangeOfString: (OFString *)string; /*! * @brief Returns the range of the string. * * @param string The string to search @@ -724,11 +727,11 @@ * -----------------------------|------------------------------- * `OF_STRING_SEARCH_BACKWARDS` | Search backwards in the string * @return The range of the first occurrence of the string or a range with * `OF_NOT_FOUND` as start position if it was not found */ -- (of_range_t)rangeOfString: (OFString*)string +- (of_range_t)rangeOfString: (OFString *)string options: (int)options; /*! * @brief Returns the range of the string in the specified range. * @@ -740,82 +743,82 @@ * `OF_STRING_SEARCH_BACKWARDS` | Search backwards in the string * @param range The range in which to search * @return The range of the first occurrence of the string or a range with * `OF_NOT_FOUND` as start position if it was not found */ -- (of_range_t)rangeOfString: (OFString*)string +- (of_range_t)rangeOfString: (OFString *)string options: (int)options range: (of_range_t)range; /*! * @brief Returns whether the string contains the specified string. * * @param string The string to search * @return Whether the string contains the specified string */ -- (bool)containsString: (OFString*)string; +- (bool)containsString: (OFString *)string; /*! * @brief Creates a substring with the specified range. * * @param range The range of the substring * @return The substring as a new autoreleased OFString */ -- (OFString*)substringWithRange: (of_range_t)range; +- (OFString *)substringWithRange: (of_range_t)range; /*! * @brief Creates a new string by appending another string. * * @param string The string to append * @return A new, autoreleased OFString with the specified string appended */ -- (OFString*)stringByAppendingString: (OFString*)string; +- (OFString *)stringByAppendingString: (OFString *)string; /*! * @brief Creates a new string by appending the specified format. * * @param format A format string which generates the string to append * @return A new, autoreleased OFString with the specified format appended */ -- (OFString*)stringByAppendingFormat: (OFConstantString*)format, ...; +- (OFString *)stringByAppendingFormat: (OFConstantString *)format, ...; /*! * @brief Creates a new string by appending the specified format. * * @param format A format string which generates the string to append * @param arguments The arguments used in the format string * @return A new, autoreleased OFString with the specified format appended */ -- (OFString*)stringByAppendingFormat: (OFConstantString*)format - arguments: (va_list)arguments; +- (OFString *)stringByAppendingFormat: (OFConstantString *)format + arguments: (va_list)arguments; /*! * @brief Creates a new string by appending a path component. * * @param component The path component to append * @return A new, autoreleased OFString with the path component appended */ -- (OFString*)stringByAppendingPathComponent: (OFString*)component; +- (OFString *)stringByAppendingPathComponent: (OFString *)component; /*! * @brief Creates a new string by prepending another string. * * @param string The string to prepend * @return A new autoreleased OFString with the specified string prepended */ -- (OFString*)stringByPrependingString: (OFString*)string; +- (OFString *)stringByPrependingString: (OFString *)string; /*! * @brief Creates a new string by replacing the occurrences of the specified * string with the specified replacement. * * @param string The string to replace * @param replacement The string with which it should be replaced * @return A new string with the occurrences of the specified string replaced */ -- (OFString*)stringByReplacingOccurrencesOfString: (OFString*)string - withString: (OFString*)replacement; +- (OFString *)stringByReplacingOccurrencesOfString: (OFString *)string + withString: (OFString *)replacement; /*! * @brief Creates a new string by replacing the occurrences of the specified * string in the specified range with the specified replacement. * @@ -825,28 +828,28 @@ * Possible values are: * * None yet * @param range The range in which to replace the string * @return A new string with the occurrences of the specified string replaced */ -- (OFString*)stringByReplacingOccurrencesOfString: (OFString*)string - withString: (OFString*)replacement - options: (int)options - range: (of_range_t)range; +- (OFString *)stringByReplacingOccurrencesOfString: (OFString *)string + withString: (OFString *)replacement + options: (int)options + range: (of_range_t)range; /*! * @brief Returns the string in uppercase. * * @return The string in uppercase */ -- (OFString*)uppercaseString; +- (OFString *)uppercaseString; /*! * @brief Returns the string in lowercase. * * @return The string in lowercase */ -- (OFString*)lowercaseString; +- (OFString *)lowercaseString; /*! * @brief Returns the string capitalized. * * @note This only considers spaces, tabs and newlines to be word delimiters! @@ -853,58 +856,58 @@ * Also note that this might change in the future to all word delimiters * specified by Unicode! * * @return The capitalized string */ -- (OFString*)capitalizedString; +- (OFString *)capitalizedString; /*! * @brief Creates a new string by deleting leading whitespaces. * * @return A new autoreleased OFString with leading whitespaces deleted */ -- (OFString*)stringByDeletingLeadingWhitespaces; +- (OFString *)stringByDeletingLeadingWhitespaces; /*! * @brief Creates a new string by deleting trailing whitespaces. * * @return A new autoreleased OFString with trailing whitespaces deleted */ -- (OFString*)stringByDeletingTrailingWhitespaces; +- (OFString *)stringByDeletingTrailingWhitespaces; /*! * @brief Creates a new string by deleting leading and trailing whitespaces. * * @return A new autoreleased OFString with leading and trailing whitespaces * deleted */ -- (OFString*)stringByDeletingEnclosingWhitespaces; +- (OFString *)stringByDeletingEnclosingWhitespaces; /*! * @brief Checks whether the string has the specified prefix. * * @param prefix The prefix to check for * @return A boolean whether the string has the specified prefix */ -- (bool)hasPrefix: (OFString*)prefix; +- (bool)hasPrefix: (OFString *)prefix; /*! * @brief Checks whether the string has the specified suffix. * * @param suffix The suffix to check for * @return A boolean whether the string has the specified suffix */ -- (bool)hasSuffix: (OFString*)suffix; +- (bool)hasSuffix: (OFString *)suffix; /*! * @brief Separates an OFString into an OFArray of OFStrings. * * @param delimiter The delimiter for separating * @return An autoreleased OFArray with the separated string */ -- (OFArray OF_GENERIC(OFString*)*)componentsSeparatedByString: - (OFString*)delimiter; +- (OFArray OF_GENERIC(OFString *) *)componentsSeparatedByString: + (OFString *)delimiter; /*! * @brief Separates an OFString into an OFArray of OFStrings. * * @param delimiter The delimiter for separating @@ -913,65 +916,65 @@ * Value | Description * -----------------------|---------------------- * `OF_STRING_SKIP_EMPTY` | Skip empty components * @return An autoreleased OFArray with the separated string */ -- (OFArray OF_GENERIC(OFString*)*) - componentsSeparatedByString: (OFString*)delimiter +- (OFArray OF_GENERIC(OFString *) *) + componentsSeparatedByString: (OFString *)delimiter options: (int)options; /*! * @brief Returns the components of the path. * * @return The components of the path */ -- (OFArray OF_GENERIC(OFString*)*)pathComponents; +- (OFArray OF_GENERIC(OFString *) *)pathComponents; /*! * @brief Returns the last component of the path. * * @return The last component of the path */ -- (OFString*)lastPathComponent; +- (OFString *)lastPathComponent; /*! * @brief Returns the file extension of the path. * * @return The file extension of the path */ -- (OFString*)pathExtension; +- (OFString *)pathExtension; /*! * @brief Returns the directory name of the path. * * @return The directory name of the path */ -- (OFString*)stringByDeletingLastPathComponent; +- (OFString *)stringByDeletingLastPathComponent; /*! * @brief Returns a new string with the file extension of the path removed. * * @return A new string with the file extension of the path removed */ -- (OFString*)stringByDeletingPathExtension; +- (OFString *)stringByDeletingPathExtension; /*! * @brief Returns the path with relative sub paths resolved. * * @return The path with relative sub paths resolved */ -- (OFString*)stringByStandardizingPath; +- (OFString *)stringByStandardizingPath; /*! * @brief Returns the URL path with relative sub paths resolved. * * This works similar to @ref stringByStandardizingPath, but is intended for * standardization of paths that are part of a URL. * * @return The URL path with relative sub paths resolved */ -- (OFString*)stringByStandardizingURLPath; +- (OFString *)stringByStandardizingURLPath; /*! * @brief Returns the decimal value of the string as an `intmax_t`. * * Leading and trailing whitespaces are ignored. @@ -1043,11 +1046,11 @@ * use the result outside the scope of the current autorelease pool, you have to * copy it. * * @return The string as an array of Unicode characters */ -- (const of_unichar_t*)characters OF_RETURNS_INNER_POINTER; +- (const of_unichar_t *)characters OF_RETURNS_INNER_POINTER; /*! * @brief Returns the string in UTF-16 encoding with native byte order. * * The result is valid until the autorelease pool is released. If you want to @@ -1054,11 +1057,11 @@ * use the result outside the scope of the current autorelease pool, you have to * copy it. * * @return The string in UTF-16 encoding with native byte order */ -- (const of_char16_t*)UTF16String OF_RETURNS_INNER_POINTER; +- (const of_char16_t *)UTF16String OF_RETURNS_INNER_POINTER; /*! * @brief Returns the string in UTF-16 encoding with the specified byte order. * * The result is valid until the autorelease pool is released. If you want to @@ -1066,11 +1069,11 @@ * copy it. * * @param byteOrder The byte order for the UTF-16 encoding * @return The string in UTF-16 encoding with the specified byte order */ -- (const of_char16_t*)UTF16StringWithByteOrder: (of_byte_order_t)byteOrder +- (const of_char16_t *)UTF16StringWithByteOrder: (of_byte_order_t)byteOrder OF_RETURNS_INNER_POINTER; /*! * @brief Returns the length of the string in UTF-16 characters. * @@ -1085,11 +1088,11 @@ * use the result outside the scope of the current autorelease pool, you have to * copy it. * * @return The string in UTF-32 encoding with native byte order */ -- (const of_char32_t*)UTF32String OF_RETURNS_INNER_POINTER; +- (const of_char32_t *)UTF32String OF_RETURNS_INNER_POINTER; /*! * @brief Returns the string in UTF-32 encoding with the specified byte order. * * The result is valid until the autorelease pool is released. If you want to @@ -1097,29 +1100,29 @@ * copy it. * * @param byteOrder The byte order for the UTF-32 encoding * @return The string in UTF-32 encoding with the specified byte order */ -- (const of_char32_t*)UTF32StringWithByteOrder: (of_byte_order_t)byteOrder +- (const of_char32_t *)UTF32StringWithByteOrder: (of_byte_order_t)byteOrder OF_RETURNS_INNER_POINTER; #ifdef OF_HAVE_FILES /*! * @brief Writes the string into the specified file using UTF-8 encoding. * * @param path The path of the file to write to */ -- (void)writeToFile: (OFString*)path; +- (void)writeToFile: (OFString *)path; /*! * @brief Writes the string into the specified file using the specified * encoding. * * @param path The path of the file to write to * @param encoding The encoding to use to write the string into the file */ -- (void)writeToFile: (OFString*)path +- (void)writeToFile: (OFString *)path encoding: (of_string_encoding_t)encoding; #endif #ifdef OF_HAVE_BLOCKS /*! @@ -1132,15 +1135,15 @@ @end #ifdef __cplusplus extern "C" { #endif -extern of_string_encoding_t of_string_parse_encoding(OFString*); -extern size_t of_string_utf8_encode(of_unichar_t, char*); -extern ssize_t of_string_utf8_decode(const char*, size_t, of_unichar_t*); -extern size_t of_string_utf16_length(const of_char16_t*); -extern size_t of_string_utf32_length(const of_char32_t*); +extern of_string_encoding_t of_string_parse_encoding(OFString *); +extern size_t of_string_utf8_encode(of_unichar_t, char *); +extern ssize_t of_string_utf8_decode(const char *, size_t, of_unichar_t *); +extern size_t of_string_utf16_length(const of_char16_t *); +extern size_t of_string_utf32_length(const of_char32_t *); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -78,41 +78,41 @@ #if defined(HAVE_STRTOF_L) || defined(HAVE_STRTOD_L) static locale_t cLocale; #endif @interface OFString () -- (size_t)OF_getCString: (char*)cString +- (size_t)OF_getCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding lossy: (bool)lossy; -- (const char*)OF_cStringWithEncoding: (of_string_encoding_t)encoding - lossy: (bool)lossy; -- (OFString*)OF_JSONRepresentationWithOptions: (int)options - depth: (size_t)depth; +- (const char *)OF_cStringWithEncoding: (of_string_encoding_t)encoding + lossy: (bool)lossy; +- (OFString *)OF_JSONRepresentationWithOptions: (int)options + depth: (size_t)depth; @end -extern bool of_unicode_to_iso_8859_2(const of_unichar_t*, unsigned char*, - size_t, bool); -extern bool of_unicode_to_iso_8859_3(const of_unichar_t*, unsigned char*, - size_t, bool); -extern bool of_unicode_to_iso_8859_15(const of_unichar_t*, unsigned char*, - size_t, bool); -extern bool of_unicode_to_windows_1251(const of_unichar_t*, unsigned char*, - size_t, bool); -extern bool of_unicode_to_windows_1252(const of_unichar_t*, unsigned char*, - size_t, bool); -extern bool of_unicode_to_codepage_437(const of_unichar_t*, unsigned char*, - size_t, bool); -extern bool of_unicode_to_codepage_850(const of_unichar_t*, unsigned char*, - size_t, bool); -extern bool of_unicode_to_codepage_858(const of_unichar_t*, unsigned char*, - size_t, bool); -extern bool of_unicode_to_mac_roman(const of_unichar_t*, unsigned char*, - size_t, bool); -extern bool of_unicode_to_koi8_r(const of_unichar_t*, unsigned char*, - size_t, bool); -extern bool of_unicode_to_koi8_u(const of_unichar_t*, unsigned char*, +extern bool of_unicode_to_iso_8859_2(const of_unichar_t *, unsigned char *, + size_t, bool); +extern bool of_unicode_to_iso_8859_3(const of_unichar_t *, unsigned char *, + size_t, bool); +extern bool of_unicode_to_iso_8859_15(const of_unichar_t *, unsigned char *, + size_t, bool); +extern bool of_unicode_to_windows_1251(const of_unichar_t *, unsigned char *, + size_t, bool); +extern bool of_unicode_to_windows_1252(const of_unichar_t *, unsigned char *, + size_t, bool); +extern bool of_unicode_to_codepage_437(const of_unichar_t *, unsigned char *, + size_t, bool); +extern bool of_unicode_to_codepage_850(const of_unichar_t *, unsigned char *, + size_t, bool); +extern bool of_unicode_to_codepage_858(const of_unichar_t *, unsigned char *, + size_t, bool); +extern bool of_unicode_to_mac_roman(const of_unichar_t *, unsigned char *, + size_t, bool); +extern bool of_unicode_to_koi8_r(const of_unichar_t *, unsigned char *, + size_t, bool); +extern bool of_unicode_to_koi8_u(const of_unichar_t *, unsigned char *, size_t, bool); /* References for static linking */ void _references_to_categories_of_OFString(void) @@ -215,11 +215,11 @@ } ssize_t of_string_utf8_decode(const char *buffer_, size_t length, of_unichar_t *ret) { - const uint8_t *buffer = (const uint8_t*)buffer_; + const uint8_t *buffer = (const uint8_t *)buffer_; if (!(*buffer & 0x80)) { *ret = buffer[0]; return 1; } @@ -284,11 +284,11 @@ length++; return length; } -static OFString* +static OFString * standardizePath(OFArray *components, OFString *currentDirectory, OFString *parentDirectory, OFString *joinString) { void *pool = objc_autoreleasePoolPush(); OFMutableArray *array; @@ -359,11 +359,11 @@ - init { return (id)[[OFString_UTF8 alloc] init]; } -- initWithUTF8String: (const char*)UTF8String +- initWithUTF8String: (const char *)UTF8String { id string; size_t length; void *storage; @@ -374,11 +374,11 @@ return (id)[string OF_initWithUTF8String: UTF8String length: length storage: storage]; } -- initWithUTF8String: (const char*)UTF8String +- initWithUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength { id string; void *storage; @@ -388,19 +388,19 @@ return (id)[string OF_initWithUTF8String: UTF8String length: UTF8StringLength storage: storage]; } -- initWithUTF8StringNoCopy: (char*)UTF8String +- initWithUTF8StringNoCopy: (char *)UTF8String freeWhenDone: (bool)freeWhenDone { return (id)[[OFString_UTF8 alloc] initWithUTF8StringNoCopy: UTF8String freeWhenDone: freeWhenDone]; } -- initWithCString: (const char*)cString +- initWithCString: (const char *)cString encoding: (of_string_encoding_t)encoding { if (encoding == OF_STRING_ENCODING_UTF_8) { id string; size_t length; @@ -417,11 +417,11 @@ return (id)[[OFString_UTF8 alloc] initWithCString: cString encoding: encoding]; } -- initWithCString: (const char*)cString +- initWithCString: (const char *)cString encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength { if (encoding == OF_STRING_ENCODING_UTF_8) { id string; @@ -438,79 +438,79 @@ return (id)[[OFString_UTF8 alloc] initWithCString: cString encoding: encoding length: cStringLength]; } -- initWithString: (OFString*)string +- initWithString: (OFString *)string { return (id)[[OFString_UTF8 alloc] initWithString: string]; } -- initWithCharacters: (const of_unichar_t*)string +- initWithCharacters: (const of_unichar_t *)string length: (size_t)length { return (id)[[OFString_UTF8 alloc] initWithCharacters: string length: length]; } -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string { return (id)[[OFString_UTF8 alloc] initWithUTF16String: string]; } -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string length: (size_t)length { return (id)[[OFString_UTF8 alloc] initWithUTF16String: string length: length]; } -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string byteOrder: (of_byte_order_t)byteOrder { return (id)[[OFString_UTF8 alloc] initWithUTF16String: string byteOrder: byteOrder]; } -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder { return (id)[[OFString_UTF8 alloc] initWithUTF16String: string length: length byteOrder: byteOrder]; } -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string { return (id)[[OFString_UTF8 alloc] initWithUTF32String: string]; } -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string length: (size_t)length { return (id)[[OFString_UTF8 alloc] initWithUTF32String: string length: length]; } -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string byteOrder: (of_byte_order_t)byteOrder { return (id)[[OFString_UTF8 alloc] initWithUTF32String: string byteOrder: byteOrder]; } -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder { return (id)[[OFString_UTF8 alloc] initWithUTF32String: string length: length byteOrder: byteOrder]; } -- initWithFormat: (OFConstantString*)format, ... +- initWithFormat: (OFConstantString *)format, ... { id ret; va_list arguments; va_start(arguments, format); @@ -519,46 +519,46 @@ va_end(arguments); return ret; } -- initWithFormat: (OFConstantString*)format +- initWithFormat: (OFConstantString *)format arguments: (va_list)arguments { return (id)[[OFString_UTF8 alloc] initWithFormat: format arguments: arguments]; } #ifdef OF_HAVE_FILES -- initWithContentsOfFile: (OFString*)path +- initWithContentsOfFile: (OFString *)path { return (id)[[OFString_UTF8 alloc] initWithContentsOfFile: path]; } -- initWithContentsOfFile: (OFString*)path +- initWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding { return (id)[[OFString_UTF8 alloc] initWithContentsOfFile: path encoding: encoding]; } #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) -- initWithContentsOfURL: (OFURL*)URL +- initWithContentsOfURL: (OFURL *)URL { return (id)[[OFString_UTF8 alloc] initWithContentsOfURL: URL]; } -- initWithContentsOfURL: (OFURL*)URL +- initWithContentsOfURL: (OFURL *)URL encoding: (of_string_encoding_t)encoding { return (id)[[OFString_UTF8 alloc] initWithContentsOfURL: URL encoding: encoding]; } #endif -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { return (id)[[OFString_UTF8 alloc] initWithSerialization: element]; } - retain @@ -607,116 +607,116 @@ + (instancetype)string { return [[[self alloc] init] autorelease]; } -+ (instancetype)stringWithUTF8String: (const char*)UTF8String ++ (instancetype)stringWithUTF8String: (const char *)UTF8String { return [[[self alloc] initWithUTF8String: UTF8String] autorelease]; } -+ (instancetype)stringWithUTF8String: (const char*)UTF8String ++ (instancetype)stringWithUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength { return [[[self alloc] initWithUTF8String: UTF8String length: UTF8StringLength] autorelease]; } -+ (instancetype)stringWithUTF8StringNoCopy: (char*)UTF8String ++ (instancetype)stringWithUTF8StringNoCopy: (char *)UTF8String freeWhenDone: (bool)freeWhenDone { return [[[self alloc] initWithUTF8StringNoCopy: UTF8String freeWhenDone: freeWhenDone] autorelease]; } -+ (instancetype)stringWithCString: (const char*)cString ++ (instancetype)stringWithCString: (const char *)cString encoding: (of_string_encoding_t)encoding { return [[[self alloc] initWithCString: cString encoding: encoding] autorelease]; } -+ (instancetype)stringWithCString: (const char*)cString ++ (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]; } -+ (instancetype)stringWithString: (OFString*)string ++ (instancetype)stringWithString: (OFString *)string { return [[[self alloc] initWithString: string] autorelease]; } -+ (instancetype)stringWithCharacters: (const of_unichar_t*)string ++ (instancetype)stringWithCharacters: (const of_unichar_t *)string length: (size_t)length { return [[[self alloc] initWithCharacters: string length: length] autorelease]; } -+ (instancetype)stringWithUTF16String: (const of_char16_t*)string ++ (instancetype)stringWithUTF16String: (const of_char16_t *)string { return [[[self alloc] initWithUTF16String: string] autorelease]; } -+ (instancetype)stringWithUTF16String: (const of_char16_t*)string ++ (instancetype)stringWithUTF16String: (const of_char16_t *)string length: (size_t)length { return [[[self alloc] initWithUTF16String: string length: length] autorelease]; } -+ (instancetype)stringWithUTF16String: (const of_char16_t*)string ++ (instancetype)stringWithUTF16String: (const of_char16_t *)string byteOrder: (of_byte_order_t)byteOrder { return [[[self alloc] initWithUTF16String: string byteOrder: byteOrder] autorelease]; } -+ (instancetype)stringWithUTF16String: (const of_char16_t*)string ++ (instancetype)stringWithUTF16String: (const of_char16_t *)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder { return [[[self alloc] initWithUTF16String: string length: length byteOrder: byteOrder] autorelease]; } -+ (instancetype)stringWithUTF32String: (const of_char32_t*)string ++ (instancetype)stringWithUTF32String: (const of_char32_t *)string { return [[[self alloc] initWithUTF32String: string] autorelease]; } -+ (instancetype)stringWithUTF32String: (const of_char32_t*)string ++ (instancetype)stringWithUTF32String: (const of_char32_t *)string length: (size_t)length { return [[[self alloc] initWithUTF32String: string length: length] autorelease]; } -+ (instancetype)stringWithUTF32String: (const of_char32_t*)string ++ (instancetype)stringWithUTF32String: (const of_char32_t *)string byteOrder: (of_byte_order_t)byteOrder { return [[[self alloc] initWithUTF32String: string byteOrder: byteOrder] autorelease]; } -+ (instancetype)stringWithUTF32String: (const of_char32_t*)string ++ (instancetype)stringWithUTF32String: (const of_char32_t *)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder { return [[[self alloc] initWithUTF32String: string length: length byteOrder: byteOrder] autorelease]; } -+ (instancetype)stringWithFormat: (OFConstantString*)format, ... ++ (instancetype)stringWithFormat: (OFConstantString *)format, ... { id ret; va_list arguments; va_start(arguments, format); @@ -726,38 +726,38 @@ return ret; } #ifdef OF_HAVE_FILES -+ (instancetype)stringWithContentsOfFile: (OFString*)path ++ (instancetype)stringWithContentsOfFile: (OFString *)path { return [[[self alloc] initWithContentsOfFile: path] autorelease]; } -+ (instancetype)stringWithContentsOfFile: (OFString*)path ++ (instancetype)stringWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding { return [[[self alloc] initWithContentsOfFile: path encoding: encoding] autorelease]; } #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) -+ (instancetype)stringWithContentsOfURL: (OFURL*)URL ++ (instancetype)stringWithContentsOfURL: (OFURL *)URL { return [[[self alloc] initWithContentsOfURL: URL] autorelease]; } -+ (instancetype)stringWithContentsOfURL: (OFURL*)URL ++ (instancetype)stringWithContentsOfURL: (OFURL *)URL encoding: (of_string_encoding_t)encoding { return [[[self alloc] initWithContentsOfURL: URL encoding: encoding] autorelease]; } #endif -+ (OFString*)pathWithComponents: (OFArray*)components ++ (OFString *)pathWithComponents: (OFArray *)components { OFMutableString *ret = [OFMutableString string]; bool first = true; for (OFString *component in components) { @@ -786,118 +786,118 @@ } return [super init]; } -- initWithUTF8String: (const char*)UTF8String +- initWithUTF8String: (const char *)UTF8String { return [self initWithCString: UTF8String encoding: OF_STRING_ENCODING_UTF_8 length: strlen(UTF8String)]; } -- initWithUTF8String: (const char*)UTF8String +- initWithUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength { return [self initWithCString: UTF8String encoding: OF_STRING_ENCODING_UTF_8 length: UTF8StringLength]; } -- initWithUTF8StringNoCopy: (char*)UTF8String +- initWithUTF8StringNoCopy: (char *)UTF8String freeWhenDone: (bool)freeWhenDone { return [self initWithUTF8String: UTF8String]; } -- initWithCString: (const char*)cString +- initWithCString: (const char *)cString encoding: (of_string_encoding_t)encoding { return [self initWithCString: cString encoding: encoding length: strlen(cString)]; } -- initWithCString: (const char*)cString +- initWithCString: (const char *)cString encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength { OF_INVALID_INIT_METHOD } -- initWithString: (OFString*)string +- initWithString: (OFString *)string { OF_INVALID_INIT_METHOD } -- initWithCharacters: (const of_unichar_t*)string +- initWithCharacters: (const of_unichar_t *)string length: (size_t)length { OF_INVALID_INIT_METHOD } -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string { return [self initWithUTF16String: string length: of_string_utf16_length(string) byteOrder: OF_BYTE_ORDER_NATIVE]; } -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string length: (size_t)length { return [self initWithUTF16String: string length: length byteOrder: OF_BYTE_ORDER_NATIVE]; } -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string byteOrder: (of_byte_order_t)byteOrder { return [self initWithUTF16String: string length: of_string_utf16_length(string) byteOrder: byteOrder]; } -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder { OF_INVALID_INIT_METHOD } -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string { return [self initWithUTF32String: string length: of_string_utf32_length(string) byteOrder: OF_BYTE_ORDER_NATIVE]; } -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string length: (size_t)length { return [self initWithUTF32String: string length: length byteOrder: OF_BYTE_ORDER_NATIVE]; } -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string byteOrder: (of_byte_order_t)byteOrder { return [self initWithUTF32String: string length: of_string_utf32_length(string) byteOrder: byteOrder]; } -- initWithUTF32String: (const of_char32_t*)string +- initWithUTF32String: (const of_char32_t *)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder { OF_INVALID_INIT_METHOD } -- initWithFormat: (OFConstantString*)format, ... +- initWithFormat: (OFConstantString *)format, ... { id ret; va_list arguments; va_start(arguments, format); @@ -906,24 +906,24 @@ va_end(arguments); return ret; } -- initWithFormat: (OFConstantString*)format +- initWithFormat: (OFConstantString *)format arguments: (va_list)arguments { OF_INVALID_INIT_METHOD } #ifdef OF_HAVE_FILES -- initWithContentsOfFile: (OFString*)path +- initWithContentsOfFile: (OFString *)path { return [self initWithContentsOfFile: path encoding: OF_STRING_ENCODING_UTF_8]; } -- initWithContentsOfFile: (OFString*)path +- initWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding { char *tmp; of_stat_t st; @@ -967,17 +967,17 @@ return self; } #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) -- initWithContentsOfURL: (OFURL*)URL +- initWithContentsOfURL: (OFURL *)URL { return [self initWithContentsOfURL: URL encoding: OF_STRING_ENCODING_AUTODETECT]; } -- initWithContentsOfURL: (OFURL*)URL +- initWithContentsOfURL: (OFURL *)URL encoding: (of_string_encoding_t)encoding { void *pool; OFString *scheme; # ifdef OF_HAVE_FILES @@ -1019,11 +1019,11 @@ return self; } #endif -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { @try { void *pool = objc_autoreleasePoolPush(); if (![[element namespace] isEqual: OF_SERIALIZATION_NS]) @@ -1046,11 +1046,11 @@ } return self; } -- (size_t)OF_getCString: (char*)cString +- (size_t)OF_getCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding lossy: (bool)lossy { const of_unichar_t *characters = [self characters]; @@ -1134,11 +1134,11 @@ case OF_STRING_ENCODING_ISO_8859_2: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_iso_8859_2(characters, - (unsigned char*)cString, length, lossy)) + (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; @@ -1147,11 +1147,11 @@ case OF_STRING_ENCODING_ISO_8859_3: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_iso_8859_3(characters, - (unsigned char*)cString, length, lossy)) + (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; @@ -1160,11 +1160,11 @@ case OF_STRING_ENCODING_ISO_8859_15: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_iso_8859_15(characters, - (unsigned char*)cString, length, lossy)) + (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; @@ -1173,11 +1173,11 @@ case OF_STRING_ENCODING_WINDOWS_1251: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_windows_1251(characters, - (unsigned char*)cString, length, lossy)) + (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; @@ -1186,11 +1186,11 @@ case OF_STRING_ENCODING_WINDOWS_1252: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_windows_1252(characters, - (unsigned char*)cString, length, lossy)) + (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; @@ -1199,11 +1199,11 @@ case OF_STRING_ENCODING_CODEPAGE_437: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_codepage_437(characters, - (unsigned char*)cString, length, lossy)) + (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; @@ -1212,11 +1212,11 @@ case OF_STRING_ENCODING_CODEPAGE_850: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_codepage_850(characters, - (unsigned char*)cString, length, lossy)) + (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; @@ -1225,11 +1225,11 @@ case OF_STRING_ENCODING_CODEPAGE_858: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_codepage_858(characters, - (unsigned char*)cString, length, lossy)) + (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; @@ -1238,11 +1238,11 @@ case OF_STRING_ENCODING_MAC_ROMAN: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_mac_roman(characters, - (unsigned char*)cString, length, lossy)) + (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; @@ -1251,11 +1251,11 @@ case OF_STRING_ENCODING_KOI8_R: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_koi8_r(characters, - (unsigned char*)cString, length, lossy)) + (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; @@ -1264,11 +1264,11 @@ case OF_STRING_ENCODING_KOI8_U: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_koi8_u(characters, - (unsigned char*)cString, length, lossy)) + (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; @@ -1277,32 +1277,32 @@ @throw [OFNotImplementedException exceptionWithSelector: _cmd object: self]; } } -- (size_t)getCString: (char*)cString +- (size_t)getCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding { return [self OF_getCString: cString maxLength: maxLength encoding: encoding lossy: false]; } -- (size_t)getLossyCString: (char*)cString +- (size_t)getLossyCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding { return [self OF_getCString: cString maxLength: maxLength encoding: encoding lossy: true]; } -- (const char*)OF_cStringWithEncoding: (of_string_encoding_t)encoding - lossy: (bool)lossy +- (const char *)OF_cStringWithEncoding: (of_string_encoding_t)encoding + lossy: (bool)lossy { OFObject *object = [[[OFObject alloc] init] autorelease]; size_t length = [self length]; char *cString; @@ -1351,23 +1351,23 @@ } return cString; } -- (const char*)cStringWithEncoding: (of_string_encoding_t)encoding +- (const char *)cStringWithEncoding: (of_string_encoding_t)encoding { return [self OF_cStringWithEncoding: encoding lossy: false]; } -- (const char*)lossyCStringWithEncoding: (of_string_encoding_t)encoding +- (const char *)lossyCStringWithEncoding: (of_string_encoding_t)encoding { return [self OF_cStringWithEncoding: encoding lossy: true]; } -- (const char*)UTF8String +- (const char *)UTF8String { return [self cStringWithEncoding: OF_STRING_ENCODING_UTF_8]; } - (size_t)length @@ -1424,11 +1424,11 @@ - (of_unichar_t)characterAtIndex: (size_t)index { OF_UNRECOGNIZED_SELECTOR } -- (void)getCharacters: (of_unichar_t*)buffer +- (void)getCharacters: (of_unichar_t *)buffer inRange: (of_range_t)range { for (size_t i = 0; i < range.length; i++) buffer[i] = [self characterAtIndex: range.location + i]; } @@ -1489,11 +1489,11 @@ return OF_ORDERED_SAME; if (![object isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException exception]; - otherString = (OFString*)object; + otherString = (OFString *)object; minimumLength = ([self length] > [otherString length] ? [otherString length] : [self length]); pool = objc_autoreleasePoolPush(); @@ -1520,11 +1520,11 @@ return OF_ORDERED_ASCENDING; return OF_ORDERED_SAME; } -- (of_comparison_result_t)caseInsensitiveCompare: (OFString*)otherString +- (of_comparison_result_t)caseInsensitiveCompare: (OFString *)otherString { void *pool = objc_autoreleasePoolPush(); const of_unichar_t *characters, *otherCharacters; size_t length, otherLength, minimumLength; @@ -1601,16 +1601,16 @@ OF_HASH_FINALIZE(hash); return hash; } -- (OFString*)description +- (OFString *)description { return [[self copy] autorelease]; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; OFString *className; @@ -1628,24 +1628,24 @@ objc_autoreleasePoolPop(pool); return [element autorelease]; } -- (OFString*)JSONRepresentation +- (OFString *)JSONRepresentation { return [self OF_JSONRepresentationWithOptions: 0 depth: 0]; } -- (OFString*)JSONRepresentationWithOptions: (int)options +- (OFString *)JSONRepresentationWithOptions: (int)options { return [self OF_JSONRepresentationWithOptions: options depth: 0]; } -- (OFString*)OF_JSONRepresentationWithOptions: (int)options - depth: (size_t)depth +- (OFString *)OF_JSONRepresentationWithOptions: (int)options + depth: (size_t)depth { OFMutableString *JSON = [[self mutableCopy] autorelease]; /* FIXME: This is slow! Write it in pure C! */ [JSON replaceOccurrencesOfString: @"\\" @@ -1689,11 +1689,11 @@ [JSON makeImmutable]; return JSON; } -- (OFDataArray*)messagePackRepresentation +- (OFDataArray *)messagePackRepresentation { OFDataArray *data; size_t length; length = [self UTF8StringLength]; @@ -1741,26 +1741,26 @@ count: length]; return data; } -- (of_range_t)rangeOfString: (OFString*)string +- (of_range_t)rangeOfString: (OFString *)string { return [self rangeOfString: string options: 0 range: of_range(0, [self length])]; } -- (of_range_t)rangeOfString: (OFString*)string +- (of_range_t)rangeOfString: (OFString *)string options: (int)options { return [self rangeOfString: string options: options range: of_range(0, [self length])]; } -- (of_range_t)rangeOfString: (OFString*)string +- (of_range_t)rangeOfString: (OFString *)string options: (int)options range: (of_range_t)range { void *pool; const of_unichar_t *searchCharacters; @@ -1820,11 +1820,11 @@ objc_autoreleasePoolPop(pool); return of_range(OF_NOT_FOUND, 0); } -- (bool)containsString: (OFString*)string +- (bool)containsString: (OFString *)string { void *pool; const of_unichar_t *characters, *searchCharacters; size_t length, searchLength; @@ -1850,11 +1850,11 @@ objc_autoreleasePoolPop(pool); return false; } -- (OFString*)substringWithRange: (of_range_t)range +- (OFString *)substringWithRange: (of_range_t)range { void *pool; OFString *ret; if (range.length > SIZE_MAX - range.location || @@ -1868,11 +1868,11 @@ objc_autoreleasePoolPop(pool); return [ret autorelease]; } -- (OFString*)stringByAppendingString: (OFString*)string +- (OFString *)stringByAppendingString: (OFString *)string { OFMutableString *new; new = [OFMutableString stringWithString: self]; [new appendString: string]; @@ -1880,11 +1880,11 @@ [new makeImmutable]; return new; } -- (OFString*)stringByAppendingFormat: (OFConstantString*)format, ... +- (OFString *)stringByAppendingFormat: (OFConstantString *)format, ... { OFString *ret; va_list arguments; va_start(arguments, format); @@ -1893,12 +1893,12 @@ va_end(arguments); return ret; } -- (OFString*)stringByAppendingFormat: (OFConstantString*)format - arguments: (va_list)arguments +- (OFString *)stringByAppendingFormat: (OFConstantString *)format + arguments: (va_list)arguments { OFMutableString *new; new = [OFMutableString stringWithString: self]; [new appendFormat: format @@ -1907,11 +1907,11 @@ [new makeImmutable]; return new; } -- (OFString*)stringByAppendingPathComponent: (OFString*)component +- (OFString *)stringByAppendingPathComponent: (OFString *)component { void *pool = objc_autoreleasePoolPush(); OFString *ret; ret = [OFString pathWithComponents: @@ -1920,11 +1920,11 @@ [ret retain]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } -- (OFString*)stringByPrependingString: (OFString*)string +- (OFString *)stringByPrependingString: (OFString *)string { OFMutableString *new = [[string mutableCopy] autorelease]; [new appendString: self]; @@ -1931,12 +1931,12 @@ [new makeImmutable]; return new; } -- (OFString*)stringByReplacingOccurrencesOfString: (OFString*)string - withString: (OFString*)replacement +- (OFString *)stringByReplacingOccurrencesOfString: (OFString *)string + withString: (OFString *)replacement { OFMutableString *new = [[self mutableCopy] autorelease]; [new replaceOccurrencesOfString: string withString: replacement]; @@ -1944,14 +1944,14 @@ [new makeImmutable]; return new; } -- (OFString*)stringByReplacingOccurrencesOfString: (OFString*)string - withString: (OFString*)replacement - options: (int)options - range: (of_range_t)range +- (OFString *)stringByReplacingOccurrencesOfString: (OFString *)string + withString: (OFString *)replacement + options: (int)options + range: (of_range_t)range { OFMutableString *new = [[self mutableCopy] autorelease]; [new replaceOccurrencesOfString: string withString: replacement @@ -1961,11 +1961,11 @@ [new makeImmutable]; return new; } -- (OFString*)uppercaseString +- (OFString *)uppercaseString { OFMutableString *new = [[self mutableCopy] autorelease]; [new uppercase]; @@ -1972,11 +1972,11 @@ [new makeImmutable]; return new; } -- (OFString*)lowercaseString +- (OFString *)lowercaseString { OFMutableString *new = [[self mutableCopy] autorelease]; [new lowercase]; @@ -1983,11 +1983,11 @@ [new makeImmutable]; return new; } -- (OFString*)capitalizedString +- (OFString *)capitalizedString { OFMutableString *new = [[self mutableCopy] autorelease]; [new capitalize]; @@ -1994,11 +1994,11 @@ [new makeImmutable]; return new; } -- (OFString*)stringByDeletingLeadingWhitespaces +- (OFString *)stringByDeletingLeadingWhitespaces { OFMutableString *new = [[self mutableCopy] autorelease]; [new deleteLeadingWhitespaces]; @@ -2005,11 +2005,11 @@ [new makeImmutable]; return new; } -- (OFString*)stringByDeletingTrailingWhitespaces +- (OFString *)stringByDeletingTrailingWhitespaces { OFMutableString *new = [[self mutableCopy] autorelease]; [new deleteTrailingWhitespaces]; @@ -2016,11 +2016,11 @@ [new makeImmutable]; return new; } -- (OFString*)stringByDeletingEnclosingWhitespaces +- (OFString *)stringByDeletingEnclosingWhitespaces { OFMutableString *new = [[self mutableCopy] autorelease]; [new deleteEnclosingWhitespaces]; @@ -2027,11 +2027,11 @@ [new makeImmutable]; return new; } -- (bool)hasPrefix: (OFString*)prefix +- (bool)hasPrefix: (OFString *)prefix { of_unichar_t *tmp; const of_unichar_t *prefixCharacters; size_t prefixLength; bool hasPrefix; @@ -2057,11 +2057,11 @@ } return hasPrefix; } -- (bool)hasSuffix: (OFString*)suffix +- (bool)hasSuffix: (OFString *)suffix { of_unichar_t *tmp; const of_unichar_t *suffixCharacters; size_t length, suffixLength; bool hasSuffix; @@ -2090,18 +2090,18 @@ } return hasSuffix; } -- (OFArray*)componentsSeparatedByString: (OFString*)delimiter +- (OFArray *)componentsSeparatedByString: (OFString *)delimiter { return [self componentsSeparatedByString: delimiter options: 0]; } -- (OFArray*)componentsSeparatedByString: (OFString*)delimiter - options: (int)options +- (OFArray *)componentsSeparatedByString: (OFString *)delimiter + options: (int)options { void *pool; OFMutableArray *array = [OFMutableArray array]; const of_unichar_t *characters, *delimiterCharacters; bool skipEmpty = (options & OF_STRING_SKIP_EMPTY); @@ -2146,11 +2146,11 @@ objc_autoreleasePoolPop(pool); return array; } -- (OFArray*)pathComponents +- (OFArray *)pathComponents { OFMutableArray *ret; void *pool; const of_unichar_t *characters; size_t i, last = 0, length = [self length]; @@ -2194,11 +2194,11 @@ objc_autoreleasePoolPop(pool); return ret; } -- (OFString*)lastPathComponent +- (OFString *)lastPathComponent { void *pool; const of_unichar_t *characters; size_t length = [self length]; ssize_t i; @@ -2239,11 +2239,11 @@ i = 0; return [self substringWithRange: of_range(i, length - i)]; } -- (OFString*)pathExtension +- (OFString *)pathExtension { void *pool = objc_autoreleasePoolPush(); OFString *ret, *fileName; size_t pos; @@ -2259,11 +2259,11 @@ [ret retain]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } -- (OFString*)stringByDeletingLastPathComponent +- (OFString *)stringByDeletingLastPathComponent { void *pool; const of_unichar_t *characters; size_t length = [self length]; @@ -2297,11 +2297,11 @@ objc_autoreleasePoolPop(pool); return OF_PATH_CURRENT_DIRECTORY; } -- (OFString*)stringByDeletingPathExtension +- (OFString *)stringByDeletingPathExtension { void *pool; OFMutableArray *components; OFString *ret, *fileName; size_t pos; @@ -2329,18 +2329,18 @@ [ret retain]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } -- (OFString*)stringByStandardizingPath +- (OFString *)stringByStandardizingPath { return standardizePath([self pathComponents], OF_PATH_CURRENT_DIRECTORY, OF_PATH_PARENT_DIRECTORY, OF_PATH_DELIMITER_STRING); } -- (OFString*)stringByStandardizingURLPath +- (OFString *)stringByStandardizingURLPath { return standardizePath([self componentsSeparatedByString: @"/"], @".", @"..", @"/"); } @@ -2597,11 +2597,11 @@ objc_autoreleasePoolPop(pool); return value; } -- (const of_unichar_t*)characters +- (const of_unichar_t *)characters { OFObject *object = [[[OFObject alloc] init] autorelease]; size_t length = [self length]; of_unichar_t *ret; @@ -2611,16 +2611,16 @@ inRange: of_range(0, length)]; return ret; } -- (const of_char16_t*)UTF16String +- (const of_char16_t *)UTF16String { return [self UTF16StringWithByteOrder: OF_BYTE_ORDER_NATIVE]; } -- (const of_char16_t*)UTF16StringWithByteOrder: (of_byte_order_t)byteOrder +- (const of_char16_t *)UTF16StringWithByteOrder: (of_byte_order_t)byteOrder { OFObject *object = [[[OFObject alloc] init] autorelease]; void *pool = objc_autoreleasePoolPush(); const of_unichar_t *characters = [self characters]; size_t length = [self length]; @@ -2682,16 +2682,16 @@ UTF16StringLength++; return UTF16StringLength; } -- (const of_char32_t*)UTF32String +- (const of_char32_t *)UTF32String { return [self UTF32StringWithByteOrder: OF_BYTE_ORDER_NATIVE]; } -- (const of_char32_t*)UTF32StringWithByteOrder: (of_byte_order_t)byteOrder +- (const of_char32_t *)UTF32StringWithByteOrder: (of_byte_order_t)byteOrder { OFObject *object = [[[OFObject alloc] init] autorelease]; size_t length = [self length]; of_char32_t *ret; @@ -2707,17 +2707,17 @@ return ret; } #ifdef OF_HAVE_FILES -- (void)writeToFile: (OFString*)path +- (void)writeToFile: (OFString *)path { [self writeToFile: path encoding: OF_STRING_ENCODING_UTF_8]; } -- (void)writeToFile: (OFString*)path +- (void)writeToFile: (OFString *)path encoding: (of_string_encoding_t)encoding { void *pool = objc_autoreleasePoolPush(); OFFile *file; Index: src/OFString_UTF8+Private.h ================================================================== --- src/OFString_UTF8+Private.h +++ src/OFString_UTF8+Private.h @@ -17,11 +17,11 @@ #import "OFString_UTF8.h" OF_ASSUME_NONNULL_BEGIN @interface OFString_UTF8 () -- (instancetype)OF_initWithUTF8String: (const char*)UTF8String +- (instancetype)OF_initWithUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength - storage: (char*)storage; + storage: (char *)storage; @end OF_ASSUME_NONNULL_END Index: src/OFString_UTF8.h ================================================================== --- src/OFString_UTF8.h +++ src/OFString_UTF8.h @@ -42,13 +42,13 @@ @end #ifdef __cplusplus extern "C" { #endif -extern int of_string_utf8_check(const char*, size_t, size_t*); -extern size_t of_string_utf8_get_index(const char*, size_t); -extern size_t of_string_utf8_get_position(const char*, size_t, size_t); +extern int of_string_utf8_check(const char *, size_t, size_t *); +extern size_t of_string_utf8_get_index(const char *, size_t); +extern size_t of_string_utf8_get_position(const char *, size_t, size_t); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/OFString_UTF8.m ================================================================== --- src/OFString_UTF8.m +++ src/OFString_UTF8.m @@ -185,13 +185,13 @@ } return self; } -- (instancetype)OF_initWithUTF8String: (const char*)UTF8String +- (instancetype)OF_initWithUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength - storage: (char*)storage + storage: (char *)storage { self = [super init]; @try { if (UTF8StringLength >= 3 && @@ -222,11 +222,11 @@ } return self; } -- initWithCString: (const char*)cString +- initWithCString: (const char *)cString encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength { self = [super init]; @@ -386,11 +386,11 @@ } return self; } -- initWithUTF8StringNoCopy: (char*)UTF8String +- initWithUTF8StringNoCopy: (char *)UTF8String freeWhenDone: (bool)freeWhenDone { self = [super init]; @try { @@ -402,11 +402,11 @@ UTF8StringLength -= 3; } _s = &_storage; - _s->cString = (char*)UTF8String; + _s->cString = (char *)UTF8String; _s->cStringLength = UTF8StringLength; if (freeWhenDone) _s->freeWhenDone = UTF8String; @@ -424,11 +424,11 @@ } return self; } -- initWithString: (OFString*)string +- initWithString: (OFString *)string { self = [super init]; @try { _s = &_storage; @@ -435,11 +435,11 @@ _s->cStringLength = [string UTF8StringLength]; if ([string isKindOfClass: [OFString_UTF8 class]] || [string isKindOfClass: [OFMutableString_UTF8 class]]) - _s->isUTF8 = ((OFString_UTF8*)string)->_s->isUTF8; + _s->isUTF8 = ((OFString_UTF8 *)string)->_s->isUTF8; else _s->isUTF8 = true; _s->length = [string length]; @@ -451,11 +451,11 @@ } return self; } -- initWithCharacters: (const of_unichar_t*)characters +- initWithCharacters: (const of_unichar_t *)characters length: (size_t)length { self = [super init]; @try { @@ -495,11 +495,11 @@ } return self; } -- initWithUTF16String: (const of_char16_t*)string +- initWithUTF16String: (const of_char16_t *)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder { self = [super init]; @@ -580,11 +580,11 @@ } return self; } -- initWithUTF32String: (const of_char32_t*)characters +- initWithUTF32String: (const of_char32_t *)characters length: (size_t)length byteOrder: (of_byte_order_t)byteOrder { self = [super init]; @@ -647,11 +647,11 @@ } return self; } -- initWithFormat: (OFConstantString*)format +- initWithFormat: (OFConstantString *)format arguments: (va_list)arguments { self = [super init]; @try { @@ -699,11 +699,11 @@ free(_s->freeWhenDone); [super dealloc]; } -- (size_t)getCString: (char*)cString +- (size_t)getCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding { switch (encoding) { case OF_STRING_ENCODING_ASCII: @@ -722,11 +722,11 @@ maxLength: maxLength encoding: encoding]; } } -- (const char*)cStringWithEncoding: (of_string_encoding_t)encoding +- (const char *)cStringWithEncoding: (of_string_encoding_t)encoding { switch (encoding) { case OF_STRING_ENCODING_ASCII: if (_s->isUTF8) @throw [OFInvalidEncodingException exception]; @@ -736,11 +736,11 @@ default: return [super cStringWithEncoding: encoding]; } } -- (const char*)UTF8String +- (const char *)UTF8String { return _s->cString; } - (size_t)length @@ -802,11 +802,11 @@ return OF_ORDERED_SAME; if (![object isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException exception]; - otherString = (OFString*)object; + otherString = (OFString *)object; otherCStringLength = [otherString UTF8StringLength]; minimumCStringLength = (_s->cStringLength > otherCStringLength ? otherCStringLength : _s->cStringLength); if ((compare = memcmp(_s->cString, [otherString UTF8String], @@ -822,11 +822,11 @@ return OF_ORDERED_DESCENDING; else return OF_ORDERED_ASCENDING; } -- (of_comparison_result_t)caseInsensitiveCompare: (OFString*)otherString +- (of_comparison_result_t)caseInsensitiveCompare: (OFString *)otherString { const char *otherCString; size_t otherCStringLength, minimumCStringLength; #ifdef OF_HAVE_UNICODE_TABLES size_t i, j; @@ -962,11 +962,11 @@ @throw [OFInvalidEncodingException exception]; return character; } -- (void)getCharacters: (of_unichar_t*)buffer +- (void)getCharacters: (of_unichar_t *)buffer inRange: (of_range_t)range { /* TODO: Could be slightly optimized */ void *pool = objc_autoreleasePoolPush(); const of_unichar_t *characters = [self characters]; @@ -979,11 +979,11 @@ range.length * sizeof(of_unichar_t)); objc_autoreleasePoolPop(pool); } -- (of_range_t)rangeOfString: (OFString*)string +- (of_range_t)rangeOfString: (OFString *)string options: (int)options range: (of_range_t)range { const char *cString = [string UTF8String]; size_t cStringLength = [string UTF8StringLength]; @@ -1039,11 +1039,11 @@ } return of_range(OF_NOT_FOUND, 0); } -- (bool)containsString: (OFString*)string +- (bool)containsString: (OFString *)string { const char *cString = [string UTF8String]; size_t cStringLength = [string UTF8StringLength]; if (cStringLength == 0) @@ -1057,11 +1057,11 @@ return true; return false; } -- (OFString*)substringWithRange: (of_range_t)range +- (OFString *)substringWithRange: (of_range_t)range { size_t start = range.location; size_t end = range.location + range.length; if (range.length > SIZE_MAX - range.location || end > _s->length) @@ -1076,21 +1076,21 @@ return [OFString stringWithUTF8String: _s->cString + start length: end - start]; } -- (bool)hasPrefix: (OFString*)prefix +- (bool)hasPrefix: (OFString *)prefix { size_t cStringLength = [prefix UTF8StringLength]; if (cStringLength > _s->cStringLength) return false; return (memcmp(_s->cString, [prefix UTF8String], cStringLength) == 0); } -- (bool)hasSuffix: (OFString*)suffix +- (bool)hasSuffix: (OFString *)suffix { size_t cStringLength = [suffix UTF8StringLength]; if (cStringLength > _s->cStringLength) return false; @@ -1097,12 +1097,12 @@ return (memcmp(_s->cString + (_s->cStringLength - cStringLength), [suffix UTF8String], cStringLength) == 0); } -- (OFArray*)componentsSeparatedByString: (OFString*)delimiter - options: (int)options +- (OFArray *)componentsSeparatedByString: (OFString *)delimiter + options: (int)options { void *pool; OFMutableArray *array; const char *cString = [delimiter UTF8String]; size_t cStringLength = [delimiter UTF8StringLength]; @@ -1142,11 +1142,11 @@ objc_autoreleasePoolPop(pool); return array; } -- (OFArray*)pathComponents +- (OFArray *)pathComponents { OFMutableArray *ret; void *pool; size_t i, last = 0, pathCStringLength = _s->cStringLength; @@ -1188,11 +1188,11 @@ objc_autoreleasePoolPop(pool); return ret; } -- (OFString*)lastPathComponent +- (OFString *)lastPathComponent { size_t pathCStringLength = _s->cStringLength; ssize_t i; if (pathCStringLength == 0) @@ -1223,11 +1223,11 @@ return [OFString stringWithUTF8String: _s->cString + i length: pathCStringLength - i]; } -- (OFString*)stringByDeletingLastPathComponent +- (OFString *)stringByDeletingLastPathComponent { size_t pathCStringLength = _s->cStringLength; if (pathCStringLength == 0) return @""; @@ -1249,11 +1249,11 @@ length: 1]; return OF_PATH_CURRENT_DIRECTORY; } -- (const of_unichar_t*)characters +- (const of_unichar_t *)characters { OFObject *object = [[[OFObject alloc] init] autorelease]; of_unichar_t *ret; size_t i, j; @@ -1277,11 +1277,11 @@ } return ret; } -- (const of_char32_t*)UTF32StringWithByteOrder: (of_byte_order_t)byteOrder +- (const of_char32_t *)UTF32StringWithByteOrder: (of_byte_order_t)byteOrder { OFObject *object = [[[OFObject alloc] init] autorelease]; of_char32_t *ret; size_t i, j; Index: src/OFSystemInfo.h ================================================================== --- src/OFSystemInfo.h +++ src/OFSystemInfo.h @@ -49,11 +49,11 @@ * On Windows, it uses the `APPDATA` environment variable.@n * On Haiku, it uses the `B_USER_SETTINGS_DIRECTORY` directory. * * @return The path where user data for the application can be stored */ -+ (OFString*)userDataPath; ++ (OFString *)userDataPath; /*! * @brief Returns the path where user configuration for the application can be * stored. * @@ -63,20 +63,20 @@ * On Windows, it uses the `APPDATA` environment variable.@n * On Haiku, it uses the `B_USER_SETTINGS_DIRECTORY` directory. * * @return The path where user configuration for the application can be stored */ -+ (OFString*)userConfigPath; ++ (OFString *)userConfigPath; /*! * @brief Returns the vendor of the CPU. * * If the vendor could not be determined, `nil` is returned instead. * * @return The vendor of the CPU */ -+ (nullable OFString*)CPUVendor; ++ (nullable OFString *)CPUVendor; #if defined(OF_X86_64) || defined(OF_X86) || defined(DOXYGEN) /*! * @brief Returns whether the CPU supports MMX. * Index: src/OFSystemInfo.m ================================================================== --- src/OFSystemInfo.m +++ src/OFSystemInfo.m @@ -141,11 +141,11 @@ + (size_t)numberOfCPUs { return numberOfCPUs; } -+ (OFString*)userDataPath ++ (OFString *)userDataPath { #if defined(OF_MACOS) || defined(OF_IOS) void *pool = objc_autoreleasePoolPush(); char pathC[PATH_MAX]; OFMutableString *path; @@ -231,11 +231,11 @@ objc_autoreleasePoolPop(pool); return [var autorelease]; #endif } -+ (OFString*)userConfigPath ++ (OFString *)userConfigPath { #if defined(OF_MACOS) || defined(OF_IOS) void *pool = objc_autoreleasePoolPush(); char pathC[PATH_MAX]; OFMutableString *path; @@ -322,11 +322,11 @@ objc_autoreleasePoolPop(pool); return [var autorelease]; #endif } -+ (OFString*)CPUVendor ++ (OFString *)CPUVendor { #if defined(OF_X86_64_ASM) || defined(OF_X86_ASM) struct x86_regs regs = x86_cpuid(0, 0); char buffer[12]; Index: src/OFTCPSocket+SOCKS5.h ================================================================== --- src/OFTCPSocket+SOCKS5.h +++ src/OFTCPSocket+SOCKS5.h @@ -25,10 +25,10 @@ #ifdef __cplusplus } #endif @interface OFTCPSocket (SOCKS5) -- (void)OF_SOCKS5ConnectToHost: (OFString*)host +- (void)OF_SOCKS5ConnectToHost: (OFString *)host port: (uint16_t)port; @end OF_ASSUME_NONNULL_END Index: src/OFTCPSocket+SOCKS5.m ================================================================== --- src/OFTCPSocket+SOCKS5.m +++ src/OFTCPSocket+SOCKS5.m @@ -56,11 +56,11 @@ length -= ret; } } @implementation OFTCPSocket (SOCKS5) -- (void)OF_SOCKS5ConnectToHost: (OFString*)host +- (void)OF_SOCKS5ConnectToHost: (OFString *)host port: (uint16_t)port { char request[] = { 5, 1, 0, 3 }; char reply[256]; void *pool; Index: src/OFTCPSocket.h ================================================================== --- src/OFTCPSocket.h +++ src/OFTCPSocket.h @@ -84,18 +84,18 @@ * @brief Sets the global SOCKS5 proxy host to use when creating a new socket * * @param SOCKS5Host The host to use as a SOCKS5 proxy when creating a new * socket */ -+ (void)setSOCKS5Host: (nullable OFString*)SOCKS5Host; ++ (void)setSOCKS5Host: (nullable OFString *)SOCKS5Host; /*! * @brief Returns the host to use as a SOCKS5 proxy when creating a new socket * * @return The host to use as a SOCKS5 proxy when creating a new socket */ -+ (nullable OFString*)SOCKS5Host; ++ (nullable OFString *)SOCKS5Host; /*! * @brief Sets the global SOCKS5 proxy port to use when creating a new socket * * @param SOCKS5Port The port to use as a SOCKS5 proxy when creating a new socket @@ -113,11 +113,11 @@ * @brief Connect the OFTCPSocket to the specified destination. * * @param host The host to connect to * @param port The port on the host to connect to */ -- (void)connectToHost: (OFString*)host +- (void)connectToHost: (OFString *)host port: (uint16_t)port; #ifdef OF_HAVE_THREADS /*! * @brief Asynchronously connect the OFTCPSocket to the specified destination. @@ -127,11 +127,11 @@ * @param target The target on which to call the selector once the connection * has been established * @param selector The selector to call on the target. The signature must be * `void (OFTCPSocket *socket, OFException *exception)`. */ -- (void)asyncConnectToHost: (OFString*)host +- (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port target: (id)target selector: (SEL)selector; # ifdef OF_HAVE_BLOCKS @@ -140,11 +140,11 @@ * * @param host The host to connect to * @param port The port on the host to connect to * @param block The block to execute once the connection has been established */ -- (void)asyncConnectToHost: (OFString*)host +- (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port block: (of_tcp_socket_async_connect_block_t)block; # endif #endif @@ -155,11 +155,11 @@ * IPv6 to bind to all. * @param port The port to bind to. If the port is 0, an unused port will be * chosen, which can be obtained using the return value. * @return The port the socket was bound to */ -- (uint16_t)bindToHost: (OFString*)host +- (uint16_t)bindToHost: (OFString *)host port: (uint16_t)port; /*! * @brief Listen on the socket. * @@ -209,11 +209,11 @@ * * Only works with accepted sockets! * * @return The remote address as a string */ -- (nullable OFString*)remoteAddress; +- (nullable OFString *)remoteAddress; /*! * @brief Returns whether the socket is a listening socket. * * @return Whether the socket is a listening socket Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -76,29 +76,29 @@ of_tcp_socket_async_connect_block_t _block; # endif OFException *_exception; } -- initWithSourceThread: (OFThread*)sourceThread - socket: (OFTCPSocket*)socket - host: (OFString*)host +- initWithSourceThread: (OFThread *)sourceThread + socket: (OFTCPSocket *)socket + host: (OFString *)host port: (uint16_t)port target: (id)target selector: (SEL)selector; # ifdef OF_HAVE_BLOCKS -- initWithSourceThread: (OFThread*)sourceThread - socket: (OFTCPSocket*)socket - host: (OFString*)host +- initWithSourceThread: (OFThread *)sourceThread + socket: (OFTCPSocket *)socket + host: (OFString *)host port: (uint16_t)port block: (of_tcp_socket_async_connect_block_t)block; # endif @end @implementation OFTCPSocket_ConnectThread -- initWithSourceThread: (OFThread*)sourceThread - socket: (OFTCPSocket*)socket - host: (OFString*)host +- initWithSourceThread: (OFThread *)sourceThread + socket: (OFTCPSocket *)socket + host: (OFString *)host port: (uint16_t)port target: (id)target selector: (SEL)selector { self = [super init]; @@ -117,13 +117,13 @@ return self; } # ifdef OF_HAVE_BLOCKS -- initWithSourceThread: (OFThread*)sourceThread - socket: (OFTCPSocket*)socket - host: (OFString*)host +- initWithSourceThread: (OFThread *)sourceThread + socket: (OFTCPSocket *)socket + host: (OFString *)host port: (uint16_t)port block: (of_tcp_socket_async_connect_block_t)block { self = [super init]; @@ -163,12 +163,12 @@ # ifdef OF_HAVE_BLOCKS if (_block != NULL) _block(_socket, _exception); else { # endif - void (*func)(id, SEL, OFTCPSocket*, OFException*) = - (void(*)(id, SEL, OFTCPSocket*, OFException*))[_target + void (*func)(id, SEL, OFTCPSocket *, OFException *) = + (void (*)(id, SEL, OFTCPSocket *, OFException *))[_target methodForSelector: _selector]; func(_target, _selector, _socket, _exception); # ifdef OF_HAVE_BLOCKS } @@ -198,18 +198,18 @@ #endif @implementation OFTCPSocket @synthesize SOCKS5Host = _SOCKS5Host, SOCKS5Port = _SOCKS5Port; -+ (void)setSOCKS5Host: (OFString*)host ++ (void)setSOCKS5Host: (OFString *)host { id old = defaultSOCKS5Host; defaultSOCKS5Host = [host copy]; [old release]; } -+ (OFString*)SOCKS5Host ++ (OFString *)SOCKS5Host { return [[defaultSOCKS5Host copy] autorelease]; } + (void)setSOCKS5Port: (uint16_t)port @@ -243,11 +243,11 @@ [_SOCKS5Host release]; [super dealloc]; } -- (void)connectToHost: (OFString*)host +- (void)connectToHost: (OFString *)host port: (uint16_t)port { OFString *destinationHost = host; uint16_t destinationPort = port; of_resolver_result_t **results, **iter; @@ -308,11 +308,11 @@ [self OF_SOCKS5ConnectToHost: destinationHost port: destinationPort]; } #ifdef OF_HAVE_THREADS -- (void)asyncConnectToHost: (OFString*)host +- (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port target: (id)target selector: (SEL)selector { void *pool = objc_autoreleasePoolPush(); @@ -327,11 +327,11 @@ objc_autoreleasePoolPop(pool); } # ifdef OF_HAVE_BLOCKS -- (void)asyncConnectToHost: (OFString*)host +- (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port block: (of_tcp_socket_async_connect_block_t)block { void *pool = objc_autoreleasePoolPush(); @@ -345,11 +345,11 @@ objc_autoreleasePoolPop(pool); } # endif #endif -- (uint16_t)bindToHost: (OFString*)host +- (uint16_t)bindToHost: (OFString *)host port: (uint16_t)port { of_resolver_result_t **results; const int one = 1; #if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) @@ -389,11 +389,11 @@ if ((flags = fcntl(_socket, F_GETFD, 0)) != -1) fcntl(_socket, F_SETFD, flags | FD_CLOEXEC); #endif setsockopt(_socket, SOL_SOCKET, SO_REUSEADDR, - (const char*)&one, (socklen_t)sizeof(one)); + (const char *)&one, (socklen_t)sizeof(one)); #if defined(OF_WII) || defined(OF_NINTENDO_3DS) if (port != 0) { #endif if (bind(_socket, results[0]->address, @@ -418,17 +418,17 @@ while (rnd < 1024) rnd = (uint16_t)rand(); switch (results[0]->family) { case AF_INET: - ((struct sockaddr_in*) + ((struct sockaddr_in *) results[0]->address)->sin_port = OF_BSWAP16_IF_LE(rnd); break; # ifdef HAVE_IPV6 case AF_INET6: - ((struct sockaddr_in6*) + ((struct sockaddr_in6 *) results[0]->address)->sin6_port = OF_BSWAP16_IF_LE(rnd); break; # endif default: @@ -466,11 +466,11 @@ if (port > 0) return port; #if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) addrLen = (socklen_t)sizeof(addr.storage); - if (of_getsockname(_socket, (struct sockaddr*)&addr.storage, + if (of_getsockname(_socket, (struct sockaddr *)&addr.storage, &addrLen) != 0) { int errNo = of_socket_errno(); close(_socket); _socket = INVALID_SOCKET; @@ -584,11 +584,11 @@ [OFRunLoop OF_addAsyncAcceptForTCPSocket: self block: block]; } #endif -- (OFString*)remoteAddress +- (OFString *)remoteAddress { OFString *ret; if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; @@ -610,11 +610,11 @@ - (void)setKeepAliveEnabled: (bool)enabled { int v = enabled; if (setsockopt(_socket, SOL_SOCKET, SO_KEEPALIVE, - (char*)&v, (socklen_t)sizeof(v)) != 0) + (char *)&v, (socklen_t)sizeof(v)) != 0) @throw [OFSetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; } @@ -622,11 +622,11 @@ { int v; socklen_t len = sizeof(v); if (getsockopt(_socket, SOL_SOCKET, SO_KEEPALIVE, - (char*)&v, &len) != 0 || len != sizeof(v)) + (char *)&v, &len) != 0 || len != sizeof(v)) @throw [OFGetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; return v; @@ -637,11 +637,11 @@ - (void)setTCPNoDelayEnabled: (bool)enabled { int v = enabled; if (setsockopt(_socket, IPPROTO_TCP, TCP_NODELAY, - (char*)&v, (socklen_t)sizeof(v)) != 0) + (char *)&v, (socklen_t)sizeof(v)) != 0) @throw [OFSetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; } @@ -649,11 +649,11 @@ { int v; socklen_t len = sizeof(v); if (getsockopt(_socket, IPPROTO_TCP, TCP_NODELAY, - (char*)&v, &len) != 0 || len != sizeof(v)) + (char *)&v, &len) != 0 || len != sizeof(v)) @throw [OFGetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; return v; Index: src/OFTLSSocket.h ================================================================== --- src/OFTLSSocket.h +++ src/OFTLSSocket.h @@ -42,11 +42,11 @@ * certificate * @param certificate A dictionary with the fields of the received certificate * @return Whether the TLS socket should accept the received certificate chain */ - (bool)socket: (id )socket - shouldAcceptCertificate: (OFDictionary*)certificate; + shouldAcceptCertificate: (OFDictionary *)certificate; @end /*! * @protocol OFTLSSocket OFTLSSocket.h ObjFW/OFTLSSocket.h * @@ -89,11 +89,11 @@ * @brief Initializes the TLS socket with the specified TCP socket as its * underlying socket. * * @param socket The TCP socket to use as underlying socket */ -- initWithSocket: (OFTCPSocket*)socket; +- initWithSocket: (OFTCPSocket *)socket; /*! * @brief Initiates the TLS handshake. * * @note This is only useful if you used @ref initWithSocket: to start TLS on @@ -100,11 +100,11 @@ * a TCP socket which is already connected! * * @param host The host to expect for certificate verification. * May be `nil` if certificate verification is disabled. */ -- (void)startTLSWithExpectedHost: (nullable OFString*)host; +- (void)startTLSWithExpectedHost: (nullable OFString *)host; /*! * @brief Sets the path to the X.509 certificate file to use for the specified * SNI host. * @@ -111,12 +111,12 @@ * @param SNIHost The SNI host for which the path of the X.509 certificate file * should be set * * @param certificateFile The path to the X.509 certificate file */ -- (void)setCertificateFile: (OFString*)certificateFile - forSNIHost: (OFString*)SNIHost; +- (void)setCertificateFile: (OFString *)certificateFile + forSNIHost: (OFString *)SNIHost; /*! * @brief Returns the path of the X.509 certificate file used by the TLS socket * for the specified SNI host. * @@ -124,22 +124,22 @@ * should be returned * * @return The path of the X.509 certificate file used by the TLS socket for * the specified SNI host */ -- (nullable OFString*)certificateFileForSNIHost: (OFString*)SNIHost; +- (nullable OFString *)certificateFileForSNIHost: (OFString *)SNIHost; /*! * @brief Sets the path to the PKCS#8 private key file to use for the specified * SNI host. * * @param privateKeyFile The path to the PKCS#8 private key file * @param SNIHost The SNI host for which the path to the PKCS#8 private key * file should be set */ -- (void)setPrivateKeyFile: (OFString*)privateKeyFile - forSNIHost: (OFString*)SNIHost; +- (void)setPrivateKeyFile: (OFString *)privateKeyFile + forSNIHost: (OFString *)SNIHost; /*! * @brief Returns the path of the PKCS#8 private key file used by the TLS * socket for the specified SNI host. * @@ -147,11 +147,11 @@ * file should be returned * * @return The path of the PKCS#8 private key file used by the TLS socket for * the specified SNI host */ -- (nullable OFString*)privateKeyFileForSNIHost: (OFString*)SNIHost; +- (nullable OFString *)privateKeyFileForSNIHost: (OFString *)SNIHost; /*! * @brief Sets the passphrase to decrypt the PKCS#8 private key file for the * specified SNI host. * @@ -161,12 +161,12 @@ * @param privateKeyPassphrase The passphrase to decrypt the PKCS#8 private * key file for the specified SNI host * @param SNIHost The SNI host for which the passphrase to decrypt the PKCS#8 * private key file should be set */ -- (void)setPrivateKeyPassphrase: (const char*)privateKeyPassphrase - forSNIHost: (OFString*)SNIHost; +- (void)setPrivateKeyPassphrase: (const char *)privateKeyPassphrase + forSNIHost: (OFString *)SNIHost; /*! * @brief Returns the passphrase to decrypt the PKCS#8 private key file for the * specified SNI host. * @@ -176,9 +176,9 @@ * private key file should be returned * * @return The passphrase to decrypt the PKCS#8 private key file for the * specified SNI host */ -- (nullable const char*)privateKeyPassphraseForSNIHost: (OFString*)SNIHost; +- (nullable const char *)privateKeyPassphraseForSNIHost: (OFString *)SNIHost; @end OF_ASSUME_NONNULL_END Index: src/OFTarArchive.h ================================================================== --- src/OFTarArchive.h +++ src/OFTarArchive.h @@ -41,40 +41,40 @@ * @brief Creates a new OFTarArchive object with the specified stream. * * @param stream A stream from which the tar archive will be read * @return A new, autoreleased OFTarArchive */ -+ (instancetype)archiveWithStream: (OFStream*)stream; ++ (instancetype)archiveWithStream: (OFStream *)stream; #ifdef OF_HAVE_FILES /*! * @brief Creates a new OFTarArchive object with the specified file. * * @param path The path to the tar archive * @return A new, autoreleased OFTarArchive */ -+ (instancetype)archiveWithPath: (OFString*)path; ++ (instancetype)archiveWithPath: (OFString *)path; #endif /*! * @brief Initializes an already allocated OFTarArchive object with the * specified stream. * * @param stream A stream from which the tar archive will be read * @return An initialized OFTarArchive */ -- initWithStream: (OFStream*)stream; +- initWithStream: (OFStream *)stream; #ifdef OF_HAVE_FILES /*! * @brief Initializes an already allocated OFTarArchive object with the * specified file. * * @param path The path to the tar archive * @return An initialized OFTarArchive */ -- initWithPath: (OFString*)path; +- initWithPath: (OFString *)path; #endif /*! * @brief Returns the next entry from the tar archive or `nil` if all entries * have been read. @@ -84,9 +84,9 @@ * @ref OFReadFailedException! * * @return The next entry from the tar archive or `nil` if all entries have * been read */ -- (OFTarArchiveEntry*)nextEntry; +- (OFTarArchiveEntry *)nextEntry; @end OF_ASSUME_NONNULL_END Index: src/OFTarArchive.m ================================================================== --- src/OFTarArchive.m +++ src/OFTarArchive.m @@ -25,33 +25,33 @@ #endif #import "OFInvalidFormatException.h" @implementation OFTarArchive: OFObject -+ (instancetype)archiveWithStream: (OFStream*)stream ++ (instancetype)archiveWithStream: (OFStream *)stream { return [[[self alloc] initWithStream: stream] autorelease]; } #ifdef OF_HAVE_FILES -+ (instancetype)archiveWithPath: (OFString*)path ++ (instancetype)archiveWithPath: (OFString *)path { return [[[self alloc] initWithPath: path] autorelease]; } #endif -- initWithStream: (OFStream*)stream +- initWithStream: (OFStream *)stream { self = [super init]; _stream = [stream retain]; return self; } #ifdef OF_HAVE_FILES -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path { self = [super init]; @try { _stream = [[OFFile alloc] initWithPath: path @@ -71,11 +71,11 @@ [_lastReturnedEntry release]; [super dealloc]; } -- (OFTarArchiveEntry*)nextEntry +- (OFTarArchiveEntry *)nextEntry { union { char c[512]; uint32_t u32[512 / sizeof(uint32_t)]; } buffer; Index: src/OFTarArchiveEntry+Private.h ================================================================== --- src/OFTarArchiveEntry+Private.h +++ src/OFTarArchiveEntry+Private.h @@ -18,10 +18,10 @@ OF_ASSUME_NONNULL_BEGIN @interface OFTarArchiveEntry () - (instancetype)OF_initWithHeader: (char[_Nonnull 512])header - stream: (OFStream*)stream; + stream: (OFStream *)stream; - (void)OF_skip; @end OF_ASSUME_NONNULL_END Index: src/OFTarArchiveEntry.m ================================================================== --- src/OFTarArchiveEntry.m +++ src/OFTarArchiveEntry.m @@ -26,11 +26,11 @@ #import "OFDate.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" -static OFString* +static OFString * stringFromBuffer(const char *buffer, size_t length) { for (size_t i = 0; i < length; i++) if (buffer[i] == '\0') length = i; @@ -56,11 +56,11 @@ @synthesize targetFileName = _targetFileName; @synthesize owner = _owner, group = _group; @synthesize deviceMajor = _deviceMajor, deviceMinor = _deviceMinor; - (instancetype)OF_initWithHeader: (char[512])header - stream: (OFStream*)stream + stream: (OFStream *)stream { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); @@ -118,11 +118,11 @@ [_group release]; [super dealloc]; } -- (size_t)lowlevelReadIntoBuffer: (void*)buffer +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { size_t ret; if (_atEndOfStream) @@ -179,11 +179,11 @@ if (_size % 512 != 0) [_stream readIntoBuffer: buffer exactLength: 512 - ((size_t)_size % 512)]; } -- (OFString*)description +- (OFString *)description { void *pool = objc_autoreleasePoolPush(); OFString *ret = [OFString stringWithFormat: @"<%@:\n" @"\tFile name = %@\n" @"\tMode = %06o\n" Index: src/OFThread.h ================================================================== --- src/OFThread.h +++ src/OFThread.h @@ -104,26 +104,26 @@ /*! * @brief Returns the current thread. * * @return The current thread */ -+ (OFThread*)currentThread; ++ (OFThread *)currentThread; /*! * @brief Returns the main thread. * * @return The main thread */ -+ (OFThread*)mainThread; ++ (OFThread *)mainThread; /*! * @brief Returns a dictionary to store thread-specific data, meaning it * returns a different dictionary for every thread. * * @return A dictionary to store thread-specific data. */ -+ (OFMutableDictionary*)threadDictionary; ++ (OFMutableDictionary *)threadDictionary; #endif /*! * @brief Suspends execution of the current thread for the specified time * interval. @@ -135,11 +135,11 @@ /*! * @brief Suspends execution of the current thread until the specified date. * * @param date The date to wait for */ -+ (void)sleepUntilDate: (OFDate*)date; ++ (void)sleepUntilDate: (OFDate *)date; /*! * @brief Yields a processor voluntarily and moves the thread to the end of the * queue for its priority. */ @@ -201,25 +201,25 @@ /*! * @brief Returns the run loop for the thread. * * @return The run loop for the thread */ -- (OFRunLoop*)runLoop; +- (OFRunLoop *)runLoop; /*! * @brief Returns the name of the thread or `nil` if none has been set. * * @return The name of the thread or nil if none has been set */ -- (nullable OFString*)name; +- (nullable OFString *)name; /*! * @brief Sets the name for the thread. * * @param name The name for the thread */ -- (void)setName: (nullable OFString*)name; +- (void)setName: (nullable OFString *)name; /*! * @brief Returns the priority of the thread. * * This is a value between -1.0 (meaning lowest priority that still schedules) Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -97,11 +97,11 @@ static OFThread *mainThread; static void callMain(id object) { - OFThread *thread = (OFThread*)object; + OFThread *thread = (OFThread *)object; if (!of_tlskey_set(threadSelfKey, thread)) @throw [OFInitializationFailedException exceptionWithClass: [thread class]]; @@ -155,21 +155,21 @@ { return [[[self alloc] initWithThreadBlock: threadBlock] autorelease]; } # endif -+ (OFThread*)currentThread ++ (OFThread *)currentThread { return of_tlskey_get(threadSelfKey); } -+ (OFThread*)mainThread ++ (OFThread *)mainThread { return mainThread; } -+ (OFMutableDictionary*)threadDictionary ++ (OFMutableDictionary *)threadDictionary { OFThread *thread = of_tlskey_get(threadSelfKey); if (thread->_threadDictionary == nil) thread->_threadDictionary = [[OFMutableDictionary alloc] init]; @@ -220,11 +220,11 @@ usleep((useconds_t)lrint( (timeInterval - floor(timeInterval)) * 1000000)); #endif } -+ (void)sleepUntilDate: (OFDate*)date ++ (void)sleepUntilDate: (OFDate *)date { [self sleepForTimeInterval: [date timeIntervalSinceNow]]; } + (void)yield @@ -367,17 +367,17 @@ - copy { return [self retain]; } -- (OFRunLoop*)runLoop +- (OFRunLoop *)runLoop { # ifdef OF_HAVE_ATOMIC_OPS if (_runLoop == nil) { OFRunLoop *tmp = [[OFRunLoop alloc] init]; - if (!of_atomic_ptr_cmpswap((void**)&_runLoop, nil, tmp)) + if (!of_atomic_ptr_cmpswap((void **)&_runLoop, nil, tmp)) [tmp release]; } # else @synchronized (self) { if (_runLoop == nil) @@ -386,16 +386,16 @@ # endif return [[_runLoop retain] autorelease]; } -- (OFString*)name +- (OFString *)name { return [[_name copy] autorelease]; } -- (void)setName: (OFString*)name +- (void)setName: (OFString *)name { OFString *old = name; _name = [name copy]; [old release]; Index: src/OFThreadPool.m ================================================================== --- src/OFThreadPool.m +++ src/OFThreadPool.m @@ -129,21 +129,21 @@ @public volatile bool _terminate; volatile int *_doneCount; } -+ (instancetype)threadWithThreadPool: (OFThreadPool*)threadPool; -- initWithThreadPool: (OFThreadPool*)threadPool; ++ (instancetype)threadWithThreadPool: (OFThreadPool *)threadPool; +- initWithThreadPool: (OFThreadPool *)threadPool; @end @implementation OFThreadPoolThread -+ (instancetype)threadWithThreadPool: (OFThreadPool*)threadPool ++ (instancetype)threadWithThreadPool: (OFThreadPool *)threadPool { return [[[self alloc] initWithThreadPool: threadPool] autorelease]; } -- initWithThreadPool: (OFThreadPool*)threadPool +- initWithThreadPool: (OFThreadPool *)threadPool { self = [super init]; @try { _queue = [threadPool->_queue retain]; @@ -314,11 +314,11 @@ [_countCondition release]; [super dealloc]; } -- (void)OF_dispatchJob: (OFThreadPoolJob*)job +- (void)OF_dispatchJob: (OFThreadPoolJob *)job { [_countCondition lock]; _count++; [_countCondition unlock]; Index: src/OFTimer.h ================================================================== --- src/OFTimer.h +++ src/OFTimer.h @@ -214,11 +214,11 @@ * @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 An initialized timer */ -- initWithFireDate: (OFDate*)fireDate +- initWithFireDate: (OFDate *)fireDate interval: (of_time_interval_t)interval target: (id)target selector: (SEL)selector repeats: (bool)repeats; @@ -233,11 +233,11 @@ * @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 An initialized timer */ -- initWithFireDate: (OFDate*)fireDate +- initWithFireDate: (OFDate *)fireDate interval: (of_time_interval_t)interval target: (id)target selector: (SEL)selector object: (nullable id)object repeats: (bool)repeats; @@ -256,11 +256,11 @@ * @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 An initialized timer */ -- initWithFireDate: (OFDate*)fireDate +- initWithFireDate: (OFDate *)fireDate interval: (of_time_interval_t)interval target: (id)target selector: (SEL)selector object: (nullable id)object1 object: (nullable id)object2 @@ -276,11 +276,11 @@ * a repeating timer * @param repeats Whether the timer repeats after it has been executed * @param block The block to invoke when the timer fires * @return An initialized timer */ -- initWithFireDate: (OFDate*)fireDate +- initWithFireDate: (OFDate *)fireDate interval: (of_time_interval_t)interval repeats: (bool)repeats block: (of_timer_block_t)block; #endif @@ -293,11 +293,11 @@ /*! * @brief Returns the next date at which the timer will fire. * * @return The next date at which the timer will fire */ -- (OFDate*)fireDate; +- (OFDate *)fireDate; /*! * @brief Sets the next date at which the timer will fire. * * If the timer is already scheduled in a run loop, it will be rescheduled. @@ -305,11 +305,11 @@ * preferable to reschedule instead of invalidating the timer and creating a * new one. * * @param fireDate The next date at which the timer will fire */ -- (void)setFireDate: (OFDate*)fireDate; +- (void)setFireDate: (OFDate *)fireDate; /*! * @brief Invalidates the timer, preventing it from firing. */ - (void)invalidate; Index: src/OFTimer.m ================================================================== --- src/OFTimer.m +++ src/OFTimer.m @@ -210,11 +210,11 @@ - init { OF_INVALID_INIT_METHOD } -- (instancetype)OF_initWithFireDate: (OFDate*)fireDate +- (instancetype)OF_initWithFireDate: (OFDate *)fireDate interval: (of_time_interval_t)interval target: (id)target selector: (SEL)selector object: (id)object1 object: (id)object2 @@ -242,11 +242,11 @@ } return self; } -- initWithFireDate: (OFDate*)fireDate +- initWithFireDate: (OFDate *)fireDate interval: (of_time_interval_t)interval target: (id)target selector: (SEL)selector repeats: (bool)repeats { @@ -258,11 +258,11 @@ object: nil arguments: 0 repeats: repeats]; } -- initWithFireDate: (OFDate*)fireDate +- initWithFireDate: (OFDate *)fireDate interval: (of_time_interval_t)interval target: (id)target selector: (SEL)selector object: (id)object repeats: (bool)repeats @@ -275,11 +275,11 @@ object: nil arguments: 1 repeats: repeats]; } -- initWithFireDate: (OFDate*)fireDate +- initWithFireDate: (OFDate *)fireDate interval: (of_time_interval_t)interval target: (id)target selector: (SEL)selector object: (id)object1 object: (id)object2 @@ -294,11 +294,11 @@ arguments: 2 repeats: repeats]; } #ifdef OF_HAVE_BLOCKS -- initWithFireDate: (OFDate*)fireDate +- initWithFireDate: (OFDate *)fireDate interval: (of_time_interval_t)interval repeats: (bool)repeats block: (of_timer_block_t)block { self = [super init]; @@ -348,11 +348,11 @@ OFTimer *timer; if (![object isKindOfClass: [OFTimer class]]) @throw [OFInvalidArgumentException exception]; - timer = (OFTimer*)object; + timer = (OFTimer *)object; return [_fireDate compare: timer->_fireDate]; } - (void)fire @@ -408,16 +408,16 @@ #endif objc_autoreleasePoolPop(pool); } -- (OFDate*)fireDate +- (OFDate *)fireDate { return [[_fireDate copy] autorelease]; } -- (void)setFireDate: (OFDate*)fireDate +- (void)setFireDate: (OFDate *)fireDate { [self retain]; @try { @synchronized (self) { OFDate *old; Index: src/OFUDPSocket.h ================================================================== --- src/OFUDPSocket.h +++ src/OFUDPSocket.h @@ -110,13 +110,13 @@ * @param host The host to resolve * @param port The port for the resulting address * @param address A pointer to the address that should be filled with the * host / port pair */ -+ (void)resolveAddressForHost: (OFString*)host ++ (void)resolveAddressForHost: (OFString *)host port: (uint16_t)port - address: (of_udp_socket_address_t*)address; + address: (of_udp_socket_address_t *)address; #ifdef OF_HAVE_THREADS /*! * @brief Asynchronously resolves the specified host and creates an address for * the host / port pair. @@ -127,11 +127,11 @@ * resolved * @param selector The selector to call on the target. The signature must be * `void (OFString *host, uint16_t port, * of_udp_socket_address_t address, OFException *exception)`. */ -+ (void)asyncResolveAddressForHost: (OFString*)host ++ (void)asyncResolveAddressForHost: (OFString *)host port: (uint16_t)port target: (id)target selector: (SEL)selector; # ifdef OF_HAVE_BLOCKS @@ -141,28 +141,28 @@ * * @param host The host to resolve * @param port The port for the resulting address * @param block The block to execute once the host has been resolved */ -+ (void)asyncResolveAddressForHost: (OFString*)host ++ (void)asyncResolveAddressForHost: (OFString *)host port: (uint16_t)port block: (of_udp_socket_async_resolve_block_t)block; # endif #endif /*! * @brief Gets the host and port for the specified address. * - * @param host A pointer to an OFString*. If it is not NULL, it will be set to - * the host of the host / port pair. + * @param host A pointer to an @ref OFString *. If it is not NULL, it will be + * set to the host of the host / port pair. * @param port A pointer to an uint16_t. If it is not NULL, the port of the * host / port pair will be written to it. * @param address The address for which the host and port should be retrieved */ + (void)getHost: (OFString *__autoreleasing _Nonnull *_Nullable)host andPort: (uint16_t *_Nullable)port - forAddress: (of_udp_socket_address_t*)address; + forAddress: (of_udp_socket_address_t *)address; /*! * @brief Binds the socket to the specified host and port. * * @param host The host to bind to. Use `@"0.0.0.0"` for IPv4 or `@"::"` for @@ -169,11 +169,11 @@ * IPv6 to bind to all. * @param port The port to bind to. If the port is 0, an unused port will be * chosen, which can be obtained using the return value. * @return The port the socket was bound to */ -- (uint16_t)bindToHost: (OFString*)host +- (uint16_t)bindToHost: (OFString *)host port: (uint16_t)port; /*! * @brief Receives a datagram and stores it into the specified buffer. * @@ -183,13 +183,13 @@ * @param length The length of the buffer * @param sender A pointer to an @ref of_udp_socket_address_t, which will be * set to the address of the sender * @return The length of the received datagram */ -- (size_t)receiveIntoBuffer: (void*)buffer +- (size_t)receiveIntoBuffer: (void *)buffer length: (size_t)length - sender: (of_udp_socket_address_t*)sender; + sender: (of_udp_socket_address_t *)sender; /*! * @brief Asynchronously receives a datagram and stores it into the specified * buffer. * @@ -205,11 +205,11 @@ * need to return false from the method. * @param selector The selector to call on the target. The signature must be * `bool (OFUDPSocket *socket, void *buffer, size_t length, * of_udp_socket_address_t, OFException *exception)`. */ -- (void)asyncReceiveIntoBuffer: (void*)buffer +- (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector; #ifdef OF_HAVE_BLOCKS @@ -226,11 +226,11 @@ * buffer and maximum length when more datagrams have been * received. If you want the next method in the queue to handle * the datagram received next, you need to return false from the * method. */ -- (void)asyncReceiveIntoBuffer: (void*)buffer +- (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length block: (of_udp_socket_async_receive_block_t)block; #endif /*! @@ -239,13 +239,13 @@ * @param buffer The buffer to send as a datagram * @param length The length of the buffer * @param receiver A pointer to an @ref of_udp_socket_address_t to which the * datagram should be sent */ -- (void)sendBuffer: (const void*)buffer +- (void)sendBuffer: (const void *)buffer length: (size_t)length - receiver: (const of_udp_socket_address_t*)receiver; + receiver: (const of_udp_socket_address_t *)receiver; /*! * @brief Cancels all pending asynchronous requests on the socket. */ - (void)cancelAsyncRequests; Index: src/OFUDPSocket.m ================================================================== --- src/OFUDPSocket.m +++ src/OFUDPSocket.m @@ -54,26 +54,26 @@ # endif of_udp_socket_address_t _address; OFException *_exception; } -- initWithSourceThread: (OFThread*)sourceThread - host: (OFString*)host +- initWithSourceThread: (OFThread *)sourceThread + host: (OFString *)host port: (uint16_t)port target: (id)target selector: (SEL)selector; # ifdef OF_HAVE_BLOCKS -- initWithSourceThread: (OFThread*)sourceThread - host: (OFString*)host +- initWithSourceThread: (OFThread *)sourceThread + host: (OFString *)host port: (uint16_t)port block: (of_udp_socket_async_resolve_block_t)block; # endif @end @implementation OFUDPSocket_ResolveThread -- initWithSourceThread: (OFThread*)sourceThread - host: (OFString*)host +- initWithSourceThread: (OFThread *)sourceThread + host: (OFString *)host port: (uint16_t)port target: (id)target selector: (SEL)selector { self = [super init]; @@ -91,12 +91,12 @@ return self; } # ifdef OF_HAVE_BLOCKS -- initWithSourceThread: (OFThread*)sourceThread - host: (OFString*)host +- initWithSourceThread: (OFThread *)sourceThread + host: (OFString *)host port: (uint16_t)port block: (of_udp_socket_async_resolve_block_t)block { self = [super init]; @@ -134,14 +134,14 @@ # ifdef OF_HAVE_BLOCKS if (_block != NULL) _block(_host, _port, _address, _exception); else { # endif - void (*func)(id, SEL, OFString*, uint16_t, - of_udp_socket_address_t, OFException*) = - (void(*)(id, SEL, OFString*, uint16_t, - of_udp_socket_address_t, OFException*))[_target + void (*func)(id, SEL, OFString *, uint16_t, + of_udp_socket_address_t, OFException *) = + (void (*)(id, SEL, OFString *, uint16_t, + of_udp_socket_address_t, OFException *))[_target methodForSelector: _selector]; func(_target, _selector, _host, _port, _address, _exception); # ifdef OF_HAVE_BLOCKS } @@ -192,12 +192,12 @@ #else if (address1->length < 8 || address2->length < 8) @throw [OFInvalidArgumentException exception]; #endif - sin_1 = (struct sockaddr_in*)&address1->address; - sin_2 = (struct sockaddr_in*)&address2->address; + sin_1 = (struct sockaddr_in *)&address1->address; + sin_2 = (struct sockaddr_in *)&address2->address; if (sin_1->sin_port != sin_2->sin_port) return false; if (sin_1->sin_addr.s_addr != sin_2->sin_addr.s_addr) return false; @@ -207,12 +207,12 @@ case AF_INET6: if (address1->length < sizeof(struct sockaddr_in6) || address2->length < sizeof(struct sockaddr_in6)) @throw [OFInvalidArgumentException exception]; - sin6_1 = (struct sockaddr_in6*)&address1->address; - sin6_2 = (struct sockaddr_in6*)&address2->address; + sin6_1 = (struct sockaddr_in6 *)&address1->address; + sin6_2 = (struct sockaddr_in6 *)&address2->address; if (sin6_1->sin6_port != sin6_2->sin6_port) return false; if (memcmp(sin6_1->sin6_addr.s6_addr, sin6_2->sin6_addr.s6_addr, @@ -248,11 +248,11 @@ #else if (address->length < 8) @throw [OFInvalidArgumentException exception]; #endif - sin = (struct sockaddr_in*)&address->address; + sin = (struct sockaddr_in *)&address->address; hash += (sin->sin_port << 1); hash ^= sin->sin_addr.s_addr; break; @@ -259,11 +259,11 @@ #ifdef HAVE_IPV6 case AF_INET6: if (address->length < sizeof(struct sockaddr_in6)) @throw [OFInvalidArgumentException exception]; - sin6 = (struct sockaddr_in6*)&address->address; + sin6 = (struct sockaddr_in6 *)&address->address; hash += (sin6->sin6_port << 1); OF_HASH_INIT(subhash); @@ -297,13 +297,13 @@ + (instancetype)socket { return [[[self alloc] init] autorelease]; } -+ (void)resolveAddressForHost: (OFString*)host ++ (void)resolveAddressForHost: (OFString *)host port: (uint16_t)port - address: (of_udp_socket_address_t*)address + address: (of_udp_socket_address_t *)address { of_resolver_result_t **results = of_resolve_host(host, port, SOCK_DGRAM); assert(results[0]->addressLength <= @@ -315,11 +315,11 @@ of_resolver_free(results); } #ifdef OF_HAVE_THREADS -+ (void)asyncResolveAddressForHost: (OFString*)host ++ (void)asyncResolveAddressForHost: (OFString *)host port: (uint16_t)port target: (id)target selector: (SEL)selector { void *pool = objc_autoreleasePoolPush(); @@ -333,11 +333,11 @@ objc_autoreleasePoolPop(pool); } # ifdef OF_HAVE_BLOCKS -+ (void)asyncResolveAddressForHost: (OFString*)host ++ (void)asyncResolveAddressForHost: (OFString *)host port: (uint16_t)port block: (of_udp_socket_async_resolve_block_t)block { void *pool = objc_autoreleasePoolPush(); @@ -350,16 +350,16 @@ objc_autoreleasePoolPop(pool); } # endif #endif -+ (void)getHost: (OFString *__autoreleasing*)host - andPort: (uint16_t*)port - forAddress: (of_udp_socket_address_t*)address ++ (void)getHost: (OFString *__autoreleasing *)host + andPort: (uint16_t *)port + forAddress: (of_udp_socket_address_t *)address { of_address_to_string_and_port( - (struct sockaddr*)&address->address, address->length, host, port); + (struct sockaddr *)&address->address, address->length, host, port); } - init { self = [super init]; @@ -380,11 +380,11 @@ - copy { return [self retain]; } -- (uint16_t)bindToHost: (OFString*)host +- (uint16_t)bindToHost: (OFString *)host port: (uint16_t)port { of_resolver_result_t **results; #if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) union { @@ -442,17 +442,17 @@ while (rnd < 1024) rnd = (uint16_t)rand(); switch (results[0]->family) { case AF_INET: - ((struct sockaddr_in*) + ((struct sockaddr_in *) results[0]->address)->sin_port = OF_BSWAP16_IF_LE(rnd); break; # ifdef HAVE_IPV6 case AF_INET6: - ((struct sockaddr_in6*) + ((struct sockaddr_in6 *) results[0]->address)->sin6_port = OF_BSWAP16_IF_LE(rnd); break; # endif default: @@ -490,11 +490,11 @@ if (port > 0) return port; #if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) addrLen = (socklen_t)sizeof(addr.storage); - if (of_getsockname(_socket, (struct sockaddr*)&addr.storage, + if (of_getsockname(_socket, (struct sockaddr *)&addr.storage, &addrLen) != 0) { int errNo = of_socket_errno(); close(_socket); _socket = INVALID_SOCKET; @@ -519,13 +519,13 @@ port: port socket: self errNo: EAFNOSUPPORT]; } -- (size_t)receiveIntoBuffer: (void*)buffer +- (size_t)receiveIntoBuffer: (void *)buffer length: (size_t)length - sender: (of_udp_socket_address_t*)sender + sender: (of_udp_socket_address_t *)sender { ssize_t ret; if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; @@ -532,31 +532,31 @@ sender->length = (socklen_t)sizeof(sender->address); #ifndef OF_WINDOWS if ((ret = recvfrom(_socket, buffer, length, 0, - (struct sockaddr*)&sender->address, &sender->length)) < 0) + (struct sockaddr *)&sender->address, &sender->length)) < 0) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length errNo: of_socket_errno()]; #else if (length > INT_MAX) @throw [OFOutOfRangeException exception]; if ((ret = recvfrom(_socket, buffer, (int)length, 0, - (struct sockaddr*)&sender->address, &sender->length)) < 0) + (struct sockaddr *)&sender->address, &sender->length)) < 0) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length errNo: of_socket_errno()]; #endif return ret; } -- (void)asyncReceiveIntoBuffer: (void*)buffer +- (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector { [OFRunLoop OF_addAsyncReceiveForUDPSocket: self @@ -565,11 +565,11 @@ target: target selector: selector]; } #ifdef OF_HAVE_BLOCKS -- (void)asyncReceiveIntoBuffer: (void*)buffer +- (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length block: (of_udp_socket_async_receive_block_t)block { [OFRunLoop OF_addAsyncReceiveForUDPSocket: self buffer: buffer @@ -576,23 +576,23 @@ length: length block: block]; } #endif -- (void)sendBuffer: (const void*)buffer +- (void)sendBuffer: (const void *)buffer length: (size_t)length - receiver: (const of_udp_socket_address_t*)receiver + receiver: (const of_udp_socket_address_t *)receiver { if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; #ifndef OF_WINDOWS if (length > SSIZE_MAX) @throw [OFOutOfRangeException exception]; if (sendto(_socket, buffer, length, 0, - (struct sockaddr*)&receiver->address, + (struct sockaddr *)&receiver->address, receiver->length) != (ssize_t)length) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length errNo: of_socket_errno()]; @@ -599,11 +599,11 @@ #else if (length > INT_MAX) @throw [OFOutOfRangeException exception]; if (sendto(_socket, buffer, (int)length, 0, - (struct sockaddr*)&receiver->address, + (struct sockaddr *)&receiver->address, receiver->length) != (int)length) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length errNo: of_socket_errno()]; Index: src/OFURL.h ================================================================== --- src/OFURL.h +++ src/OFURL.h @@ -89,54 +89,54 @@ * @brief Creates a new URL with the specified string. * * @param string A string describing a URL * @return A new, autoreleased OFURL */ -+ (instancetype)URLWithString: (OFString*)string; ++ (instancetype)URLWithString: (OFString *)string; /*! * @brief 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 */ -+ (instancetype)URLWithString: (OFString*)string - relativeToURL: (OFURL*)URL; ++ (instancetype)URLWithString: (OFString *)string + relativeToURL: (OFURL *)URL; /*! * @brief Creates a new URL with the specified local file path. * * @param path The local file path * @return A new, autoreleased OFURL */ -+ (instancetype)fileURLWithPath: (OFString*)path; ++ (instancetype)fileURLWithPath: (OFString *)path; /*! * @brief Initializes an already allocated OFURL with the specified string. * * @param string A string describing a URL * @return An initialized OFURL */ -- initWithString: (OFString*)string; +- initWithString: (OFString *)string; /*! * @brief Initializes an already allocated OFURL with the specified string and * relative URL. * * @param string A string describing a URL * @param URL A URL to which the string is relative * @return An initialized OFURL */ -- initWithString: (OFString*)string - relativeToURL: (OFURL*)URL; +- initWithString: (OFString *)string + relativeToURL: (OFURL *)URL; /*! * @brief Returns the URL as a string. * * @return The URL as a string */ -- (OFString*)string; +- (OFString *)string; @end OF_ASSUME_NONNULL_END Index: src/OFURL.m ================================================================== --- src/OFURL.m +++ src/OFURL.m @@ -36,23 +36,23 @@ + (instancetype)URL { return [[[self alloc] init] autorelease]; } -+ (instancetype)URLWithString: (OFString*)string ++ (instancetype)URLWithString: (OFString *)string { return [[[self alloc] initWithString: string] autorelease]; } -+ (instancetype)URLWithString: (OFString*)string - relativeToURL: (OFURL*)URL ++ (instancetype)URLWithString: (OFString *)string + relativeToURL: (OFURL *)URL { return [[[self alloc] initWithString: string relativeToURL: URL] autorelease]; } -+ (instancetype)fileURLWithPath: (OFString*)path ++ (instancetype)fileURLWithPath: (OFString *)path { OFURL *URL = [OFURL URL]; void *pool = objc_autoreleasePoolPush(); [URL setScheme: @"file"]; @@ -61,11 +61,11 @@ objc_autoreleasePoolPop(pool); return URL; } -- initWithString: (OFString*)string +- initWithString: (OFString *)string { char *UTF8String, *UTF8String2 = NULL; self = [super init]; @@ -195,12 +195,12 @@ } return self; } -- initWithString: (OFString*)string - relativeToURL: (OFURL*)URL +- initWithString: (OFString *)string + relativeToURL: (OFURL *)URL { char *UTF8String, *UTF8String2 = NULL; if ([string containsString: @"://"]) return [self initWithString: string]; @@ -269,11 +269,11 @@ } return self; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { @try { void *pool = objc_autoreleasePoolPush(); if (![[element name] isEqual: [self className]] || @@ -382,11 +382,11 @@ } return copy; } -- (OFString*)string +- (OFString *)string { OFMutableString *ret = [OFMutableString string]; void *pool = objc_autoreleasePoolPush(); [ret appendFormat: @"%@://", _scheme]; @@ -433,17 +433,17 @@ [ret makeImmutable]; return ret; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"<%@: %@>", [self class], [self string]]; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; element = [OFXMLElement elementWithName: [self className] Index: src/OFXMLAttribute.h ================================================================== --- src/OFXMLAttribute.h +++ src/OFXMLAttribute.h @@ -51,44 +51,44 @@ * * @param name The name of the attribute * @param stringValue The string value of the attribute * @return A new autoreleased OFXMLAttribute with the specified parameters */ -+ (instancetype)attributeWithName: (OFString*)name - stringValue: (OFString*)stringValue; ++ (instancetype)attributeWithName: (OFString *)name + stringValue: (OFString *)stringValue; /*! * @brief Creates a new XML attribute. * * @param name The name of the attribute * @param namespace_ The namespace of the attribute * @param stringValue The string value of the attribute * @return A new autoreleased OFXMLAttribute with the specified parameters */ -+ (instancetype)attributeWithName: (OFString*)name - namespace: (nullable OFString*)namespace_ - stringValue: (OFString*)stringValue; ++ (instancetype)attributeWithName: (OFString *)name + namespace: (nullable OFString *)namespace_ + stringValue: (OFString *)stringValue; /*! * @brief Initializes an already allocated OFXMLAttribute. * * @param name The name of the attribute * @param stringValue The string value of the attribute * @return An initialized OFXMLAttribute with the specified parameters */ -- initWithName: (OFString*)name - stringValue: (OFString*)stringValue; +- initWithName: (OFString *)name + stringValue: (OFString *)stringValue; /*! * @brief Initializes an already allocated OFXMLAttribute. * * @param name The name of the attribute * @param namespace_ The namespace of the attribute * @param stringValue The string value of the attribute * @return An initialized OFXMLAttribute with the specified parameters */ -- initWithName: (OFString*)name - namespace: (nullable OFString*)namespace_ - stringValue: (OFString*)stringValue; +- initWithName: (OFString *)name + namespace: (nullable OFString *)namespace_ + stringValue: (OFString *)stringValue; @end OF_ASSUME_NONNULL_END Index: src/OFXMLAttribute.m ================================================================== --- src/OFXMLAttribute.m +++ src/OFXMLAttribute.m @@ -24,37 +24,37 @@ #import "OFInvalidArgumentException.h" @implementation OFXMLAttribute @synthesize name = _name, namespace = _namespace; -+ (instancetype)attributeWithName: (OFString*)name - namespace: (OFString*)namespace - stringValue: (OFString*)stringValue ++ (instancetype)attributeWithName: (OFString *)name + namespace: (OFString *)namespace + stringValue: (OFString *)stringValue { return [[[self alloc] initWithName: name namespace: namespace stringValue: stringValue] autorelease]; } -+ (instancetype)attributeWithName: (OFString*)name - stringValue: (OFString*)stringValue ++ (instancetype)attributeWithName: (OFString *)name + stringValue: (OFString *)stringValue { return [[[self alloc] initWithName: name stringValue: stringValue] autorelease]; } -- initWithName: (OFString*)name - stringValue: (OFString*)stringValue +- initWithName: (OFString *)name + stringValue: (OFString *)stringValue { return [self initWithName: name namespace: nil stringValue: stringValue]; } -- initWithName: (OFString*)name - namespace: (OFString*)namespace - stringValue: (OFString*)stringValue +- initWithName: (OFString *)name + namespace: (OFString *)namespace + stringValue: (OFString *)stringValue { self = [super init]; @try { _name = [name copy]; @@ -66,11 +66,11 @@ } return self; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); @@ -102,16 +102,16 @@ [_stringValue release]; [super dealloc]; } -- (OFString*)stringValue +- (OFString *)stringValue { return [[_stringValue copy] autorelease]; } -- (void)setStringValue: (OFString*)stringValue +- (void)setStringValue: (OFString *)stringValue { OFString *old = _stringValue; _stringValue = [stringValue copy]; [old release]; } @@ -149,11 +149,11 @@ OF_HASH_FINALIZE(hash); return hash; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; element = [OFXMLElement elementWithName: [self className] @@ -174,12 +174,12 @@ objc_autoreleasePoolPop(pool); return [element autorelease]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"", _name, _namespace, _stringValue]; } @end Index: src/OFXMLCDATA.h ================================================================== --- src/OFXMLCDATA.h +++ src/OFXMLCDATA.h @@ -32,17 +32,17 @@ * @brief Creates a new OFXMLCDATA with the specified string. * * @param string The string value for the CDATA * @return A new OFXMLCDATA */ -+ (instancetype)CDATAWithString: (OFString*)string; ++ (instancetype)CDATAWithString: (OFString *)string; /*! * @brief Initializes an already allocated OFXMLCDATA with the specified string. * * @param string The string value for the CDATA * @return An initialized OFXMLCDATA */ -- initWithString: (OFString*)string; +- initWithString: (OFString *)string; @end OF_ASSUME_NONNULL_END Index: src/OFXMLCDATA.m ================================================================== --- src/OFXMLCDATA.m +++ src/OFXMLCDATA.m @@ -21,16 +21,16 @@ #import "OFXMLElement.h" #import "OFInvalidArgumentException.h" @implementation OFXMLCDATA -+ (instancetype)CDATAWithString: (OFString*)string ++ (instancetype)CDATAWithString: (OFString *)string { return [[[self alloc] initWithString: string] autorelease]; } -- initWithString: (OFString*)string +- initWithString: (OFString *)string { self = [super init]; @try { _CDATA = [string copy]; @@ -40,11 +40,11 @@ } return self; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); @@ -86,23 +86,23 @@ - (uint32_t)hash { return [_CDATA hash]; } -- (OFString*)stringValue +- (OFString *)stringValue { return [[_CDATA copy] autorelease]; } -- (void)setStringValue: (OFString*)stringValue +- (void)setStringValue: (OFString *)stringValue { OFString *old = _CDATA; _CDATA = [stringValue copy]; [old release]; } -- (OFString*)XMLString +- (OFString *)XMLString { void *pool = objc_autoreleasePoolPush(); OFString *tmp = [_CDATA stringByReplacingOccurrencesOfString: @"]]>" withString: @"]]>]]>", _comment]; } -- (OFString*)XMLStringWithIndentation: (unsigned int)indentation +- (OFString *)XMLStringWithIndentation: (unsigned int)indentation { return [OFString stringWithFormat: @"", _comment]; } -- (OFString*)XMLStringWithIndentation: (unsigned int)indentation - level: (unsigned int)level +- (OFString *)XMLStringWithIndentation: (unsigned int)indentation + level: (unsigned int)level { OFString *ret; if (indentation > 0 && level > 0) { char *whitespaces = [self allocMemoryWithSize: @@ -127,17 +127,17 @@ ret = [OFString stringWithFormat: @"", _comment]; return ret; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"", _comment]; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { return [OFXMLElement elementWithName: [self className] namespace: OF_SERIALIZATION_NS stringValue: _comment]; } @end Index: src/OFXMLElement.h ================================================================== --- src/OFXMLElement.h +++ src/OFXMLElement.h @@ -33,13 +33,13 @@ * @brief A class which stores an XML element. */ @interface OFXMLElement: OFXMLNode { OFString *_name, *_namespace, *_defaultNamespace; - OFMutableArray OF_GENERIC(OFXMLAttribute*) *_attributes; - OFMutableDictionary OF_GENERIC(OFString*, OFString*) *_namespaces; - OFMutableArray OF_GENERIC(OFXMLNode*) *_children; + OFMutableArray OF_GENERIC(OFXMLAttribute *) *_attributes; + OFMutableDictionary OF_GENERIC(OFString *, OFString *) *_namespaces; + OFMutableArray OF_GENERIC(OFXMLNode *) *_children; } /*! * The name of the element. */ @@ -64,33 +64,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 */ -+ (instancetype)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 */ -+ (instancetype)elementWithName: (OFString*)name - stringValue: (nullable OFString*)stringValue; ++ (instancetype)elementWithName: (OFString *)name + stringValue: (nullable OFString *)stringValue; /*! * @brief Creates a new XML element with the specified name and namespace. * * @param name The name for the element * @param namespace_ The namespace for the element * @return A new autoreleased OFXMLElement with the specified element name and * namespace */ -+ (instancetype)elementWithName: (OFString*)name - namespace: (nullable OFString*)namespace_; ++ (instancetype)elementWithName: (OFString *)name + namespace: (nullable OFString *)namespace_; /*! * @brief Creates a new XML element with the specified name, namespace and * string value. * @@ -98,49 +98,49 @@ * @param namespace_ 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 */ -+ (instancetype)elementWithName: (OFString*)name - namespace: (nullable OFString*)namespace_ - stringValue: (nullable OFString*)stringValue; ++ (instancetype)elementWithName: (OFString *)name + namespace: (nullable OFString *)namespace_ + stringValue: (nullable 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 */ -+ (instancetype)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 */ -+ (instancetype)elementWithXMLString: (OFString*)string; ++ (instancetype)elementWithXMLString: (OFString *)string; #ifdef OF_HAVE_FILES /*! * @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 */ -+ (instancetype)elementWithFile: (OFString*)path; ++ (instancetype)elementWithFile: (OFString *)path; #endif /*! * @brief Initializes an already allocated OFXMLElement with the specified name. * * @param name The name for the element * @return An initialized OFXMLElement with the specified element name */ -- initWithName: (OFString*)name; +- initWithName: (OFString *)name; /*! * @brief Initializes an already allocated OFXMLElement with the specified name * and string value. * @@ -147,12 +147,12 @@ * @param name The name for the element * @param stringValue The value for the element * @return An initialized OFXMLElement with the specified element name and * value */ -- initWithName: (OFString*)name - stringValue: (nullable OFString*)stringValue; +- initWithName: (OFString *)name + stringValue: (nullable OFString *)stringValue; /*! * @brief Initializes an already allocated OFXMLElement with the specified name * and namespace. * @@ -159,12 +159,12 @@ * @param name The name for the element * @param namespace_ The namespace for the element * @return An initialized OFXMLElement with the specified element name and * namespace */ -- initWithName: (OFString*)name - namespace: (nullable OFString*)namespace_; +- initWithName: (OFString *)name + namespace: (nullable OFString *)namespace_; /*! * @brief Initializes an already allocated OFXMLElement with the specified name, * namespace and value. * @@ -172,78 +172,78 @@ * @param namespace_ The namespace for the element * @param stringValue The value for the element * @return An initialized OFXMLElement with the specified element name, * namespace and value */ -- initWithName: (OFString*)name - namespace: (nullable OFString*)namespace_ - stringValue: (nullable OFString*)stringValue; +- initWithName: (OFString *)name + namespace: (nullable OFString *)namespace_ + stringValue: (nullable OFString *)stringValue; /*! * @brief Initializes an already allocated OFXMLElement 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 */ -- initWithElement: (OFXMLElement*)element; +- initWithElement: (OFXMLElement *)element; /*! * @brief Parses the string and initializes an already allocated OFXMLElement * with it. * * @param string The string to parse * @return An initialized OFXMLElement with the contents of the string */ -- initWithXMLString: (OFString*)string; +- initWithXMLString: (OFString *)string; #ifdef OF_HAVE_FILES /*! * @brief Parses the specified file and initializes an already allocated * OFXMLElement with it. * * @param path The path to the file * @return An initialized OFXMLElement with the contents of the specified file */ -- initWithFile: (OFString*)path; +- initWithFile: (OFString *)path; #endif /*! * @brief Sets a prefix for a namespace. * * @param prefix The prefix for the namespace * @param namespace_ The namespace for which the prefix is set */ -- (void)setPrefix: (OFString*)prefix - forNamespace: (OFString*)namespace_; +- (void)setPrefix: (OFString *)prefix + forNamespace: (OFString *)namespace_; /*! * @brief Binds a prefix for a namespace. * * @param prefix The prefix for the namespace * @param namespace_ The namespace for which the prefix is bound */ -- (void)bindPrefix: (OFString*)prefix - forNamespace: (OFString*)namespace_; +- (void)bindPrefix: (OFString *)prefix + forNamespace: (OFString *)namespace_; /*! * @brief Returns an OFArray with the attributes of the element. * * @return An OFArray with the attributes of the element */ -- (nullable OFArray OF_GENERIC(OFXMLAttribute*)*)attributes; +- (nullable OFArray OF_GENERIC(OFXMLAttribute *) *)attributes; /*! * @brief Adds the specified attribute. * * If an attribute with the same name and namespace already exists, it is not * added. * * @param attribute The attribute to add */ -- (void)addAttribute: (OFXMLAttribute*)attribute; +- (void)addAttribute: (OFXMLAttribute *)attribute; /*! * @brief Adds the specified attribute with the specified string value. * * If an attribute with the same name and namespace already exists, it is not @@ -250,12 +250,12 @@ * added. * * @param name The name of the attribute * @param stringValue The value of the attribute */ -- (void)addAttributeWithName: (OFString*)name - stringValue: (OFString*)stringValue; +- (void)addAttributeWithName: (OFString *)name + stringValue: (OFString *)stringValue; /*! * @brief Adds the specified attribute with the specified namespace and string * value. * @@ -264,93 +264,93 @@ * * @param name The name of the attribute * @param namespace_ The namespace of the attribute * @param stringValue The value of the attribute */ -- (void)addAttributeWithName: (OFString*)name - namespace: (nullable OFString*)namespace_ - stringValue: (OFString*)stringValue; +- (void)addAttributeWithName: (OFString *)name + namespace: (nullable OFString *)namespace_ + stringValue: (OFString *)stringValue; /*! * @brief Returns the attribute with the specified name. * * @param attributeName The name of the attribute * @return The attribute with the specified name */ -- (OFXMLAttribute*)attributeForName: (OFString*)attributeName; +- (OFXMLAttribute *)attributeForName: (OFString *)attributeName; /*! * @brief Returns the attribute with the specified name and namespace. * * @param attributeName The name of the attribute * @param attributeNS The namespace of the attribute * @return The attribute with the specified name and namespace */ -- (OFXMLAttribute*)attributeForName: (OFString*)attributeName - namespace: (nullable OFString*)attributeNS; +- (OFXMLAttribute *)attributeForName: (OFString *)attributeName + namespace: (nullable OFString *)attributeNS; /*! * @brief Removes the attribute with the specified name. * * @param attributeName The name of the attribute */ -- (void)removeAttributeForName: (OFString*)attributeName; +- (void)removeAttributeForName: (OFString *)attributeName; /*! * @brief Removes the attribute with the specified name and namespace. * * @param attributeName The name of the attribute * @param attributeNS The namespace of the attribute */ -- (void)removeAttributeForName: (OFString*)attributeName - namespace: (nullable OFString*)attributeNS; +- (void)removeAttributeForName: (OFString *)attributeName + namespace: (nullable OFString *)attributeNS; /*! * @brief Removes all children and adds the children from the specified array. * * @param children The new children to add */ -- (void)setChildren: (nullable OFArray OF_GENERIC(OFXMLNode*)*)children; +- (void)setChildren: (nullable OFArray OF_GENERIC(OFXMLNode *) *)children; /*! * @brief Returns an array of OFXMLNodes with all children of the element. * * @return An array of OFXMLNodes with all children of the element */ -- (nullable OFArray OF_GENERIC(OFXMLNode*)*)children; +- (nullable OFArray OF_GENERIC(OFXMLNode *) *)children; /*! * @brief Adds a child to the OFXMLElement. * * @param child An OFXMLNode which is added as a child */ -- (void)addChild: (OFXMLNode*)child; +- (void)addChild: (OFXMLNode *)child; /*! * @brief Inserts a child at the specified index. * * @param child An OFXMLNode which is added as a child * @param index The index where the child is added */ -- (void)insertChild: (OFXMLNode*)child +- (void)insertChild: (OFXMLNode *)child atIndex: (size_t)index; /*! * @brief Inserts the specified children at the specified index. * * @param children An array of OFXMLNodes which are added as children * @param index The index where the child is added */ -- (void)insertChildren: (OFArray OF_GENERIC(OFXMLNode*)*)children +- (void)insertChildren: (OFArray OF_GENERIC(OFXMLNode *) *)children atIndex: (size_t)index; /*! * @brief Removes the first child that is equal to the specified OFXMLNode. * * @param child The child to remove from the OFXMLElement */ -- (void)removeChild: (OFXMLNode*)child; +- (void)removeChild: (OFXMLNode *)child; /*! * @brief Removes the child at the specified index. * * @param index The index of the child to remove @@ -362,73 +362,74 @@ * with the specified node. * * @param child The child to replace * @param node The node to replace the child with */ -- (void)replaceChild: (OFXMLNode*)child - withNode: (OFXMLNode*)node; +- (void)replaceChild: (OFXMLNode *)child + withNode: (OFXMLNode *)node; /*! * @brief Replaces the child at the specified index with the specified node. * * @param index The index of the child to replace * @param node The node to replace the child with */ - (void)replaceChildAtIndex: (size_t)index - withNode: (OFXMLNode*)node; + withNode: (OFXMLNode *)node; /*! * @brief Returns all children that are elements. * * @return All children that are elements */ -- (OFArray OF_GENERIC(OFXMLElement*)*)elements; +- (OFArray OF_GENERIC(OFXMLElement *) *)elements; /*! * @brief Returns all children that have the specified namespace. * * @return All children that have the specified namespace */ -- (OFArray OF_GENERIC(OFXMLElement*)*)elementsForNamespace: - (nullable OFString*)elementNS; +- (OFArray OF_GENERIC(OFXMLElement *) *)elementsForNamespace: + (nullable OFString *)elementNS; /*! * @brief Returns the first child element with the specified name. * * @param elementName The name of the element * @return The first child element with the specified name */ -- (OFXMLElement*)elementForName: (OFString*)elementName; +- (OFXMLElement *)elementForName: (OFString *)elementName; /*! * @brief Returns the child elements with the specified name. * * @param elementName The name of the elements * @return The child elements with the specified name */ -- (OFArray OF_GENERIC(OFXMLElement*)*)elementsForName: (OFString*)elementName; +- (OFArray OF_GENERIC(OFXMLElement *) *)elementsForName: + (OFString *)elementName; /*! * @brief Returns the first child element with the specified name and namespace. * * @param elementName The name of the element * @param elementNS The namespace of the element * @return The first child element with the specified name and namespace */ -- (OFXMLElement*)elementForName: (OFString*)elementName - namespace: (nullable OFString*)elementNS; +- (OFXMLElement *)elementForName: (OFString *)elementName + namespace: (nullable OFString *)elementNS; /*! * @brief Returns the child elements with the specified name and namespace. * * @param elementName The name of the elements * @param elementNS The namespace of the elements * @return The child elements with the specified name and namespace */ -- (OFArray OF_GENERIC(OFXMLElement*)*) - elementsForName: (OFString*)elementName - namespace: (nullable OFString*)elementNS; +- (OFArray OF_GENERIC(OFXMLElement *) *) + elementsForName: (OFString *)elementName + namespace: (nullable OFString *)elementNS; @end OF_ASSUME_NONNULL_END #import "OFXMLElement+Serialization.h" Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -54,12 +54,12 @@ OFXMLElement *_element; } @end @implementation OFXMLElement_OFXMLElementBuilderDelegate -- (void)elementBuilder: (OFXMLElementBuilder*)builder - didBuildElement: (OFXMLElement*)element +- (void)elementBuilder: (OFXMLElementBuilder *)builder + didBuildElement: (OFXMLElement *)element { if (_element == nil) _element = [element retain]; } @@ -81,50 +81,50 @@ charactersClass = [OFXMLCharacters class]; CDATAClass = [OFXMLCDATA class]; } } -+ (instancetype)elementWithName: (OFString*)name ++ (instancetype)elementWithName: (OFString *)name { return [[[self alloc] initWithName: name] autorelease]; } -+ (instancetype)elementWithName: (OFString*)name - stringValue: (OFString*)stringValue ++ (instancetype)elementWithName: (OFString *)name + stringValue: (OFString *)stringValue { return [[[self alloc] initWithName: name stringValue: stringValue] autorelease]; } -+ (instancetype)elementWithName: (OFString*)name - namespace: (OFString*)ns ++ (instancetype)elementWithName: (OFString *)name + namespace: (OFString *)ns { return [[[self alloc] initWithName: name namespace: ns] autorelease]; } -+ (instancetype)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]; } -+ (instancetype)elementWithElement: (OFXMLElement*)element ++ (instancetype)elementWithElement: (OFXMLElement *)element { return [[[self alloc] initWithElement: element] autorelease]; } -+ (instancetype)elementWithXMLString: (OFString*)string ++ (instancetype)elementWithXMLString: (OFString *)string { return [[[self alloc] initWithXMLString: string] autorelease]; } #ifdef OF_HAVE_FILES -+ (instancetype)elementWithFile: (OFString*)path ++ (instancetype)elementWithFile: (OFString *)path { return [[[self alloc] initWithFile: path] autorelease]; } #endif @@ -131,36 +131,36 @@ - init { OF_INVALID_INIT_METHOD } -- initWithName: (OFString*)name +- initWithName: (OFString *)name { return [self initWithName: name namespace: nil stringValue: nil]; } -- initWithName: (OFString*)name - stringValue: (OFString*)stringValue +- initWithName: (OFString *)name + stringValue: (OFString *)stringValue { return [self initWithName: name namespace: nil stringValue: stringValue]; } -- initWithName: (OFString*)name - namespace: (OFString*)namespace +- initWithName: (OFString *)name + namespace: (OFString *)namespace { return [self initWithName: name namespace: namespace stringValue: nil]; } -- initWithName: (OFString*)name - namespace: (OFString*)namespace - stringValue: (OFString*)stringValue +- initWithName: (OFString *)name + namespace: (OFString *)namespace + stringValue: (OFString *)stringValue { self = [super init]; @try { if (name == nil) @@ -182,11 +182,11 @@ } return self; } -- initWithElement: (OFXMLElement*)element +- initWithElement: (OFXMLElement *)element { self = [super init]; @try { if (element == nil) @@ -204,11 +204,11 @@ } return self; } -- initWithXMLString: (OFString*)string +- initWithXMLString: (OFString *)string { void *pool; OFXMLParser *parser; OFXMLElementBuilder *builder; OFXMLElement_OFXMLElementBuilderDelegate *delegate; @@ -239,11 +239,11 @@ return self; } #ifdef OF_HAVE_FILES -- initWithFile: (OFString*)path +- initWithFile: (OFString *)path { void *pool; OFXMLParser *parser; OFXMLElementBuilder *builder; OFXMLElement_OFXMLElementBuilderDelegate *delegate; @@ -271,11 +271,11 @@ return self; } #endif -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); @@ -370,38 +370,38 @@ [_children release]; [super dealloc]; } -- (OFArray*)attributes +- (OFArray *)attributes { return [[_attributes copy] autorelease]; } -- (void)setChildren: (OFArray*)children +- (void)setChildren: (OFArray *)children { OFArray *old = _children; _children = [children copy]; [old release]; } -- (OFArray*)children +- (OFArray *)children { return [[_children copy] autorelease]; } -- (void)setStringValue: (OFString*)stringValue +- (void)setStringValue: (OFString *)stringValue { void *pool = objc_autoreleasePoolPush(); [self setChildren: [OFArray arrayWithObject: [OFXMLCharacters charactersWithString: stringValue]]]; objc_autoreleasePoolPop(pool); } -- (OFString*)stringValue +- (OFString *)stringValue { OFMutableString *ret; if ([_children count] == 0) return @""; @@ -419,14 +419,14 @@ [ret makeImmutable]; return ret; } -- (OFString*)OF_XMLStringWithParent: (OFXMLElement*)parent - namespaces: (OFDictionary*)allNamespaces - indentation: (unsigned int)indentation - level: (unsigned int)level +- (OFString *)OF_XMLStringWithParent: (OFXMLElement *)parent + namespaces: (OFDictionary *)allNamespaces + indentation: (unsigned int)indentation + level: (unsigned int)level { void *pool; char *cString; size_t length, i; OFString *prefix, *parentPrefix; @@ -435,11 +435,11 @@ pool = objc_autoreleasePoolPush(); parentPrefix = [allNamespaces objectForKey: (parent != nil && parent->_namespace != nil - ? parent->_namespace : (OFString*)@"")]; + ? parent->_namespace : (OFString *)@"")]; /* Add the namespaces of the current element */ if (allNamespaces != nil) { OFEnumerator *keyEnumerator = [_namespaces keyEnumerator]; OFEnumerator *objectEnumerator = [_namespaces objectEnumerator]; @@ -456,11 +456,11 @@ allNamespaces = tmp; } else allNamespaces = _namespaces; prefix = [allNamespaces objectForKey: - (_namespace != nil ? _namespace : (OFString*)@"")]; + (_namespace != nil ? _namespace : (OFString *)@"")]; if (parent != nil && parent->_namespace != nil && parentPrefix == nil) defaultNS = parent->_namespace; else if (parent != nil && parent->_defaultNamespace != nil) defaultNS = parent->_defaultNamespace; @@ -587,11 +587,11 @@ if (ind) [tmp addItem: "\n"]; if ([child isKindOfClass: [OFXMLElement class]]) - childString = [(OFXMLElement*)child + childString = [(OFXMLElement *)child OF_XMLStringWithParent: self namespaces: allNamespaces indentation: ind level: level + 1]; else @@ -661,36 +661,36 @@ [self freeMemory: cString]; } return ret; } -- (OFString*)XMLString +- (OFString *)XMLString { return [self OF_XMLStringWithParent: nil namespaces: nil indentation: 0 level: 0]; } -- (OFString*)XMLStringWithIndentation: (unsigned int)indentation +- (OFString *)XMLStringWithIndentation: (unsigned int)indentation { return [self OF_XMLStringWithParent: nil namespaces: nil indentation: indentation level: 0]; } -- (OFString*)XMLStringWithIndentation: (unsigned int)indentation - level: (unsigned int)level +- (OFString *)XMLStringWithIndentation: (unsigned int)indentation + level: (unsigned int)level { return [self OF_XMLStringWithParent: nil namespaces: nil indentation: indentation level: level]; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; element = [OFXMLElement elementWithName: [self className] @@ -754,31 +754,31 @@ objc_autoreleasePoolPop(pool); return [element autorelease]; } -- (void)addAttribute: (OFXMLAttribute*)attribute +- (void)addAttribute: (OFXMLAttribute *)attribute { if (_attributes == nil) _attributes = [[OFMutableArray alloc] init]; if ([self attributeForName: attribute->_name namespace: attribute->_namespace] == nil) [_attributes addObject: attribute]; } -- (void)addAttributeWithName: (OFString*)name - stringValue: (OFString*)stringValue +- (void)addAttributeWithName: (OFString *)name + stringValue: (OFString *)stringValue { [self addAttributeWithName: name namespace: nil stringValue: stringValue]; } -- (void)addAttributeWithName: (OFString*)name - namespace: (OFString*)namespace - stringValue: (OFString*)stringValue +- (void)addAttributeWithName: (OFString *)name + namespace: (OFString *)namespace + stringValue: (OFString *)stringValue { void *pool = objc_autoreleasePoolPush(); [self addAttribute: [OFXMLAttribute attributeWithName: name namespace: namespace @@ -785,22 +785,22 @@ stringValue: stringValue]]; objc_autoreleasePoolPop(pool); } -- (OFXMLAttribute*)attributeForName: (OFString*)attributeName +- (OFXMLAttribute *)attributeForName: (OFString *)attributeName { for (OFXMLAttribute *attribute in _attributes) if (attribute->_namespace == nil && [attribute->_name isEqual: attributeName]) return [[attribute retain] autorelease]; return nil; } -- (OFXMLAttribute*)attributeForName: (OFString*)attributeName - namespace: (OFString*)attributeNS +- (OFXMLAttribute *)attributeForName: (OFString *)attributeName + namespace: (OFString *)attributeNS { if (attributeNS == nil) return [self attributeForName: attributeName]; for (OFXMLAttribute *attribute in _attributes) @@ -809,11 +809,11 @@ return [[attribute retain] autorelease]; return nil; } -- (void)removeAttributeForName: (OFString*)attributeName +- (void)removeAttributeForName: (OFString *)attributeName { OFXMLAttribute *const *objects = [_attributes objects]; size_t count = [_attributes count]; for (size_t i = 0; i < count; i++) { @@ -824,12 +824,12 @@ return; } } } -- (void)removeAttributeForName: (OFString*)attributeName - namespace: (OFString*)attributeNS +- (void)removeAttributeForName: (OFString *)attributeName + namespace: (OFString *)attributeNS { OFXMLAttribute *const *objects; size_t count; if (attributeNS == nil) { @@ -847,12 +847,12 @@ return; } } } -- (void)setPrefix: (OFString*)prefix - forNamespace: (OFString*)namespace +- (void)setPrefix: (OFString *)prefix + forNamespace: (OFString *)namespace { if ([prefix length] == 0) @throw [OFInvalidArgumentException exception]; if (namespace == nil) namespace = @""; @@ -859,21 +859,21 @@ [_namespaces setObject: prefix forKey: namespace]; } -- (void)bindPrefix: (OFString*)prefix - forNamespace: (OFString*)namespace +- (void)bindPrefix: (OFString *)prefix + forNamespace: (OFString *)namespace { [self setPrefix: prefix forNamespace: namespace]; [self addAttributeWithName: prefix namespace: @"http://www.w3.org/2000/xmlns/" stringValue: namespace]; } -- (void)addChild: (OFXMLNode*)child +- (void)addChild: (OFXMLNode *)child { if ([child isKindOfClass: [OFXMLAttribute class]]) @throw [OFInvalidArgumentException exception]; if (_children == nil) @@ -880,11 +880,11 @@ _children = [[OFMutableArray alloc] init]; [_children addObject: child]; } -- (void)insertChild: (OFXMLNode*)child +- (void)insertChild: (OFXMLNode *)child atIndex: (size_t)index { if ([child isKindOfClass: [OFXMLAttribute class]]) @throw [OFInvalidArgumentException exception]; @@ -893,11 +893,11 @@ [_children insertObject: child atIndex: index]; } -- (void)insertChildren: (OFArray*)children +- (void)insertChildren: (OFArray *)children atIndex: (size_t)index { for (OFXMLNode *node in children) if ([node isKindOfClass: [OFXMLAttribute class]]) @throw [OFInvalidArgumentException exception]; @@ -904,11 +904,11 @@ [_children insertObjectsFromArray: children atIndex: index]; } -- (void)removeChild: (OFXMLNode*)child +- (void)removeChild: (OFXMLNode *)child { if ([child isKindOfClass: [OFXMLAttribute class]]) @throw [OFInvalidArgumentException exception]; [_children removeObject: child]; @@ -917,12 +917,12 @@ - (void)removeChildAtIndex: (size_t)index { [_children removeObjectAtIndex: index]; } -- (void)replaceChild: (OFXMLNode*)child - withNode: (OFXMLNode*)node +- (void)replaceChild: (OFXMLNode *)child + withNode: (OFXMLNode *)node { if ([node isKindOfClass: [OFXMLAttribute class]] || [child isKindOfClass: [OFXMLAttribute class]]) @throw [OFInvalidArgumentException exception]; @@ -929,51 +929,51 @@ [_children replaceObject: child withObject: node]; } - (void)replaceChildAtIndex: (size_t)index - withNode: (OFXMLNode*)node + withNode: (OFXMLNode *)node { if ([node isKindOfClass: [OFXMLAttribute class]]) @throw [OFInvalidArgumentException exception]; [_children replaceObjectAtIndex: index withObject: node]; } -- (OFXMLElement*)elementForName: (OFString*)elementName +- (OFXMLElement *)elementForName: (OFString *)elementName { return [[self elementsForName: elementName] firstObject]; } -- (OFXMLElement*)elementForName: (OFString*)elementName - namespace: (OFString*)elementNS +- (OFXMLElement *)elementForName: (OFString *)elementName + namespace: (OFString *)elementNS { return [[self elementsForName: elementName namespace: elementNS] firstObject]; } -- (OFArray*)elements +- (OFArray *)elements { - OFMutableArray OF_GENERIC(OFXMLElement*) *ret = [OFMutableArray array]; + OFMutableArray OF_GENERIC(OFXMLElement *) *ret = [OFMutableArray array]; for (OFXMLNode *child in _children) if ([child isKindOfClass: [OFXMLElement class]]) - [ret addObject: (OFXMLElement*)child]; + [ret addObject: (OFXMLElement *)child]; [ret makeImmutable]; return ret; } -- (OFArray*)elementsForName: (OFString*)elementName +- (OFArray *)elementsForName: (OFString *)elementName { - OFMutableArray OF_GENERIC(OFXMLElement*) *ret = [OFMutableArray array]; + OFMutableArray OF_GENERIC(OFXMLElement *) *ret = [OFMutableArray array]; for (OFXMLNode *child in _children) { if ([child isKindOfClass: [OFXMLElement class]]) { - OFXMLElement *element = (OFXMLElement*)child; + OFXMLElement *element = (OFXMLElement *)child; if (element->_namespace == nil && [element->_name isEqual: elementName]) [ret addObject: element]; } @@ -982,17 +982,17 @@ [ret makeImmutable]; return ret; } -- (OFArray*)elementsForNamespace: (OFString*)elementNS +- (OFArray *)elementsForNamespace: (OFString *)elementNS { - OFMutableArray OF_GENERIC(OFXMLElement*) *ret = [OFMutableArray array]; + OFMutableArray OF_GENERIC(OFXMLElement *) *ret = [OFMutableArray array]; for (OFXMLNode *child in _children) { if ([child isKindOfClass: [OFXMLElement class]]) { - OFXMLElement *element = (OFXMLElement*)child; + OFXMLElement *element = (OFXMLElement *)child; if (element->_name != nil && [element->_namespace isEqual: elementNS]) [ret addObject: element]; } @@ -1001,23 +1001,23 @@ [ret makeImmutable]; return ret; } -- (OFArray*)elementsForName: (OFString*)elementName - namespace: (OFString*)elementNS +- (OFArray *)elementsForName: (OFString *)elementName + namespace: (OFString *)elementNS { - OFMutableArray OF_GENERIC(OFXMLElement*) *ret; + OFMutableArray OF_GENERIC(OFXMLElement *) *ret; if (elementNS == nil) return [self elementsForName: elementName]; ret = [OFMutableArray array]; for (OFXMLNode *child in _children) { if ([child isKindOfClass: [OFXMLElement class]]) { - OFXMLElement *element = (OFXMLElement*)child; + OFXMLElement *element = (OFXMLElement *)child; if ([element->_namespace isEqual: elementNS] && [element->_name isEqual: elementName]) [ret addObject: element]; } Index: src/OFXMLElementBuilder.h ================================================================== --- src/OFXMLElementBuilder.h +++ src/OFXMLElementBuilder.h @@ -39,12 +39,12 @@ * with all children. * * @param builder The builder which built an OFXMLElement * @param element The OFXMLElement the OFXMLElementBuilder built */ -- (void)elementBuilder: (OFXMLElementBuilder*)builder - didBuildElement: (OFXMLElement*)element; +- (void)elementBuilder: (OFXMLElementBuilder *)builder + didBuildElement: (OFXMLElement *)element; @optional /*! * @brief This callback is called when the OFXMLElementBuilder built an * OFXMLNode which is not inside an element. @@ -53,12 +53,12 @@ * root element. * * @param builder The builder which built the OFXMLNode without parent * @param node The OFXMLNode the OFXMLElementBuilder built */ -- (void)elementBuilder: (OFXMLElementBuilder*)builder - didBuildParentlessNode: (OFXMLNode*)node; +- (void)elementBuilder: (OFXMLElementBuilder *)builder + didBuildParentlessNode: (OFXMLNode *)node; /*! * @brief This callback is called when the OFXMLElementBuilder gets a close tag * which does not belong there. * @@ -74,25 +74,25 @@ * @param builder The builder which did not expect the close tag * @param name The name of the close tag * @param prefix The prefix of the close tag * @param namespace_ The namespace of the close tag */ -- (void)elementBuilder: (OFXMLElementBuilder*)builder - didNotExpectCloseTag: (OFString*)name - prefix: (nullable OFString*)prefix - namespace: (nullable OFString*)namespace_; +- (void)elementBuilder: (OFXMLElementBuilder *)builder + didNotExpectCloseTag: (OFString *)name + prefix: (nullable OFString *)prefix + namespace: (nullable OFString *)namespace_; /*! * @brief This callback is called when the XML parser for the element builder * found an unknown entity. * * @param builder The element builder which found an unknown entity * @param entity The name of the entity * @return The substitution for the entity */ -- (OFString*)elementBuilder: (OFXMLElementBuilder*)builder - foundUnknownEntityNamed: (OFString*)entity; +- (OFString *)elementBuilder: (OFXMLElementBuilder *)builder + foundUnknownEntityNamed: (OFString *)entity; @end /*! * @class OFXMLElementBuilder OFXMLElementBuilder.h ObjFW/OFXMLElementBuilder.h * @@ -103,11 +103,11 @@ * first parsing stuff using the OFXMLParser with another delegate and then * setting the OFXMLElementBuilder as delegate for the parser. */ @interface OFXMLElementBuilder: OFObject { - OFMutableArray OF_GENERIC(OFXMLElement*) *_stack; + OFMutableArray OF_GENERIC(OFXMLElement *) *_stack; id _delegate; } /*! * The delegate for the OFXMLElementBuilder. Index: src/OFXMLElementBuilder.m ================================================================== --- src/OFXMLElementBuilder.m +++ src/OFXMLElementBuilder.m @@ -55,12 +55,12 @@ [_stack release]; [super dealloc]; } -- (void)parser: (OFXMLParser*)parser - foundProcessingInstructions: (OFString*)pi +- (void)parser: (OFXMLParser *)parser + foundProcessingInstructions: (OFString *)pi { OFXMLProcessingInstructions *node = [OFXMLProcessingInstructions processingInstructionsWithString: pi]; OFXMLElement *parent = [_stack lastObject]; @@ -70,15 +70,15 @@ @selector(elementBuilder:didBuildParentlessNode:)]) [_delegate elementBuilder: self didBuildParentlessNode: node]; } -- (void)parser: (OFXMLParser*)parser - didStartElement: (OFString*)name - prefix: (OFString*)prefix - namespace: (OFString*)namespace - attributes: (OFArray*)attributes +- (void)parser: (OFXMLParser *)parser + didStartElement: (OFString *)name + prefix: (OFString *)prefix + namespace: (OFString *)namespace + attributes: (OFArray *)attributes { OFXMLElement *element = [OFXMLElement elementWithName: name namespace: namespace]; for (OFXMLAttribute *attribute in attributes) { @@ -96,14 +96,14 @@ [[_stack lastObject] addChild: element]; [_stack addObject: element]; } -- (void)parser: (OFXMLParser*)parser - didEndElement: (OFString*)name - prefix: (OFString*)prefix - namespace: (OFString*)namespace +- (void)parser: (OFXMLParser *)parser + didEndElement: (OFString *)name + prefix: (OFString *)prefix + namespace: (OFString *)namespace { switch ([_stack count]) { case 0: if ([_delegate respondsToSelector: @selector(elementBuilder: didNotExpectCloseTag:prefix:namespace:)]) @@ -122,12 +122,12 @@ } [_stack removeLastObject]; } -- (void)parser: (OFXMLParser*)parser - foundCharacters: (OFString*)characters +- (void)parser: (OFXMLParser *)parser + foundCharacters: (OFString *)characters { OFXMLCharacters *node; OFXMLElement *parent; node = [OFXMLCharacters charactersWithString: characters]; @@ -139,12 +139,12 @@ @selector(elementBuilder:didBuildParentlessNode:)]) [_delegate elementBuilder: self didBuildParentlessNode: node]; } -- (void)parser: (OFXMLParser*)parser - foundCDATA: (OFString*)CDATA +- (void)parser: (OFXMLParser *)parser + foundCDATA: (OFString *)CDATA { OFXMLCDATA *node = [OFXMLCDATA CDATAWithString: CDATA]; OFXMLElement *parent = [_stack lastObject]; if (parent != nil) @@ -153,12 +153,12 @@ @selector(elementBuilder:didBuildParentlessNode:)]) [_delegate elementBuilder: self didBuildParentlessNode: node]; } -- (void)parser: (OFXMLParser*)parser - foundComment: (OFString*)comment +- (void)parser: (OFXMLParser *)parser + foundComment: (OFString *)comment { OFXMLComment *node = [OFXMLComment commentWithString: comment]; OFXMLElement *parent = [_stack lastObject]; if (parent != nil) @@ -167,16 +167,16 @@ @selector(elementBuilder:didBuildParentlessNode:)]) [_delegate elementBuilder: self didBuildParentlessNode: node]; } -- (OFString*)parser: (OFXMLParser*)parser - foundUnknownEntityNamed: (OFString*)entity +- (OFString *)parser: (OFXMLParser *)parser + foundUnknownEntityNamed: (OFString *)entity { if ([_delegate respondsToSelector: @selector(elementBuilder:foundUnknownEntityNamed:)]) return [_delegate elementBuilder: self foundUnknownEntityNamed: entity]; return nil; } @end Index: src/OFXMLNode.h ================================================================== --- src/OFXMLNode.h +++ src/OFXMLNode.h @@ -28,21 +28,21 @@ /*! * @brief Returns the contents of the receiver as a string value. * * @return A string with the string value */ -- (OFString*)stringValue; +- (OFString *)stringValue; /*! * @brief Sets the string value of the receiver to the specified string. * * For an @ref OFXMLElement, it removes all children and creates a single child * with the specified string value. * * @param stringValue The new string value for the node */ -- (void)setStringValue: (OFString*)stringValue; +- (void)setStringValue: (OFString *)stringValue; /*! * @brief Returns the contents of the receiver as a decimal value. * * @return An integer with the decimal value @@ -73,21 +73,21 @@ /*! * @brief Returns an OFString representing the OFXMLNode as an XML string. * * @return An OFString representing the OFXMLNode as an XML string */ -- (OFString*)XMLString; +- (OFString *)XMLString; /*! * @brief Returns an OFString representing the OFXMLNode as an XML string with * indentation. * * @param indentation The indentation for the XML string * @return An OFString representing the OFXMLNode as an XML string with * indentation */ -- (OFString*)XMLStringWithIndentation: (unsigned int)indentation; +- (OFString *)XMLStringWithIndentation: (unsigned int)indentation; /*! * @brief Returns an OFString representing the OFXMLNode as an XML string with * indentation for the specified level. * @@ -94,10 +94,10 @@ * @param indentation The indentation for the XML string * @param level The level of indentation * @return An OFString representing the OFXMLNode as an XML string with * indentation */ -- (OFString*)XMLStringWithIndentation: (unsigned int)indentation - level: (unsigned int)level; +- (OFString *)XMLStringWithIndentation: (unsigned int)indentation + level: (unsigned int)level; @end OF_ASSUME_NONNULL_END Index: src/OFXMLNode.m ================================================================== --- src/OFXMLNode.m +++ src/OFXMLNode.m @@ -18,21 +18,21 @@ #import "OFXMLNode.h" #import "OFString.h" @implementation OFXMLNode -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { OF_INVALID_INIT_METHOD } -- (OFString*)stringValue +- (OFString *)stringValue { OF_UNRECOGNIZED_SELECTOR } -- (void)setStringValue: (OFString*)stringValue +- (void)setStringValue: (OFString *)stringValue { OF_UNRECOGNIZED_SELECTOR } - (intmax_t)decimalValue @@ -53,38 +53,38 @@ - (double)doubleValue { return [[self stringValue] doubleValue]; } -- (OFString*)XMLString +- (OFString *)XMLString { return [self XMLStringWithIndentation: 0 level: 0]; } -- (OFString*)XMLStringWithIndentation: (unsigned int)indentation +- (OFString *)XMLStringWithIndentation: (unsigned int)indentation { return [self XMLStringWithIndentation: 0 level: 0]; } -- (OFString*)XMLStringWithIndentation: (unsigned int)indentation - level: (unsigned int)level +- (OFString *)XMLStringWithIndentation: (unsigned int)indentation + level: (unsigned int)level { OF_UNRECOGNIZED_SELECTOR } -- (OFString*)description +- (OFString *)description { return [self XMLStringWithIndentation: 2]; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { OF_UNRECOGNIZED_SELECTOR } - copy { return [self retain]; } @end Index: src/OFXMLParser.h ================================================================== --- src/OFXMLParser.h +++ src/OFXMLParser.h @@ -41,12 +41,12 @@ * instructions. * * @param parser The parser which found processing instructions * @param pi The processing instructions */ -- (void)parser: (OFXMLParser*)parser - foundProcessingInstructions: (OFString*)pi; +- (void)parser: (OFXMLParser *)parser + foundProcessingInstructions: (OFString *)pi; /*! * @brief This callback is called when the XML parser found the start of a new * tag. * @@ -55,28 +55,28 @@ * @param prefix The prefix of the tag which just started or `nil` * @param ns The namespace of the tag which just started or `nil` * @param attributes The attributes included in the tag which just started or * `nil` */ -- (void)parser: (OFXMLParser*)parser - didStartElement: (OFString*)name - prefix: (nullable OFString*)prefix - namespace: (nullable OFString*)ns - attributes: (nullable OFArray OF_GENERIC(OFXMLAttribute*)*)attributes; +- (void)parser: (OFXMLParser *)parser + didStartElement: (OFString *)name + prefix: (nullable OFString *)prefix + namespace: (nullable OFString *)ns + attributes: (nullable OFArray OF_GENERIC(OFXMLAttribute *) *)attributes; /*! * @brief This callback is called when the XML parser found the end of a tag. * * @param parser The parser which found the end of a tag * @param name The name of the tag which just ended * @param prefix The prefix of the tag which just ended or `nil` * @param ns The namespace of the tag which just ended or `nil` */ -- (void)parser: (OFXMLParser*)parser - didEndElement: (OFString*)name - prefix: (nullable OFString*)prefix - namespace: (nullable OFString*)ns; +- (void)parser: (OFXMLParser *)parser + didEndElement: (OFString *)name + prefix: (nullable OFString *)prefix + namespace: (nullable OFString *)ns; /*! * @brief This callback is called when the XML parser found characters. * * In case there are comments or CDATA, it is possible that this callback is @@ -83,30 +83,30 @@ * called multiple times in a row. * * @param parser The parser which found a string * @param characters The characters the XML parser found */ -- (void)parser: (OFXMLParser*)parser - foundCharacters: (OFString*)characters; +- (void)parser: (OFXMLParser *)parser + foundCharacters: (OFString *)characters; /*! * @brief This callback is called when the XML parser found CDATA. * * @param parser The parser which found a string * @param CDATA The CDATA the XML parser found */ -- (void)parser: (OFXMLParser*)parser - foundCDATA: (OFString*)CDATA; +- (void)parser: (OFXMLParser *)parser + foundCDATA: (OFString *)CDATA; /*! * @brief This callback is called when the XML parser found a comment. * * @param parser The parser which found a comment * @param comment The comment the XML parser found */ -- (void)parser: (OFXMLParser*)parser - foundComment: (OFString*)comment; +- (void)parser: (OFXMLParser *)parser + foundComment: (OFString *)comment; /*! * @brief This callback is called when the XML parser found an entity it * doesn't know. * @@ -116,12 +116,12 @@ * * @param parser The parser which found an unknown entity * @param entity The name of the entity the XML parser didn't know * @return A substitution for the entity or `nil` */ -- (OFString*)parser: (OFXMLParser*)parser - foundUnknownEntityNamed: (OFString*)entity; +- (OFString *)parser: (OFXMLParser *)parser + foundUnknownEntityNamed: (OFString *)entity; @end /*! * @class OFXMLParser OFXMLParser.h ObjFW/OFXMLParser.h * @@ -159,16 +159,16 @@ size_t _i, _last; const char *_data; OFDataArray *_buffer; OFString *_name, *_prefix; OFMutableArray - OF_GENERIC(OFMutableDictionary OF_GENERIC(OFString*, OFString*)*) + OF_GENERIC(OFMutableDictionary OF_GENERIC(OFString *, OFString *) *) *_namespaces; - OFMutableArray OF_GENERIC(OFXMLAttribute*) *_attributes; + OFMutableArray OF_GENERIC(OFXMLAttribute *) *_attributes; OFString *_attributeName, *_attributePrefix; char _delimiter; - OFMutableArray OF_GENERIC(OFString*) *_previous; + OFMutableArray OF_GENERIC(OFString *) *_previous; size_t _level; bool _acceptProlog; size_t _lineNumber; bool _lastCarriageReturn, _finishedParsing; of_string_encoding_t _encoding; @@ -200,34 +200,34 @@ * @brief Parses the specified buffer with the specified size. * * @param buffer The buffer to parse * @param length The length of the buffer */ -- (void)parseBuffer: (const char*)buffer +- (void)parseBuffer: (const char *)buffer length: (size_t)length; /*! * @brief Parses the specified string. * * @param string The string to parse */ -- (void)parseString: (OFString*)string; +- (void)parseString: (OFString *)string; /*! * @brief Parses the specified stream. * * @param stream The stream to parse */ -- (void)parseStream: (OFStream*)stream; +- (void)parseStream: (OFStream *)stream; #ifdef OF_HAVE_FILES /*! * @brief Parses the specified file. * * @param path The path to the file to parse */ -- (void)parseFile: (OFString*)path; +- (void)parseFile: (OFString *)path; #endif /*! * @brief Returns the current line number. * Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -58,11 +58,11 @@ count: [tmp UTF8StringLength]]; objc_autoreleasePoolPop(pool); } } -static OFString* +static OFString * transformString(OFXMLParser *parser, OFDataArray *buffer, size_t cut, bool unescape) { char *items = [buffer items]; size_t length = [buffer count] - cut; @@ -96,11 +96,11 @@ } return ret; } -static OFString* +static OFString * namespaceForPrefix(OFString *prefix, OFArray *namespaces) { OFDictionary *const *objects = [namespaces objects]; size_t count = [namespaces count]; @@ -230,11 +230,11 @@ [_previous release]; [super dealloc]; } -- (void)parseBuffer: (const char*)buffer +- (void)parseBuffer: (const char *)buffer length: (size_t)length { _data = buffer; for (_i = _last = 0; _i < length; _i++) { @@ -257,17 +257,17 @@ if (length - _last > 0 && _state != OF_XMLPARSER_IN_TAG) appendToBuffer(_buffer, _data + _last, _encoding, length - _last); } -- (void)parseString: (OFString*)string +- (void)parseString: (OFString *)string { [self parseBuffer: [string UTF8String] length: [string UTF8StringLength]]; } -- (void)parseStream: (OFStream*)stream +- (void)parseStream: (OFStream *)stream { size_t pageSize = [OFSystemInfo pageSize]; char *buffer = [self allocMemoryWithSize: pageSize]; @try { @@ -282,11 +282,11 @@ [self freeMemory: buffer]; } } #ifdef OF_HAVE_FILES -- (void)parseFile: (OFString*)path +- (void)parseFile: (OFString *)path { OFFile *file = [[OFFile alloc] initWithPath: path mode: @"rb"]; @try { @@ -388,11 +388,11 @@ break; } } /* */ -- (bool)OF_parseXMLProcessingInstructions: (OFString*)pi +- (bool)OF_parseXMLProcessingInstructions: (OFString *)pi { const char *cString; size_t length, last; int PIState = 0; OFString *attribute = nil; @@ -1008,16 +1008,16 @@ - (bool)hasFinishedParsing { return _finishedParsing; } -- (OFString*)string: (OFString*)string - containsUnknownEntityNamed: (OFString*)entity +- (OFString *)string: (OFString *)string + containsUnknownEntityNamed: (OFString *)entity { if ([_delegate respondsToSelector: @selector(parser:foundUnknownEntityNamed:)]) return [_delegate parser: self foundUnknownEntityNamed: entity]; return nil; } @end Index: src/OFXMLProcessingInstructions.h ================================================================== --- src/OFXMLProcessingInstructions.h +++ src/OFXMLProcessingInstructions.h @@ -33,18 +33,18 @@ * @brief Creates a new OFXMLProcessingInstructions with the specified string. * * @param string The string for the processing instructions * @return A new OFXMLProcessingInstructions */ -+ (instancetype)processingInstructionsWithString: (OFString*)string; ++ (instancetype)processingInstructionsWithString: (OFString *)string; /*! * @brief Initializes an already allocated OFXMLProcessingInstructions with the * specified string. * * @param string The string for the processing instructions * @return An initialized OFXMLProcessingInstructions */ -- initWithString: (OFString*)string; +- initWithString: (OFString *)string; @end OF_ASSUME_NONNULL_END Index: src/OFXMLProcessingInstructions.m ================================================================== --- src/OFXMLProcessingInstructions.m +++ src/OFXMLProcessingInstructions.m @@ -23,16 +23,16 @@ #import "OFXMLElement.h" #import "OFInvalidArgumentException.h" @implementation OFXMLProcessingInstructions -+ (instancetype)processingInstructionsWithString: (OFString*)string ++ (instancetype)processingInstructionsWithString: (OFString *)string { return [[[self alloc] initWithString: string] autorelease]; } -- initWithString: (OFString*)string +- initWithString: (OFString *)string { self = [super init]; @try { _processingInstructions = [string copy]; @@ -42,11 +42,11 @@ } return self; } -- initWithSerialization: (OFXMLElement*)element +- initWithSerialization: (OFXMLElement *)element { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); @@ -89,27 +89,27 @@ - (uint32_t)hash { return [_processingInstructions hash]; } -- (OFString*)stringValue +- (OFString *)stringValue { return @""; } -- (OFString*)XMLString +- (OFString *)XMLString { return [OFString stringWithFormat: @"", _processingInstructions]; } -- (OFString*)XMLStringWithIndentation: (unsigned int)indentation +- (OFString *)XMLStringWithIndentation: (unsigned int)indentation { return [OFString stringWithFormat: @"", _processingInstructions]; } -- (OFString*)XMLStringWithIndentation: (unsigned int)indentation - level: (unsigned int)level +- (OFString *)XMLStringWithIndentation: (unsigned int)indentation + level: (unsigned int)level { OFString *ret; if (indentation > 0 && level > 0) { char *whitespaces = [self allocMemoryWithSize: @@ -128,17 +128,17 @@ _processingInstructions]; return ret; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"", _processingInstructions]; } -- (OFXMLElement*)XMLElementBySerializing +- (OFXMLElement *)XMLElementBySerializing { return [OFXMLElement elementWithName: [self className] namespace: OF_SERIALIZATION_NS stringValue: _processingInstructions]; } @end Index: src/OFZIPArchive.h ================================================================== --- src/OFZIPArchive.h +++ src/OFZIPArchive.h @@ -39,12 +39,12 @@ uint32_t _diskNumber, _centralDirectoryDisk; uint64_t _centralDirectoryEntriesInDisk, _centralDirectoryEntries; uint64_t _centralDirectorySize; int64_t _centralDirectoryOffset; OFString *_archiveComment; - OFMutableArray OF_GENERIC(OFZIPArchiveEntry*) *_entries; - OFMutableDictionary OF_GENERIC(OFString*, OFZIPArchiveEntry*) + OFMutableArray OF_GENERIC(OFZIPArchiveEntry *) *_entries; + OFMutableDictionary OF_GENERIC(OFString *, OFZIPArchiveEntry *) *_pathToEntryMap; OFStream *_lastReturnedStream; } /*! @@ -56,40 +56,40 @@ * @brief Creates a new OFZIPArchive object with the specified seekable stream. * * @param stream A seekable stream from which the ZIP archive will be read * @return A new, autoreleased OFZIPArchive */ -+ (instancetype)archiveWithSeekableStream: (OFSeekableStream*)stream; ++ (instancetype)archiveWithSeekableStream: (OFSeekableStream *)stream; #ifdef OF_HAVE_FILES /*! * @brief Creates a new OFZIPArchive object with the specified file. * * @param path The path to the ZIP file * @return A new, autoreleased OFZIPArchive */ -+ (instancetype)archiveWithPath: (OFString*)path; ++ (instancetype)archiveWithPath: (OFString *)path; #endif /*! * @brief Initializes an already allocated OFZIPArchive object with the * specified seekable stream. * * @param stream A seekable stream from which the ZIP archive will be read * @return An initialized OFZIPArchive */ -- initWithSeekableStream: (OFSeekableStream*)stream; +- initWithSeekableStream: (OFSeekableStream *)stream; #ifdef OF_HAVE_FILES /*! * @brief Initializes an already allocated OFZIPArchive object with the * specified file. * * @param path The path to the ZIP file * @return An initialized OFZIPArchive */ -- initWithPath: (OFString*)path; +- initWithPath: (OFString *)path; #endif /*! * @brief Returns the entries of the central directory of the archive as an * array of objects of class @ref OFZIPArchiveEntry. @@ -98,11 +98,11 @@ * directory, which does not need to be the order in which the actual files are * stored. * * @return The entries of the central directory of the archive as an array */ -- (OFArray OF_GENERIC(OFZIPArchiveEntry*)*)entries; +- (OFArray OF_GENERIC(OFZIPArchiveEntry *) *)entries; /*! * @brief Returns a stream for reading the specified file from the archive. * * @warning Calling @ref streamForReadingFile: will invalidate all streams @@ -110,9 +110,9 @@ * invalidated stream will throw an @ref OFReadFailedException! * * @param path The path to the file inside the archive * @return A stream for reading the specified file form the archive */ -- (OFStream*)streamForReadingFile: (OFString*)path; +- (OFStream *)streamForReadingFile: (OFString *)path; @end OF_ASSUME_NONNULL_END Index: src/OFZIPArchive.m ================================================================== --- src/OFZIPArchive.m +++ src/OFZIPArchive.m @@ -64,12 +64,12 @@ uint64_t _compressedSize, _uncompressedSize; OFString *_fileName; OFDataArray *_extraField; } -- initWithStream: (OFStream*)stream; -- (bool)matchesEntry: (OFZIPArchiveEntry*)entry; +- initWithStream: (OFStream *)stream; +- (bool)matchesEntry: (OFZIPArchiveEntry *)entry; @end @interface OFZIPArchive_FileStream: OFStream { OFStream *_stream, *_decompressedStream; @@ -78,12 +78,12 @@ uint64_t _size; uint32_t _CRC32; bool _atEndOfStream, _closed; } -- initWithStream: (OFStream*)path - localFileHeader: (OFZIPArchive_LocalFileHeader*)localFileHeader; +- initWithStream: (OFStream *)path + localFileHeader: (OFZIPArchive_LocalFileHeader *)localFileHeader; @end uint32_t of_zip_archive_read_field32(uint8_t **data, uint16_t *size) { @@ -134,17 +134,17 @@ } @implementation OFZIPArchive @synthesize archiveComment = _archiveComment; -+ (instancetype)archiveWithSeekableStream: (OFSeekableStream*)stream ++ (instancetype)archiveWithSeekableStream: (OFSeekableStream *)stream { return [[[self alloc] initWithSeekableStream: stream] autorelease]; } #ifdef OF_HAVE_FILES -+ (instancetype)archiveWithPath: (OFString*)path ++ (instancetype)archiveWithPath: (OFString *)path { return [[[self alloc] initWithPath: path] autorelease]; } #endif @@ -151,11 +151,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithSeekableStream: (OFSeekableStream*)stream +- initWithSeekableStream: (OFSeekableStream *)stream { self = [super init]; @try { _stream = [stream retain]; @@ -169,11 +169,11 @@ return self; } #ifdef OF_HAVE_FILES -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path { self = [super init]; @try { _stream = [[OFFile alloc] initWithPath: path @@ -320,16 +320,16 @@ [_pathToEntryMap makeImmutable]; objc_autoreleasePoolPop(pool); } -- (OFArray*)entries +- (OFArray *)entries { return [[_entries copy] autorelease]; } -- (OFStream*)streamForReadingFile: (OFString*)path +- (OFStream *)streamForReadingFile: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFZIPArchiveEntry *entry = [_pathToEntryMap objectForKey: path]; OFZIPArchive_LocalFileHeader *localFileHeader; int64_t offset64; @@ -372,11 +372,11 @@ return [[_lastReturnedStream retain] autorelease]; } @end @implementation OFZIPArchive_LocalFileHeader -- initWithStream: (OFStream*)stream +- initWithStream: (OFStream *)stream { self = [super init]; @try { uint16_t fileNameLength, extraFieldLength; @@ -434,11 +434,11 @@ [_extraField release]; [super dealloc]; } -- (bool)matchesEntry: (OFZIPArchiveEntry*)entry +- (bool)matchesEntry: (OFZIPArchiveEntry *)entry { if (_compressionMethod != [entry compressionMethod] || _lastModifiedFileTime != [entry OF_lastModifiedFileTime] || _lastModifiedFileDate != [entry OF_lastModifiedFileDate]) return false; @@ -455,12 +455,12 @@ return true; } @end @implementation OFZIPArchive_FileStream -- initWithStream: (OFStream*)stream - localFileHeader: (OFZIPArchive_LocalFileHeader*)localFileHeader +- initWithStream: (OFStream *)stream + localFileHeader: (OFZIPArchive_LocalFileHeader *)localFileHeader { self = [super init]; @try { _stream = [stream retain]; @@ -508,11 +508,11 @@ - (bool)lowlevelIsAtEndOfStream { return _atEndOfStream; } -- (size_t)lowlevelReadIntoBuffer: (void*)buffer +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { size_t min, ret; if (_atEndOfStream || _closed) Index: src/OFZIPArchiveEntry+Private.h ================================================================== --- src/OFZIPArchiveEntry+Private.h +++ src/OFZIPArchiveEntry+Private.h @@ -20,9 +20,9 @@ @interface OFZIPArchiveEntry () @property (readonly) uint16_t OF_lastModifiedFileTime, OF_lastModifiedFileDate; @property (readonly) int64_t OF_localFileHeaderOffset; -- (instancetype)OF_initWithStream: (OFStream*)stream; +- (instancetype)OF_initWithStream: (OFStream *)stream; @end OF_ASSUME_NONNULL_END Index: src/OFZIPArchiveEntry.h ================================================================== --- src/OFZIPArchiveEntry.h +++ src/OFZIPArchiveEntry.h @@ -178,18 +178,18 @@ /*! * @brief Returns the last modification date of the entry's file. * * @return The last modification date of the entry's file */ -- (OFDate*)modificationDate; +- (OFDate *)modificationDate; /*! * @brief Returns the extra field of the entry. * * @return The extra field of the entry */ -- (OFDataArray*)extraField; +- (OFDataArray *)extraField; @end #ifdef __cplusplus extern "C" { #endif @@ -197,11 +197,11 @@ * @brief Converts the ZIP entry version to a string * * @param version The ZIP entry version to convert to a string * @return The ZIP entry version as a string */ -extern OFString* of_zip_archive_entry_version_to_string(uint16_t version); +extern OFString *of_zip_archive_entry_version_to_string(uint16_t version); /*! * @brief Gets a pointer to and the size of the extensible data field with the * specified tag. * Index: src/OFZIPArchiveEntry.m ================================================================== --- src/OFZIPArchiveEntry.m +++ src/OFZIPArchiveEntry.m @@ -26,14 +26,14 @@ #import "OFStream.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" -extern uint32_t of_zip_archive_read_field32(uint8_t**, uint16_t*); -extern uint64_t of_zip_archive_read_field64(uint8_t**, uint16_t*); +extern uint32_t of_zip_archive_read_field32(uint8_t **, uint16_t *); +extern uint64_t of_zip_archive_read_field64(uint8_t **, uint16_t *); -OFString* +OFString * of_zip_archive_entry_version_to_string(uint16_t version) { const char *attrCompat = NULL; switch (version >> 8) { @@ -153,11 +153,11 @@ @synthesize generalPurposeBitFlag = _generalPurposeBitFlag; @synthesize OF_lastModifiedFileTime = _lastModifiedFileTime; @synthesize OF_lastModifiedFileDate = _lastModifiedFileDate; @synthesize OF_localFileHeaderOffset = _localFileHeaderOffset; -- (instancetype)OF_initWithStream: (OFStream*)stream +- (instancetype)OF_initWithStream: (OFStream *)stream { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); @@ -235,11 +235,11 @@ [_fileComment release]; [super dealloc]; } -- (OFDate*)modificationDate +- (OFDate *)modificationDate { void *pool = objc_autoreleasePoolPush(); uint16_t year = ((_lastModifiedFileDate & 0xFE00) >> 9) + 1980; uint8_t month = (_lastModifiedFileDate & 0x1E0) >> 5; uint8_t day = (_lastModifiedFileDate & 0x1F); @@ -259,16 +259,16 @@ objc_autoreleasePoolPop(pool); return [date autorelease]; } -- (OFDataArray*)extraField +- (OFDataArray *)extraField { return [[_extraField copy] autorelease]; } -- (OFString*)description +- (OFString *)description { void *pool = objc_autoreleasePoolPush(); OFString *ret = [OFString stringWithFormat: @"<%@:\n" @"\tFile name = %@\n" @"\tFile comment = %@\n" Index: src/atomic_no_threads.h ================================================================== --- src/atomic_no_threads.h +++ src/atomic_no_threads.h @@ -27,11 +27,11 @@ } static OF_INLINE void *_Nullable of_atomic_ptr_add(void *volatile _Nullable *_Nonnull p, intptr_t i) { - return (*(char* volatile*)p += i); + return (*(char *volatile *)p += i); } static OF_INLINE int of_atomic_int_sub(volatile int *_Nonnull p, int i) { @@ -45,11 +45,11 @@ } static OF_INLINE void *_Nullable of_atomic_ptr_sub(void *volatile _Nullable *_Nonnull p, intptr_t i) { - return (*(char* volatile*)p -= i); + return (*(char *volatile *)p -= i); } static OF_INLINE int of_atomic_int_inc(volatile int *_Nonnull p) { Index: src/atomic_osatomic.h ================================================================== --- src/atomic_osatomic.h +++ src/atomic_osatomic.h @@ -30,13 +30,13 @@ static OF_INLINE void *_Nullable of_atomic_ptr_add(void *volatile _Nullable *_Nonnull p, intptr_t i) { #ifdef __LP64__ - return (void*)OSAtomicAdd64(i, (int64_t*)p); + return (void *)OSAtomicAdd64(i, (int64_t *)p); #else - return (void*)OSAtomicAdd32(i, (int32_t*)p); + return (void *)OSAtomicAdd32(i, (int32_t *)p); #endif } static OF_INLINE int of_atomic_int_sub(volatile int *_Nonnull p, int i) @@ -52,13 +52,13 @@ static OF_INLINE void *_Nullable of_atomic_ptr_sub(void *volatile _Nullable *_Nonnull p, intptr_t i) { #ifdef __LP64__ - return (void*)OSAtomicAdd64(-i, (int64_t*)p); + return (void *)OSAtomicAdd64(-i, (int64_t *)p); #else - return (void*)OSAtomicAdd32(-i, (int32_t*)p); + return (void *)OSAtomicAdd32(-i, (int32_t *)p); #endif } static OF_INLINE int of_atomic_int_inc(volatile int *_Nonnull p) Index: src/atomic_powerpc.h ================================================================== --- src/atomic_powerpc.h +++ src/atomic_powerpc.h @@ -57,11 +57,11 @@ "bne- 0b" : "=&r"(i) : "r"(i), "r"(p) ); - return (void*)i; + return (void *)i; } static OF_INLINE int of_atomic_int_sub(volatile int *_Nonnull p, int i) { @@ -105,11 +105,11 @@ "bne- 0b" : "=&r"(i) : "r"(i), "r"(p) ); - return (void*)i; + return (void *)i; } static OF_INLINE int of_atomic_int_inc(volatile int *_Nonnull p) { Index: src/atomic_sync_builtins.h ================================================================== --- src/atomic_sync_builtins.h +++ src/atomic_sync_builtins.h @@ -27,11 +27,11 @@ } static OF_INLINE void *_Nullable of_atomic_ptr_add(void *volatile _Nullable *_Nonnull p, intptr_t i) { - return __sync_add_and_fetch(p, (void*)i); + return __sync_add_and_fetch(p, (void *)i); } static OF_INLINE int of_atomic_int_sub(volatile int *_Nonnull p, int i) { @@ -45,11 +45,11 @@ } static OF_INLINE void *_Nullable of_atomic_ptr_sub(void *volatile _Nullable *_Nonnull p, intptr_t i) { - return __sync_sub_and_fetch(p, (void*)i); + return __sync_sub_and_fetch(p, (void *)i); } static OF_INLINE int of_atomic_int_inc(volatile int *_Nonnull p) { Index: src/atomic_x86.h ================================================================== --- src/atomic_x86.h +++ src/atomic_x86.h @@ -67,21 +67,21 @@ "addq %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); - return (void*)i; + return (void *)i; #elif defined(OF_X86_ASM) __asm__ __volatile__ ( "lock\n\t" "xaddl %0, %2\n\t" "addl %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); - return (void*)i; + return (void *)i; #endif } static OF_INLINE int of_atomic_int_sub(volatile int *_Nonnull p, int i) @@ -138,11 +138,11 @@ "subq %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); - return (void*)i; + return (void *)i; #elif defined(OF_X86_ASM) __asm__ __volatile__ ( "negl %0\n\t" "lock\n\t" "xaddl %0, %2\n\t" @@ -149,11 +149,11 @@ "subl %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); - return (void*)i; + return (void *)i; #endif } static OF_INLINE int of_atomic_int_inc(volatile int *_Nonnull p) Index: src/autorelease.h ================================================================== --- src/autorelease.h +++ src/autorelease.h @@ -26,11 +26,11 @@ /*! * @brief Creates a new autorelease pool. * * @return An identifier for the created autorelease pool */ -extern void* objc_autoreleasePoolPush(); +extern void *objc_autoreleasePoolPush(); /*! * @brief Drains an autorelease pool. * * @param pool An identifier for the pool to drain Index: src/autorelease.m ================================================================== --- src/autorelease.m +++ src/autorelease.m @@ -45,20 +45,20 @@ OF_ENSURE(of_tlskey_new(&topKey)); OF_ENSURE(of_tlskey_new(&sizeKey)); } #endif -void* +void * objc_autoreleasePoolPush() { #if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) id *top = of_tlskey_get(topKey); id *objects = of_tlskey_get(objectsKey); #endif ptrdiff_t offset = top - objects; - return (void*)offset; + return (void *)offset; } void objc_autoreleasePoolPop(void *offset) { @@ -103,11 +103,11 @@ top = objects; #if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) OF_ENSURE(of_tlskey_set(objectsKey, objects)); - OF_ENSURE(of_tlskey_set(sizeKey, (void*)(uintptr_t)size)); + OF_ENSURE(of_tlskey_set(sizeKey, (void *)(uintptr_t)size)); #endif } if ((uintptr_t)top >= (uintptr_t)objects + size) { ptrdiff_t diff = top - objects; @@ -115,11 +115,11 @@ size += [OFSystemInfo pageSize]; OF_ENSURE((objects = realloc(objects, size)) != NULL); #if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) OF_ENSURE(of_tlskey_set(objectsKey, objects)); - OF_ENSURE(of_tlskey_set(sizeKey, (void*)(uintptr_t)size)); + OF_ENSURE(of_tlskey_set(sizeKey, (void *)(uintptr_t)size)); #endif top = objects + diff; } Index: src/base64.h ================================================================== --- src/base64.h +++ src/base64.h @@ -29,12 +29,12 @@ @class OFDataArray; #ifdef __cplusplus extern "C" { #endif -extern OFString* of_base64_encode(const void*, size_t); -extern bool of_base64_decode(OFDataArray*, const char*, size_t); +extern OFString *of_base64_encode(const void *, size_t); +extern bool of_base64_decode(OFDataArray *, const char *, size_t); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/base64.m ================================================================== --- src/base64.m +++ src/base64.m @@ -37,15 +37,15 @@ 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 }; -OFString* +OFString * of_base64_encode(const void *data, size_t length) { OFMutableString *ret = [OFMutableString string]; - uint8_t *buffer = (uint8_t*)data; + uint8_t *buffer = (uint8_t *)data; size_t i; uint8_t rest; char tb[4]; uint32_t sb; @@ -96,11 +96,11 @@ } bool of_base64_decode(OFDataArray *data, const char *string, size_t length) { - const uint8_t *buffer = (const uint8_t*)string; + const uint8_t *buffer = (const uint8_t *)string; size_t i; if ((length & 3) != 0) return false; Index: src/block.h ================================================================== --- src/block.h +++ src/block.h @@ -37,32 +37,33 @@ } of_block_literal_t; #ifdef __cplusplus extern "C" { #endif -extern void* _Block_copy(const void*); -extern void _Block_release(const void*); +extern void *_Block_copy(const void *); +extern void _Block_release(const void *); # if defined(OF_WINDOWS) && defined(OF_COMPILING_OBJFW) /* * Clang has implicit declarations for these, but they are dllimport. When * compiling ObjFW itself, these need to be dllexport. */ extern __declspec(dllexport) struct objc_abi_class _NSConcreteStackBlock; extern __declspec(dllexport) struct objc_abi_class _NSConcreteGlobalBlock; -extern __declspec(dllexport) void _Block_object_assign(void*, const void*, +extern __declspec(dllexport) void _Block_object_assign(void *, const void *, const int); -extern __declspec(dllexport) void _Block_object_dispose(const void*, const int); +extern __declspec(dllexport) void _Block_object_dispose(const void *, + const int); # endif #ifdef __cplusplus } #endif #ifndef Block_copy # define Block_copy(...) \ - ((__typeof__(__VA_ARGS__))_Block_copy((const void*)(__VA_ARGS__))) + ((__typeof__(__VA_ARGS__))_Block_copy((const void *)(__VA_ARGS__))) #endif #ifndef Block_release -# define Block_release(...) _Block_release((const void*)(__VA_ARGS__)) +# define Block_release(...) _Block_release((const void *)(__VA_ARGS__)) #endif OF_ASSUME_NONNULL_END Index: src/bridge/NSArray_OFArray.h ================================================================== --- src/bridge/NSArray_OFArray.h +++ src/bridge/NSArray_OFArray.h @@ -21,7 +21,7 @@ @interface NSArray_OFArray: NSArray { OFArray *_array; } -- initWithOFArray: (OFArray*)array; +- initWithOFArray: (OFArray *)array; @end Index: src/bridge/NSArray_OFArray.m ================================================================== --- src/bridge/NSArray_OFArray.m +++ src/bridge/NSArray_OFArray.m @@ -19,11 +19,11 @@ #import "OFBridging.h" #import "OFOutOfRangeException.h" @implementation NSArray_OFArray -- initWithOFArray: (OFArray*)array +- initWithOFArray: (OFArray *)array { if ((self = [super init]) != nil) { @try { _array = [array retain]; } @catch (id e) { @@ -36,11 +36,11 @@ - (id)objectAtIndex: (NSUInteger)index { id object = [_array objectAtIndex: index]; - if ([(OFObject*)object conformsToProtocol: @protocol(OFBridging)]) + if ([(OFObject *)object conformsToProtocol: @protocol(OFBridging)]) return [object NSObject]; return object; } Index: src/bridge/NSDictionary_OFDictionary.h ================================================================== --- src/bridge/NSDictionary_OFDictionary.h +++ src/bridge/NSDictionary_OFDictionary.h @@ -21,7 +21,7 @@ @interface NSDictionary_OFDictionary: NSDictionary { OFDictionary *_dictionary; } -- initWithOFDictionary: (OFDictionary*)dictionary; +- initWithOFDictionary: (OFDictionary *)dictionary; @end Index: src/bridge/NSDictionary_OFDictionary.m ================================================================== --- src/bridge/NSDictionary_OFDictionary.m +++ src/bridge/NSDictionary_OFDictionary.m @@ -21,11 +21,11 @@ #import "OFBridging.h" #import "OFOutOfRangeException.h" @implementation NSDictionary_OFDictionary -- initWithOFDictionary: (OFDictionary*)dictionary +- initWithOFDictionary: (OFDictionary *)dictionary { if ((self = [super init]) != nil) { @try { _dictionary = [dictionary retain]; } @catch (id e) { @@ -38,16 +38,16 @@ - (id)objectForKey: (id)key { id object; - if ([(NSObject*)key conformsToProtocol: @protocol(NSBridging)]) + if ([(NSObject *)key conformsToProtocol: @protocol(NSBridging)]) key = [key OFObject]; object = [_dictionary objectForKey: key]; - if ([(OFObject*)object conformsToProtocol: @protocol(OFBridging)]) + if ([(OFObject *)object conformsToProtocol: @protocol(OFBridging)]) return [object NSObject]; return object; } Index: src/bridge/OFArray_NSArray.h ================================================================== --- src/bridge/OFArray_NSArray.h +++ src/bridge/OFArray_NSArray.h @@ -25,7 +25,7 @@ @interface OFArray_NSArray: OFArray { NSArray *_array; } -- initWithNSArray: (NSArray*)array; +- initWithNSArray: (NSArray *)array; @end Index: src/bridge/OFArray_NSArray.m ================================================================== --- src/bridge/OFArray_NSArray.m +++ src/bridge/OFArray_NSArray.m @@ -21,11 +21,11 @@ #import "OFInitializationFailedException.h" #import "OFOutOfRangeException.h" @implementation OFArray_NSArray -- initWithNSArray: (NSArray*)array +- initWithNSArray: (NSArray *)array { self = [super init]; @try { if (array == nil) @@ -48,11 +48,11 @@ if (index > NSUIntegerMax) @throw [OFOutOfRangeException exception]; object = [_array objectAtIndex: index]; - if ([(NSObject*)object conformsToProtocol: @protocol(NSBridging)]) + if ([(NSObject *)object conformsToProtocol: @protocol(NSBridging)]) return [object OFObject]; return object; } Index: src/bridge/OFDictionary_NSDictionary.h ================================================================== --- src/bridge/OFDictionary_NSDictionary.h +++ src/bridge/OFDictionary_NSDictionary.h @@ -25,7 +25,7 @@ @interface OFDictionary_NSDictionary: OFDictionary { NSDictionary *_dictionary; } -- initWithNSDictionary: (NSDictionary*)dictionary; +- initWithNSDictionary: (NSDictionary *)dictionary; @end Index: src/bridge/OFDictionary_NSDictionary.m ================================================================== --- src/bridge/OFDictionary_NSDictionary.m +++ src/bridge/OFDictionary_NSDictionary.m @@ -22,11 +22,11 @@ #import "OFBridging.h" #import "OFInitializationFailedException.h" @implementation OFDictionary_NSDictionary -- initWithNSDictionary: (NSDictionary*)dictionary +- initWithNSDictionary: (NSDictionary *)dictionary { self = [super init]; @try { if (dictionary == nil) @@ -44,16 +44,16 @@ - (id)objectForKey: (id)key { id object; - if ([(OFObject*)key conformsToProtocol: @protocol(OFBridging)]) + if ([(OFObject *)key conformsToProtocol: @protocol(OFBridging)]) key = [key NSObject]; object = [_dictionary objectForKey: key]; - if ([(NSObject*)object conformsToProtocol: @protocol(NSBridging)]) + if ([(NSObject *)object conformsToProtocol: @protocol(NSBridging)]) return [object OFObject]; return object; } Index: src/exceptions/OFAcceptFailedException.m ================================================================== --- src/exceptions/OFAcceptFailedException.m +++ src/exceptions/OFAcceptFailedException.m @@ -50,12 +50,12 @@ [_socket release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Failed to accept connection in socket of class %@: %@", [_socket class], of_strerror(_errNo)]; } @end Index: src/exceptions/OFAddressTranslationFailedException.h ================================================================== --- src/exceptions/OFAddressTranslationFailedException.h +++ src/exceptions/OFAddressTranslationFailedException.h @@ -44,25 +44,25 @@ * @brief Creates a new, autoreleased address translation failed exception. * * @param host The host for which translation was requested * @return A new, autoreleased address translation failed exception */ -+ (instancetype)exceptionWithHost: (nullable OFString*)host; ++ (instancetype)exceptionWithHost: (nullable OFString *)host; -+ (instancetype)exceptionWithHost: (nullable OFString*)host ++ (instancetype)exceptionWithHost: (nullable OFString *)host error: (int)error; + (instancetype)exceptionWithError: (int)error; /*! * @brief Initializes an already allocated address translation failed exception. * * @param host The host for which translation was requested * @return An initialized address translation failed exception */ -- initWithHost: (nullable OFString*)host; +- initWithHost: (nullable OFString *)host; -- (instancetype)initWithHost: (nullable OFString*)host +- (instancetype)initWithHost: (nullable OFString *)host error: (int)error; - (instancetype)initWithError: (int)error; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFAddressTranslationFailedException.m ================================================================== --- src/exceptions/OFAddressTranslationFailedException.m +++ src/exceptions/OFAddressTranslationFailedException.m @@ -44,16 +44,16 @@ @throw [OFInitializationFailedException exceptionWithClass: class]; } #endif -+ (instancetype)exceptionWithHost: (OFString*)host ++ (instancetype)exceptionWithHost: (OFString *)host { return [[[self alloc] initWithHost: host] autorelease]; } -+ (instancetype)exceptionWithHost: (OFString*)host ++ (instancetype)exceptionWithHost: (OFString *)host error: (int)error { return [[[self alloc] initWithHost: host error: error] autorelease]; } @@ -61,11 +61,11 @@ + (instancetype)exceptionWithError: (int)error { return [[[self alloc] initWithError: error] autorelease]; } -- initWithHost: (OFString*)host +- initWithHost: (OFString *)host { self = [super init]; @try { _host = [host copy]; @@ -75,11 +75,11 @@ } return self; } -- (instancetype)initWithHost: (OFString*)host +- (instancetype)initWithHost: (OFString *)host error: (int)error { self = [super init]; @try { @@ -107,11 +107,11 @@ [_host release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { /* FIXME: Add proper description for Win32 */ #ifndef OF_WINDOWS if (_error == 0) { #endif Index: src/exceptions/OFAllocFailedException.h ================================================================== --- src/exceptions/OFAllocFailedException.h +++ src/exceptions/OFAllocFailedException.h @@ -39,9 +39,9 @@ /*! * @brief Returns a description of the exception. * * @return A description of the exception */ -- (OFString*)description; +- (OFString *)description; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFAllocFailedException.m ================================================================== --- src/exceptions/OFAllocFailedException.m +++ src/exceptions/OFAllocFailedException.m @@ -28,35 +28,35 @@ - init { OF_INVALID_INIT_METHOD } -- (void*)allocMemoryWithSize: (size_t)size +- (void *)allocMemoryWithSize: (size_t)size +{ + OF_UNRECOGNIZED_SELECTOR +} + +- (void *)allocMemoryForNItems: (size_t)nitems + withSize: (size_t)size { OF_UNRECOGNIZED_SELECTOR } -- (void*)allocMemoryForNItems: (size_t)nitems - withSize: (size_t)size +- (void *)resizeMemory: (void *)ptr + toSize: (size_t)size { OF_UNRECOGNIZED_SELECTOR } -- (void*)resizeMemory: (void*)ptr - toSize: (size_t)size +- (void *)resizeMemory: (void *)ptr + toNItems: (size_t)nitems + withSize: (size_t)size { OF_UNRECOGNIZED_SELECTOR } -- (void*)resizeMemory: (void*)ptr - toNItems: (size_t)nitems - withSize: (size_t)size -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (void)freeMemory: (void*)ptr +- (void)freeMemory: (void *)ptr { OF_UNRECOGNIZED_SELECTOR } - retain @@ -81,10 +81,10 @@ - (void)dealloc { OF_DEALLOC_UNSUPPORTED } -- (OFString*)description +- (OFString *)description { return @"Allocating an object failed!"; } @end Index: src/exceptions/OFAlreadyConnectedException.m ================================================================== --- src/exceptions/OFAlreadyConnectedException.m +++ src/exceptions/OFAlreadyConnectedException.m @@ -41,11 +41,11 @@ [_socket release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_socket) return [OFString stringWithFormat: @"The socket of type %@ is already connected or bound and " @"thus can't be connected or bound again!", Index: src/exceptions/OFBindFailedException.h ================================================================== --- src/exceptions/OFBindFailedException.h +++ src/exceptions/OFBindFailedException.h @@ -63,11 +63,11 @@ * @param port The port on which binding failed * @param socket The socket which could not be bound * @param errNo The errno of the error that occurred * @return A new, autoreleased bind failed exception */ -+ (instancetype)exceptionWithHost: (OFString*)host ++ (instancetype)exceptionWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket errNo: (int)errNo; /*! @@ -77,12 +77,12 @@ * @param port The port on which binding failed * @param socket The socket which could not be bound * @param errNo The errno of the error that occurred * @return An initialized bind failed exception */ -- initWithHost: (OFString*)host +- initWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFBindFailedException.m ================================================================== --- src/exceptions/OFBindFailedException.m +++ src/exceptions/OFBindFailedException.m @@ -22,11 +22,11 @@ #import "OFString.h" @implementation OFBindFailedException @synthesize host = _host, port = _port, socket = _socket, errNo = _errNo; -+ (instancetype)exceptionWithHost: (OFString*)host ++ (instancetype)exceptionWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket errNo: (int)errNo { return [[[self alloc] initWithHost: host @@ -38,11 +38,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithHost: (OFString*)host +- initWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket errNo: (int)errNo { self = [super init]; @@ -66,13 +66,13 @@ [_socket release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Binding to port %" @PRIu16 @" on host %@ failed in socket of " @"type %@: %@", _port, _host, [_socket class], of_strerror(_errNo)]; } @end Index: src/exceptions/OFChangeCurrentDirectoryPathFailedException.h ================================================================== --- src/exceptions/OFChangeCurrentDirectoryPathFailedException.h +++ src/exceptions/OFChangeCurrentDirectoryPathFailedException.h @@ -49,11 +49,11 @@ * @param path The path of the directory to which the current path could not be * changed * @param errNo The errno of the error that occurred * @return A new, autoreleased change current directory path failed exception */ -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo; /*! * @brief Initializes an already allocated change directory failed exception. * @@ -60,10 +60,10 @@ * @param path The path of the directory to which the current path could not be * changed * @param errNo The errno of the error that occurred * @return An initialized change current directory path failed exception */ -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFChangeCurrentDirectoryPathFailedException.m ================================================================== --- src/exceptions/OFChangeCurrentDirectoryPathFailedException.m +++ src/exceptions/OFChangeCurrentDirectoryPathFailedException.m @@ -20,11 +20,11 @@ #import "OFString.h" @implementation OFChangeCurrentDirectoryPathFailedException @synthesize path = _path, errNo = _errNo; -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo { return [[[self alloc] initWithPath: path errNo: errNo] autorelease]; } @@ -32,11 +32,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path errNo: (int)errNo { self = [super init]; @try { @@ -55,12 +55,12 @@ [_path release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Failed to change the current directory path to %@: %@", _path, of_strerror(_errNo)]; } @end Index: src/exceptions/OFChangeOwnerFailedException.h ================================================================== --- src/exceptions/OFChangeOwnerFailedException.h +++ src/exceptions/OFChangeOwnerFailedException.h @@ -57,13 +57,13 @@ * @param owner The new owner for the item * @param group The new group for the item * @param errNo The errno of the error that occurred * @return A new, autoreleased change owner failed exception */ -+ (instancetype)exceptionWithPath: (OFString*)path - owner: (nullable OFString*)owner - group: (nullable OFString*)group ++ (instancetype)exceptionWithPath: (OFString *)path + owner: (nullable OFString *)owner + group: (nullable OFString *)group errNo: (int)errNo; /*! * @brief Initializes an already allocated change owner failed exception. * @@ -71,12 +71,12 @@ * @param owner The new owner for the item * @param group The new group for the item * @param errNo The errno of the error that occurred * @return An initialized change owner failed exception */ -- initWithPath: (OFString*)path - owner: (nullable OFString*)owner - group: (nullable OFString*)group +- initWithPath: (OFString *)path + owner: (nullable OFString *)owner + group: (nullable OFString *)group errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFChangeOwnerFailedException.m ================================================================== --- src/exceptions/OFChangeOwnerFailedException.m +++ src/exceptions/OFChangeOwnerFailedException.m @@ -20,13 +20,13 @@ #import "OFString.h" @implementation OFChangeOwnerFailedException @synthesize path = _path, owner = _owner, group = _group, errNo = _errNo; -+ (instancetype)exceptionWithPath: (OFString*)path - owner: (OFString*)owner - group: (OFString*)group ++ (instancetype)exceptionWithPath: (OFString *)path + owner: (OFString *)owner + group: (OFString *)group errNo: (int)errNo { return [[[self alloc] initWithPath: path owner: owner group: group @@ -36,13 +36,13 @@ - init { OF_INVALID_INIT_METHOD } -- initWithPath: (OFString*)path - owner: (OFString*)owner - group: (OFString*)group +- initWithPath: (OFString *)path + owner: (OFString *)owner + group: (OFString *)group errNo: (int)errNo { self = [super init]; @try { @@ -65,11 +65,11 @@ [_group release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_group == nil) return [OFString stringWithFormat: @"Failed to change owner of item at path %@ to %@: %@", _path, _owner, of_strerror(_errNo)]; Index: src/exceptions/OFChangePermissionsFailedException.h ================================================================== --- src/exceptions/OFChangePermissionsFailedException.h +++ src/exceptions/OFChangePermissionsFailedException.h @@ -56,11 +56,11 @@ * @param path The path of the item * @param permissions The new permissions for the item * @param errNo The errno of the error that occurred * @return A new, autoreleased change permissions failed exception */ -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path permissions: (mode_t)permissions errNo: (int)errNo; /*! * @brief Initializes an already allocated change permissions failed exception. @@ -68,11 +68,11 @@ * @param path The path of the item * @param permissions The new permissions for the item * @param errNo The errno of the error that occurred * @return An initialized change permissions failed exception */ -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path permissions: (mode_t)permissions errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFChangePermissionsFailedException.m ================================================================== --- src/exceptions/OFChangePermissionsFailedException.m +++ src/exceptions/OFChangePermissionsFailedException.m @@ -20,11 +20,11 @@ #import "OFString.h" @implementation OFChangePermissionsFailedException @synthesize path = _path, permissions = _permissions, errNo = _errNo; -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path permissions: (mode_t)permissions errNo: (int)errNo { return [[[self alloc] initWithPath: path permissions: permissions @@ -34,11 +34,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path permissions: (mode_t)permissions errNo: (int)errNo { self = [super init]; @@ -59,12 +59,12 @@ [_path release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Failed to change permissions of item at path %@ to %d: %@", _path, _permissions, of_strerror(_errNo)]; } @end Index: src/exceptions/OFChecksumFailedException.m ================================================================== --- src/exceptions/OFChecksumFailedException.m +++ src/exceptions/OFChecksumFailedException.m @@ -18,10 +18,10 @@ #import "OFChecksumFailedException.h" #import "OFString.h" @implementation OFChecksumFailedException -- (OFString*)description +- (OFString *)description { return @"Checksum mismatch!"; } @end Index: src/exceptions/OFConditionBroadcastFailedException.h ================================================================== --- src/exceptions/OFConditionBroadcastFailedException.h +++ src/exceptions/OFConditionBroadcastFailedException.h @@ -45,17 +45,17 @@ * @brief Returns a new, autoreleased condition broadcast failed exception. * * @param condition The condition which could not be broadcasted * @return A new, autoreleased condition broadcast failed exception */ -+ (instancetype)exceptionWithCondition: (nullable OFCondition*)condition; ++ (instancetype)exceptionWithCondition: (nullable OFCondition *)condition; /*! * @brief Initializes an already allocated condition broadcast failed exception. * * @param condition The condition which could not be broadcasted * @return An initialized condition broadcast failed exception */ -- initWithCondition: (nullable OFCondition*)condition; +- initWithCondition: (nullable OFCondition *)condition; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFConditionBroadcastFailedException.m ================================================================== --- src/exceptions/OFConditionBroadcastFailedException.m +++ src/exceptions/OFConditionBroadcastFailedException.m @@ -21,16 +21,16 @@ #import "OFCondition.h" @implementation OFConditionBroadcastFailedException @synthesize condition = _condition; -+ (instancetype)exceptionWithCondition: (OFCondition*)condition ++ (instancetype)exceptionWithCondition: (OFCondition *)condition { return [[[self alloc] initWithCondition: condition] autorelease]; } -- initWithCondition: (OFCondition*)condition +- initWithCondition: (OFCondition *)condition { self = [super init]; _condition = [condition retain]; @@ -42,15 +42,15 @@ [_condition release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_condition != nil) return [OFString stringWithFormat: @"Broadcasting a condition of type %@ failed!", [_condition class]]; else return @"Broadcasting a condition failed!"; } @end Index: src/exceptions/OFConditionSignalFailedException.h ================================================================== --- src/exceptions/OFConditionSignalFailedException.h +++ src/exceptions/OFConditionSignalFailedException.h @@ -45,17 +45,17 @@ * @brief Creates a new, autoreleased condition signal failed exception. * * @param condition The condition which could not be signaled * @return A new, autoreleased condition signal failed exception */ -+ (instancetype)exceptionWithCondition: (nullable OFCondition*)condition; ++ (instancetype)exceptionWithCondition: (nullable OFCondition *)condition; /*! * @brief Initializes an already allocated condition signal failed exception. * * @param condition The condition which could not be signaled * @return An initialized condition signal failed exception */ -- initWithCondition: (nullable OFCondition*)condition; +- initWithCondition: (nullable OFCondition *)condition; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFConditionSignalFailedException.m ================================================================== --- src/exceptions/OFConditionSignalFailedException.m +++ src/exceptions/OFConditionSignalFailedException.m @@ -21,16 +21,16 @@ #import "OFCondition.h" @implementation OFConditionSignalFailedException @synthesize condition = _condition; -+ (instancetype)exceptionWithCondition: (OFCondition*)condition ++ (instancetype)exceptionWithCondition: (OFCondition *)condition { return [[[self alloc] initWithCondition: condition] autorelease]; } -- initWithCondition: (OFCondition*)condition +- initWithCondition: (OFCondition *)condition { self = [super init]; _condition = [condition retain]; @@ -42,15 +42,15 @@ [_condition release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_condition != nil) return [OFString stringWithFormat: @"Signaling a condition of type %@ failed!", [_condition class]]; else return @"Signaling a condition failed!"; } @end Index: src/exceptions/OFConditionStillWaitingException.h ================================================================== --- src/exceptions/OFConditionStillWaitingException.h +++ src/exceptions/OFConditionStillWaitingException.h @@ -46,17 +46,17 @@ * @brief Creates a new, autoreleased condition still waiting exception. * * @param condition The condition for which is still being waited * @return A new, autoreleased condition still waiting exception */ -+ (instancetype)exceptionWithCondition: (nullable OFCondition*)condition; ++ (instancetype)exceptionWithCondition: (nullable OFCondition *)condition; /*! * @brief Initializes an already allocated condition still waiting exception. * * @param condition The condition for which is still being waited * @return An initialized condition still waiting exception */ -- initWithCondition: (nullable OFCondition*)condition; +- initWithCondition: (nullable OFCondition *)condition; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFConditionStillWaitingException.m ================================================================== --- src/exceptions/OFConditionStillWaitingException.m +++ src/exceptions/OFConditionStillWaitingException.m @@ -21,16 +21,16 @@ #import "OFCondition.h" @implementation OFConditionStillWaitingException @synthesize condition = _condition; -+ (instancetype)exceptionWithCondition: (OFCondition*)condition ++ (instancetype)exceptionWithCondition: (OFCondition *)condition { return [[[self alloc] initWithCondition: condition] autorelease]; } -- initWithCondition: (OFCondition*)condition +- initWithCondition: (OFCondition *)condition { self = [super init]; _condition = [condition retain]; @@ -42,11 +42,11 @@ [_condition release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_condition != nil) return [OFString stringWithFormat: @"Deallocation of a condition of type %@ was tried, even " "though a thread was still waiting for it!", Index: src/exceptions/OFConditionWaitFailedException.h ================================================================== --- src/exceptions/OFConditionWaitFailedException.h +++ src/exceptions/OFConditionWaitFailedException.h @@ -45,17 +45,17 @@ * @brief Creates a new, autoreleased condition wait failed exception. * * @param condition The condition for which could not be waited * @return A new, autoreleased condition wait failed exception */ -+ (instancetype)exceptionWithCondition: (nullable OFCondition*)condition; ++ (instancetype)exceptionWithCondition: (nullable OFCondition *)condition; /*! * @brief Initializes an already allocated condition wait failed exception. * * @param condition The condition for which could not be waited * @return An initialized condition wait failed exception */ -- initWithCondition: (nullable OFCondition*)condition; +- initWithCondition: (nullable OFCondition *)condition; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFConditionWaitFailedException.m ================================================================== --- src/exceptions/OFConditionWaitFailedException.m +++ src/exceptions/OFConditionWaitFailedException.m @@ -21,16 +21,16 @@ #import "OFCondition.h" @implementation OFConditionWaitFailedException @synthesize condition = _condition; -+ (instancetype)exceptionWithCondition: (OFCondition*)condition ++ (instancetype)exceptionWithCondition: (OFCondition *)condition { return [[[self alloc] initWithCondition: condition] autorelease]; } -- initWithCondition: (OFCondition*)condition +- initWithCondition: (OFCondition *)condition { self = [super init]; _condition = [condition retain]; @@ -42,15 +42,15 @@ [_condition release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_condition != nil) return [OFString stringWithFormat: @"Waiting for a condition of type %@ failed!", [_condition class]]; else return @"Waiting for a condition failed!"; } @end Index: src/exceptions/OFConnectionFailedException.h ================================================================== --- src/exceptions/OFConnectionFailedException.h +++ src/exceptions/OFConnectionFailedException.h @@ -62,11 +62,11 @@ * @param host The host to which the connection failed * @param port The port on the host to which the connection failed * @param socket The socket which could not connect * @return A new, autoreleased connection failed exception */ -+ (instancetype)exceptionWithHost: (OFString*)host ++ (instancetype)exceptionWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket; /*! * @brief Creates a new, autoreleased connection failed exception. @@ -75,11 +75,11 @@ * @param port The port on the host to which the connection failed * @param socket The socket which could not connect * @param errNo The errno of the error that occurred * @return A new, autoreleased connection failed exception */ -+ (instancetype)exceptionWithHost: (OFString*)host ++ (instancetype)exceptionWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket errNo: (int)errNo; /*! @@ -88,11 +88,11 @@ * @param host The host to which the connection failed * @param port The port on the host to which the connection failed * @param socket The socket which could not connect * @return An initialized connection failed exception */ -- initWithHost: (OFString*)host +- initWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket; /*! * @brief Initializes an already allocated connection failed exception. @@ -101,12 +101,12 @@ * @param port The port on the host to which the connection failed * @param socket The socket which could not connect * @param errNo The errno of the error that occurred * @return An initialized connection failed exception */ -- initWithHost: (OFString*)host +- initWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFConnectionFailedException.m ================================================================== --- src/exceptions/OFConnectionFailedException.m +++ src/exceptions/OFConnectionFailedException.m @@ -22,20 +22,20 @@ #import "OFString.h" @implementation OFConnectionFailedException @synthesize host = _host, port = _port, socket = _socket, errNo = _errNo; -+ (instancetype)exceptionWithHost: (OFString*)host ++ (instancetype)exceptionWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket { return [[[self alloc] initWithHost: host port: port socket: socket] autorelease]; } -+ (instancetype)exceptionWithHost: (OFString*)host ++ (instancetype)exceptionWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket errNo: (int)errNo { return [[[self alloc] initWithHost: host @@ -47,11 +47,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithHost: (OFString*)host +- initWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket { self = [super init]; @@ -65,11 +65,11 @@ } return self; } -- initWithHost: (OFString*)host +- initWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket errNo: (int)errNo { self = [super init]; @@ -93,11 +93,11 @@ [_socket release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_errNo != 0) return [OFString stringWithFormat: @"A connection to %@ on port %" @PRIu16 @" could not be " @"established in socket of type %@: %@", Index: src/exceptions/OFCopyItemFailedException.h ================================================================== --- src/exceptions/OFCopyItemFailedException.h +++ src/exceptions/OFCopyItemFailedException.h @@ -51,12 +51,12 @@ * @param sourcePath The original path * @param destinationPath The new path * @param errNo The errno of the error that occurred * @return A new, autoreleased copy item failed exception */ -+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath ++ (instancetype)exceptionWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo; /*! * @brief Initializes an already allocated copy item failed exception. * @@ -63,11 +63,11 @@ * @param sourcePath The original path * @param destinationPath The new path * @param errNo The errno of the error that occurred * @return An initialized copy item failed exception */ -- initWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath +- initWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFCopyItemFailedException.m ================================================================== --- src/exceptions/OFCopyItemFailedException.m +++ src/exceptions/OFCopyItemFailedException.m @@ -21,12 +21,12 @@ @implementation OFCopyItemFailedException @synthesize sourcePath = _sourcePath, destinationPath = _destinationPath; @synthesize errNo = _errNo; -+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath ++ (instancetype)exceptionWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo { return [[[self alloc] initWithSourcePath: sourcePath destinationPath: destinationPath errNo: errNo] autorelease]; @@ -35,12 +35,12 @@ - init { OF_INVALID_INIT_METHOD } -- initWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath +- initWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo { self = [super init]; @try { @@ -61,11 +61,11 @@ [_destinationPath release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Failed to copy item %@ to %@: %@", _sourcePath, _destinationPath, of_strerror(_errNo)]; } @end Index: src/exceptions/OFCreateDirectoryFailedException.h ================================================================== --- src/exceptions/OFCreateDirectoryFailedException.h +++ src/exceptions/OFCreateDirectoryFailedException.h @@ -47,11 +47,11 @@ * @param path A string with the path of the directory which could not be * created * @param errNo The errno of the error that occurred * @return A new, autoreleased create directory failed exception */ -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo; /*! * @brief Initializes an already allocated create directory failed exception. * @@ -58,10 +58,10 @@ * @param path A string with the path of the directory which could not be * created * @param errNo The errno of the error that occurred * @return An initialized create directory failed exception */ -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFCreateDirectoryFailedException.m ================================================================== --- src/exceptions/OFCreateDirectoryFailedException.m +++ src/exceptions/OFCreateDirectoryFailedException.m @@ -20,11 +20,11 @@ #import "OFString.h" @implementation OFCreateDirectoryFailedException @synthesize path = _path, errNo = _errNo; -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo { return [[[self alloc] initWithPath: path errNo: errNo] autorelease]; } @@ -32,11 +32,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path errNo: (int)errNo { self = [super init]; @try { @@ -55,12 +55,12 @@ [_path release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Failed to create directory %@: %@", _path, of_strerror(_errNo)]; } @end Index: src/exceptions/OFCreateSymbolicLinkFailedException.h ================================================================== --- src/exceptions/OFCreateSymbolicLinkFailedException.h +++ src/exceptions/OFCreateSymbolicLinkFailedException.h @@ -51,23 +51,23 @@ * * @param sourcePath The source for the symbolic link * @param destinationPath The destination for the symbolic link * @return A new, autoreleased create symbolic link failed exception */ -+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath; ++ (instancetype)exceptionWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath; /*! * @brief Creates a new, autoreleased create symbolic link failed exception. * * @param sourcePath The source for the symbolic link * @param destinationPath The destination for the symbolic link * @param errNo The errno of the error that occurred * @return A new, autoreleased create symbolic link failed exception */ -+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath ++ (instancetype)exceptionWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo; /*! * @brief Initializes an already allocated create symbolic link failed * exception. @@ -74,12 +74,12 @@ * * @param sourcePath The source for the symbolic link * @param destinationPath The destination for the symbolic link * @return An initialized create symbolic link failed exception */ -- initWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath; +- initWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath; /*! * @brief Initializes an already allocated create symbolic link failed * exception. * @@ -86,11 +86,11 @@ * @param sourcePath The source for the symbolic link * @param destinationPath The destination for the symbolic link * @param errNo The errno of the error that occurred * @return An initialized create symbolic link failed exception */ -- initWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath +- initWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFCreateSymbolicLinkFailedException.m ================================================================== --- src/exceptions/OFCreateSymbolicLinkFailedException.m +++ src/exceptions/OFCreateSymbolicLinkFailedException.m @@ -21,19 +21,19 @@ @implementation OFCreateSymbolicLinkFailedException @synthesize sourcePath = _sourcePath, destinationPath = _destinationPath; @synthesize errNo = _errNo; -+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath ++ (instancetype)exceptionWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath { return [[[self alloc] initWithSourcePath: sourcePath destinationPath: destinationPath] autorelease]; } -+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath ++ (instancetype)exceptionWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo { return [[[self alloc] initWithSourcePath: sourcePath destinationPath: destinationPath errNo: errNo] autorelease]; @@ -42,12 +42,12 @@ - init { OF_INVALID_INIT_METHOD } -- initWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath +- initWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath { self = [super init]; @try { _sourcePath = [sourcePath copy]; @@ -58,12 +58,12 @@ } return self; } -- initWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath +- initWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo { self = [super init]; @try { @@ -84,11 +84,11 @@ [_destinationPath release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_errNo != 0) return [OFString stringWithFormat: @"Failed to create symbolic link %@ with destination " @"%@: %@", _destinationPath, _sourcePath, Index: src/exceptions/OFEnumerationMutationException.m ================================================================== --- src/exceptions/OFEnumerationMutationException.m +++ src/exceptions/OFEnumerationMutationException.m @@ -46,12 +46,12 @@ [_object release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Object of class %@ was mutated during enumeration!", [_object class]]; } @end Index: src/exceptions/OFException.h ================================================================== --- src/exceptions/OFException.h +++ src/exceptions/OFException.h @@ -158,25 +158,25 @@ /*! * @brief Returns a description of the exception. * * @return A description of the exception */ -- (OFString*)description; +- (OFString *)description; /*! * @brief Returns a backtrace of when the exception was created or nil if no * backtrace is available. * * @return A backtrace of when the exception was created */ -- (nullable OFArray*)backtrace; +- (nullable OFArray *)backtrace; @end #ifdef __cplusplus extern "C" { #endif -extern OFString* of_strerror(int errNo); +extern OFString *of_strerror(int errNo); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/exceptions/OFException.m ================================================================== --- src/exceptions/OFException.m +++ src/exceptions/OFException.m @@ -75,15 +75,16 @@ void **backtrace; uint8_t i; }; extern _Unwind_Reason_Code _Unwind_Backtrace( - _Unwind_Reason_Code(*)(struct _Unwind_Context*, void*), void*); + _Unwind_Reason_Code (*)(struct _Unwind_Context *, void *), void *); # ifndef HAVE_ARM_EHABI_EXCEPTIONS -extern uintptr_t _Unwind_GetIP(struct _Unwind_Context*); +extern uintptr_t _Unwind_GetIP(struct _Unwind_Context *); # else -extern int _Unwind_VRS_Get(struct _Unwind_Context*, int, uint32_t, int, void*); +extern int _Unwind_VRS_Get(struct _Unwind_Context *, int, uint32_t, int, + void *); # endif #endif #if !defined(HAVE_STRERROR_R) && defined(OF_HAVE_THREADS) static of_mutex_t mutex; @@ -93,11 +94,11 @@ if (!of_mutex_new(&mutex)) @throw [OFInitializationFailedException exception]; } #endif -OFString* +OFString * of_strerror(int errNo) { OFString *ret; #ifdef HAVE_STRERROR_R char buffer[256]; @@ -226,16 +227,16 @@ { struct backtrace_ctx *bt = data; if (bt->i < OF_BACKTRACE_SIZE) { # ifndef HAVE_ARM_EHABI_EXCEPTIONS - bt->backtrace[bt->i++] = (void*)_Unwind_GetIP(ctx); + bt->backtrace[bt->i++] = (void *)_Unwind_GetIP(ctx); # else uintptr_t ip; _Unwind_VRS_Get(ctx, 0, 15, 0, &ip); - bt->backtrace[bt->i++] = (void*)(ip & ~1); + bt->backtrace[bt->i++] = (void *)(ip & ~1); # endif return _URC_OK; } return _URC_END_OF_STACK; @@ -261,17 +262,17 @@ return self; } #endif -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"An exception of type %@ occurred!", [self class]]; } -- (OFArray*)backtrace +- (OFArray *)backtrace { #ifdef HAVE_DWARF_EXCEPTIONS OFMutableArray *backtrace = [OFMutableArray array]; void *pool = objc_autoreleasePoolPush(); @@ -282,12 +283,12 @@ if (dladdr(_backtrace[i], &info)) { OFString *frame; if (info.dli_sname != NULL) { - ptrdiff_t offset = (char*)_backtrace[i] - - (char*)info.dli_saddr; + ptrdiff_t offset = (char *)_backtrace[i] - + (char *)info.dli_saddr; frame = [OFString stringWithFormat: @"%p <%s+%td> at %s", _backtrace[i], info.dli_sname, offset, info.dli_fname]; Index: src/exceptions/OFGetOptionFailedException.h ================================================================== --- src/exceptions/OFGetOptionFailedException.h +++ src/exceptions/OFGetOptionFailedException.h @@ -47,20 +47,20 @@ * * @param stream The stream for which the option could not be gotten * @param errNo The errno of the error that occurred * @return A new, autoreleased get option failed exception */ -+ (instancetype)exceptionWithStream: (OFStream*)stream ++ (instancetype)exceptionWithStream: (OFStream *)stream errNo: (int)errNo; /*! * @brief Initializes an already allocated get option failed exception. * * @param stream The stream for which the option could not be gotten * @param errNo The errno of the error that occurred * @return An initialized get option failed exception */ -- initWithStream: (OFStream*)stream +- initWithStream: (OFStream *)stream errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFGetOptionFailedException.m ================================================================== --- src/exceptions/OFGetOptionFailedException.m +++ src/exceptions/OFGetOptionFailedException.m @@ -21,11 +21,11 @@ #import "OFStream.h" @implementation OFGetOptionFailedException @synthesize stream = _stream, errNo = _errNo; -+ (instancetype)exceptionWithStream: (OFStream*)stream ++ (instancetype)exceptionWithStream: (OFStream *)stream errNo: (int)errNo { return [[[self alloc] initWithStream: stream errNo: errNo] autorelease]; } @@ -33,11 +33,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithStream: (OFStream*)stream +- initWithStream: (OFStream *)stream errNo: (int)errNo { self = [super init]; _stream = [stream retain]; @@ -51,12 +51,12 @@ [_stream release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Getting an option in a stream of type %@ failed: %@", [_stream class], of_strerror(_errNo)]; } @end Index: src/exceptions/OFHTTPRequestFailedException.h ================================================================== --- src/exceptions/OFHTTPRequestFailedException.h +++ src/exceptions/OFHTTPRequestFailedException.h @@ -53,20 +53,20 @@ * * @param request The HTTP request which failed * @param response The response for the failed HTTP request * @return A new, autoreleased HTTP request failed exception */ -+ (instancetype)exceptionWithRequest: (OFHTTPRequest*)request - response: (OFHTTPResponse*)response; ++ (instancetype)exceptionWithRequest: (OFHTTPRequest *)request + response: (OFHTTPResponse *)response; /*! * @brief Initializes an already allocated HTTP request failed exception. * * @param request The HTTP request which failed * @param response The response for the failed HTTP request * @return A new HTTP request failed exception */ -- initWithRequest: (OFHTTPRequest*)request - response: (OFHTTPResponse*)response; +- initWithRequest: (OFHTTPRequest *)request + response: (OFHTTPResponse *)response; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFHTTPRequestFailedException.m ================================================================== --- src/exceptions/OFHTTPRequestFailedException.m +++ src/exceptions/OFHTTPRequestFailedException.m @@ -22,12 +22,12 @@ #import "OFHTTPResponse.h" @implementation OFHTTPRequestFailedException @synthesize request = _request, response = _response; -+ (instancetype)exceptionWithRequest: (OFHTTPRequest*)request - response: (OFHTTPResponse*)response ++ (instancetype)exceptionWithRequest: (OFHTTPRequest *)request + response: (OFHTTPResponse *)response { return [[[self alloc] initWithRequest: request response: response] autorelease]; } @@ -34,12 +34,12 @@ - init { OF_INVALID_INIT_METHOD } -- initWithRequest: (OFHTTPRequest*)request - response: (OFHTTPResponse*)response +- initWithRequest: (OFHTTPRequest *)request + response: (OFHTTPResponse *)response { self = [super init]; _request = [request retain]; _response = [response retain]; @@ -53,15 +53,15 @@ [_response release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { const char *method = of_http_request_method_to_string([_request method]); return [OFString stringWithFormat: @"An HTTP %s request with URL %@ failed with code %d!", method, [_request URL], [_response statusCode]]; } @end Index: src/exceptions/OFHashAlreadyCalculatedException.m ================================================================== --- src/exceptions/OFHashAlreadyCalculatedException.m +++ src/exceptions/OFHashAlreadyCalculatedException.m @@ -46,12 +46,12 @@ [_object release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"The hash of type %@ has already been calculated and thus no new " @"data can be added!", [_object class]]; } @end Index: src/exceptions/OFInitializationFailedException.m ================================================================== --- src/exceptions/OFInitializationFailedException.m +++ src/exceptions/OFInitializationFailedException.m @@ -34,14 +34,14 @@ _inClass = class; return self; } -- (OFString*)description +- (OFString *)description { if (_inClass != Nil) return [OFString stringWithFormat: @"Initialization failed for or in class %@!", _inClass]; else return @"Initialization failed!"; } @end Index: src/exceptions/OFInvalidArgumentException.m ================================================================== --- src/exceptions/OFInvalidArgumentException.m +++ src/exceptions/OFInvalidArgumentException.m @@ -18,10 +18,10 @@ #import "OFInvalidArgumentException.h" #import "OFString.h" @implementation OFInvalidArgumentException -- (OFString*)description +- (OFString *)description { return @"An invalid argument or receiver has been specified!"; } @end Index: src/exceptions/OFInvalidEncodingException.m ================================================================== --- src/exceptions/OFInvalidEncodingException.m +++ src/exceptions/OFInvalidEncodingException.m @@ -18,10 +18,10 @@ #import "OFInvalidEncodingException.h" #import "OFString.h" @implementation OFInvalidEncodingException -- (OFString*)description +- (OFString *)description { return @"An encoding is invalid!"; } @end Index: src/exceptions/OFInvalidFormatException.m ================================================================== --- src/exceptions/OFInvalidFormatException.m +++ src/exceptions/OFInvalidFormatException.m @@ -18,10 +18,10 @@ #import "OFInvalidFormatException.h" #import "OFString.h" @implementation OFInvalidFormatException -- (OFString*)description +- (OFString *)description { return @"A format is invalid!"; } @end Index: src/exceptions/OFInvalidJSONException.h ================================================================== --- src/exceptions/OFInvalidJSONException.h +++ src/exceptions/OFInvalidJSONException.h @@ -45,20 +45,20 @@ * * @param string The string containing the invalid JSON representation * @param line The line in which the parsing error was encountered * @return A new, autoreleased invalid JSON exception */ -+ (instancetype)exceptionWithString: (OFString*)string ++ (instancetype)exceptionWithString: (OFString *)string line: (size_t)line; /*! * @brief Initializes an already allocated invalid JSON exception. * * @param string The string containing the invalid JSON representation * @param line The line in which the parsing error was encountered * @return An initialized invalid JSON exception */ -- initWithString: (OFString*)string +- initWithString: (OFString *)string line: (size_t)line; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFInvalidJSONException.m ================================================================== --- src/exceptions/OFInvalidJSONException.m +++ src/exceptions/OFInvalidJSONException.m @@ -20,11 +20,11 @@ #import "OFString.h" @implementation OFInvalidJSONException @synthesize string = _string, line = _line; -+ (instancetype)exceptionWithString: (OFString*)string ++ (instancetype)exceptionWithString: (OFString *)string line: (size_t)line { return [[[self alloc] initWithString: string line: line] autorelease]; } @@ -32,11 +32,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithString: (OFString*)string +- initWithString: (OFString *)string line: (size_t)line { self = [super init]; @try { @@ -55,11 +55,11 @@ [_string release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"The JSON representation is invalid in line %zu!", _line]; } @end Index: src/exceptions/OFInvalidServerReplyException.m ================================================================== --- src/exceptions/OFInvalidServerReplyException.m +++ src/exceptions/OFInvalidServerReplyException.m @@ -18,10 +18,10 @@ #import "OFInvalidServerReplyException.h" #import "OFString.h" @implementation OFInvalidServerReplyException -- (OFString*)description +- (OFString *)description { return @"Got an invalid reply from the server!"; } @end Index: src/exceptions/OFLinkFailedException.h ================================================================== --- src/exceptions/OFLinkFailedException.h +++ src/exceptions/OFLinkFailedException.h @@ -50,44 +50,44 @@ * * @param sourcePath The source for the link * @param destinationPath The destination for the link * @return A new, autoreleased link failed exception */ -+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath; ++ (instancetype)exceptionWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath; /*! * @brief Creates a new, autoreleased link failed exception. * * @param sourcePath The source for the link * @param destinationPath The destination for the link * @param errNo The errno of the error that occurred * @return A new, autoreleased link failed exception */ -+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath ++ (instancetype)exceptionWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo; /*! * @brief Initializes an already allocated link failed exception. * * @param sourcePath The source for the link * @param destinationPath The destination for the link * @return An initialized link failed exception */ -- initWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath; +- initWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath; /*! * @brief Initializes an already allocated link failed exception. * * @param sourcePath The source for the link * @param destinationPath The destination for the link * @param errNo The errno of the error that occurred * @return An initialized link failed exception */ -- initWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath +- initWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFLinkFailedException.m ================================================================== --- src/exceptions/OFLinkFailedException.m +++ src/exceptions/OFLinkFailedException.m @@ -21,19 +21,19 @@ @implementation OFLinkFailedException @synthesize sourcePath = _sourcePath, destinationPath = _destinationPath; @synthesize errNo = _errNo; -+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath ++ (instancetype)exceptionWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath { return [[[self alloc] initWithSourcePath: sourcePath destinationPath: destinationPath] autorelease]; } -+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath ++ (instancetype)exceptionWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo { return [[[self alloc] initWithSourcePath: sourcePath destinationPath: destinationPath errNo: errNo] autorelease]; @@ -42,12 +42,12 @@ - init { OF_INVALID_INIT_METHOD } -- initWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath +- initWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath { self = [super init]; @try { _sourcePath = [sourcePath copy]; @@ -58,12 +58,12 @@ } return self; } -- initWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath +- initWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo { self = [super init]; @try { @@ -84,11 +84,11 @@ [_destinationPath release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_errNo != 0) return [OFString stringWithFormat: @"Failed to link file %@ to %@: %@", _sourcePath, _destinationPath, of_strerror(_errNo)]; Index: src/exceptions/OFListenFailedException.m ================================================================== --- src/exceptions/OFListenFailedException.m +++ src/exceptions/OFListenFailedException.m @@ -54,12 +54,12 @@ [_socket release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Failed to listen in socket of type %@ with a back log of %d: %@", [_socket class], _backLog, of_strerror(_errNo)]; } @end Index: src/exceptions/OFLockFailedException.m ================================================================== --- src/exceptions/OFLockFailedException.m +++ src/exceptions/OFLockFailedException.m @@ -41,14 +41,14 @@ [_lock release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_lock != nil) return [OFString stringWithFormat: @"A lock of type %@ could not be locked!", [_lock class]]; else return @"A lock could not be locked!"; } @end Index: src/exceptions/OFMalformedXMLException.h ================================================================== --- src/exceptions/OFMalformedXMLException.h +++ src/exceptions/OFMalformedXMLException.h @@ -40,17 +40,17 @@ * @brief Creates a new, autoreleased malformed XML exception. * * @param parser The parser which encountered malformed XML * @return A new, autoreleased malformed XML exception */ -+ (instancetype)exceptionWithParser: (nullable OFXMLParser*)parser; ++ (instancetype)exceptionWithParser: (nullable OFXMLParser *)parser; /*! * @brief Initializes an already allocated malformed XML exception. * * @param parser The parser which encountered malformed XML * @return An initialized malformed XML exception */ -- initWithParser: (nullable OFXMLParser*)parser; +- initWithParser: (nullable OFXMLParser *)parser; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFMalformedXMLException.m ================================================================== --- src/exceptions/OFMalformedXMLException.m +++ src/exceptions/OFMalformedXMLException.m @@ -21,16 +21,16 @@ #import "OFXMLParser.h" @implementation OFMalformedXMLException @synthesize parser = _parser; -+ (instancetype)exceptionWithParser: (OFXMLParser*)parser ++ (instancetype)exceptionWithParser: (OFXMLParser *)parser { return [[[self alloc] initWithParser: parser] autorelease]; } -- initWithParser: (OFXMLParser*)parser +- initWithParser: (OFXMLParser *)parser { self = [super init]; _parser = [parser retain]; @@ -42,15 +42,15 @@ [_parser release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_parser != nil) return [OFString stringWithFormat: @"An XML parser of type %@ encountered malformed XML in " @"line %zu!", [_parser class], [_parser lineNumber]]; else return @"An XML parser encountered malformed XML!"; } @end Index: src/exceptions/OFMemoryNotPartOfObjectException.h ================================================================== --- src/exceptions/OFMemoryNotPartOfObjectException.h +++ src/exceptions/OFMemoryNotPartOfObjectException.h @@ -46,20 +46,20 @@ * * @param pointer A pointer to the memory that is not part of the object * @param object The object which the memory is not part of * @return A new, autoreleased memory not part of object exception */ -+ (instancetype)exceptionWithPointer: (void*)pointer ++ (instancetype)exceptionWithPointer: (void *)pointer object: (id)object; /*! * @brief Initializes an already allocated memory not part of object exception. * * @param pointer A pointer to the memory that is not part of the object * @param object The object which the memory is not part of * @return An initialized memory not part of object exception */ -- initWithPointer: (void*)pointer +- initWithPointer: (void *)pointer object: (id)object; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFMemoryNotPartOfObjectException.m ================================================================== --- src/exceptions/OFMemoryNotPartOfObjectException.m +++ src/exceptions/OFMemoryNotPartOfObjectException.m @@ -20,11 +20,11 @@ #import "OFString.h" @implementation OFMemoryNotPartOfObjectException @synthesize pointer = _pointer, object = _object; -+ (instancetype)exceptionWithPointer: (void*)pointer ++ (instancetype)exceptionWithPointer: (void *)pointer object: (id)object { return [[[self alloc] initWithPointer: pointer object: object] autorelease]; } @@ -32,11 +32,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithPointer: (void*)pointer +- initWithPointer: (void *)pointer object: (id)object { self = [super init]; _pointer = pointer; @@ -50,14 +50,14 @@ [_object release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Deallocation or reallocation of memory not allocated as part of " @"object of type %@ was attempted! It is also possible that there " @"was an attempt to free the same memory twice.", [_object class]]; } @end Index: src/exceptions/OFMoveItemFailedException.h ================================================================== --- src/exceptions/OFMoveItemFailedException.h +++ src/exceptions/OFMoveItemFailedException.h @@ -51,12 +51,12 @@ * @param sourcePath The original path * @param destinationPath The new path * @param errNo The errno of the error that occurred * @return A new, autoreleased move item failed exception */ -+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath ++ (instancetype)exceptionWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo; /*! * @brief Initializes an already allocated move item failed exception. * @@ -63,11 +63,11 @@ * @param sourcePath The original path * @param destinationPath The new path * @param errNo The errno of the error that occurred * @return An initialized move item failed exception */ -- initWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath +- initWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFMoveItemFailedException.m ================================================================== --- src/exceptions/OFMoveItemFailedException.m +++ src/exceptions/OFMoveItemFailedException.m @@ -21,12 +21,12 @@ @implementation OFMoveItemFailedException @synthesize sourcePath = _sourcePath, destinationPath = _destinationPath; @synthesize errNo = _errNo; -+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath ++ (instancetype)exceptionWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo { return [[[self alloc] initWithSourcePath: sourcePath destinationPath: destinationPath errNo: errNo] autorelease]; @@ -35,12 +35,12 @@ - init { OF_INVALID_INIT_METHOD } -- initWithSourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath +- initWithSourcePath: (OFString *)sourcePath + destinationPath: (OFString *)destinationPath errNo: (int)errNo { self = [super init]; @try { @@ -61,12 +61,12 @@ [_destinationPath release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Failed to move item at path %@ to %@: %@", _sourcePath, _destinationPath, of_strerror(_errNo)]; } @end Index: src/exceptions/OFNotImplementedException.m ================================================================== --- src/exceptions/OFNotImplementedException.m +++ src/exceptions/OFNotImplementedException.m @@ -50,12 +50,12 @@ [_object release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"The selector %s is not understood by an object of type %@ or not " @"(fully) implemented!", sel_getName(_selector), [_object class]]; } @end Index: src/exceptions/OFNotOpenException.m ================================================================== --- src/exceptions/OFNotOpenException.m +++ src/exceptions/OFNotOpenException.m @@ -46,12 +46,12 @@ [_object release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"The object of type %@ is not open, connected or bound!", [_object class]]; } @end Index: src/exceptions/OFObserveFailedException.h ================================================================== --- src/exceptions/OFObserveFailedException.h +++ src/exceptions/OFObserveFailedException.h @@ -47,20 +47,20 @@ * * @param observer The observer which failed to observe * @param errNo The errno of the error that occurred * @return A new, autoreleased observe failed exception */ -+ (instancetype)exceptionWithObserver: (OFKernelEventObserver*)observer ++ (instancetype)exceptionWithObserver: (OFKernelEventObserver *)observer errNo: (int)errNo; /*! * @brief Initializes an already allocated observe failed exception. * * @param observer The observer which failed to observe * @param errNo The errno of the error that occurred * @return An initialized observe failed exception */ -- initWithObserver: (OFKernelEventObserver*)observer +- initWithObserver: (OFKernelEventObserver *)observer errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFObserveFailedException.m ================================================================== --- src/exceptions/OFObserveFailedException.m +++ src/exceptions/OFObserveFailedException.m @@ -21,11 +21,11 @@ #import "OFKernelEventObserver.h" @implementation OFObserveFailedException @synthesize observer = _observer, errNo = _errNo; -+ (instancetype)exceptionWithObserver: (OFKernelEventObserver*)observer ++ (instancetype)exceptionWithObserver: (OFKernelEventObserver *)observer errNo: (int)errNo { return [[[self alloc] initWithObserver: observer errNo: errNo] autorelease]; } @@ -33,11 +33,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithObserver: (OFKernelEventObserver*)observer +- initWithObserver: (OFKernelEventObserver *)observer errNo: (int)errNo { self = [super init]; @try { @@ -56,12 +56,12 @@ [_observer release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"An observer of class %@ failed to observe: %@", [_observer className], of_strerror(_errNo)]; } @end Index: src/exceptions/OFOpenItemFailedException.h ================================================================== --- src/exceptions/OFOpenItemFailedException.h +++ src/exceptions/OFOpenItemFailedException.h @@ -49,30 +49,30 @@ * @brief Creates a new, autoreleased open item failed exception. * * @param path A string with the path of the item tried to open * @return A new, autoreleased open item failed exception */ -+ (instancetype)exceptionWithPath: (OFString*)path; ++ (instancetype)exceptionWithPath: (OFString *)path; /*! * @brief Creates a new, autoreleased open item failed exception. * * @param path A string with the path of the item tried to open * @param mode A string with the mode in which the item should have been opened * @return A new, autoreleased open item failed exception */ -+ (instancetype)exceptionWithPath: (OFString*)path - mode: (nullable OFString*)mode; ++ (instancetype)exceptionWithPath: (OFString *)path + mode: (nullable OFString *)mode; /*! * @brief Creates a new, autoreleased open item failed exception. * * @param path A string with the path of the item tried to open * @param errNo The errno of the error that occurred * @return A new, autoreleased open item failed exception */ -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo; /*! * @brief Creates a new, autoreleased open item failed exception. * @@ -79,40 +79,40 @@ * @param path A string with the path of the item tried to open * @param mode A string with the mode in which the item should have been opened * @param errNo The errno of the error that occurred * @return A new, autoreleased open item failed exception */ -+ (instancetype)exceptionWithPath: (OFString*)path - mode: (nullable OFString*)mode ++ (instancetype)exceptionWithPath: (OFString *)path + mode: (nullable OFString *)mode errNo: (int)errNo; /*! * @brief Initializes an already allocated open item failed exception. * * @param path A string with the path of the item which could not be opened * @return An initialized open item failed exception */ -- initWithPath: (OFString*)path; +- initWithPath: (OFString *)path; /*! * @brief Initializes an already allocated open item failed exception. * * @param path A string with the path of the item which could not be opened * @param mode A string with the mode in which the item should have been opened * @return An initialized open item failed exception */ -- initWithPath: (OFString*)path - mode: (nullable OFString*)mode; +- initWithPath: (OFString *)path + mode: (nullable OFString *)mode; /*! * @brief Initializes an already allocated open item failed exception. * * @param path A string with the path of the item which could not be opened * @param errNo The errno of the error that occurred * @return An initialized open item failed exception */ -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path errNo: (int)errNo; /*! * @brief Initializes an already allocated open item failed exception. * @@ -119,11 +119,11 @@ * @param path A string with the path of the item which could not be opened * @param mode A string with the mode in which the item should have been opened * @param errNo The errno of the error that occurred * @return An initialized open item failed exception */ -- initWithPath: (OFString*)path - mode: (nullable OFString*)mode +- initWithPath: (OFString *)path + mode: (nullable OFString *)mode errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFOpenItemFailedException.m ================================================================== --- src/exceptions/OFOpenItemFailedException.m +++ src/exceptions/OFOpenItemFailedException.m @@ -20,31 +20,31 @@ #import "OFString.h" @implementation OFOpenItemFailedException @synthesize path = _path, mode = _mode, errNo = _errNo; -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path { return [[[self alloc] initWithPath: path] autorelease]; } -+ (instancetype)exceptionWithPath: (OFString*)path - mode: (OFString*)mode ++ (instancetype)exceptionWithPath: (OFString *)path + mode: (OFString *)mode { return [[[self alloc] initWithPath: path mode: mode] autorelease]; } -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo { return [[[self alloc] initWithPath: path errNo: errNo] autorelease]; } -+ (instancetype)exceptionWithPath: (OFString*)path - mode: (OFString*)mode ++ (instancetype)exceptionWithPath: (OFString *)path + mode: (OFString *)mode errNo: (int)errNo { return [[[self alloc] initWithPath: path mode: mode errNo: errNo] autorelease]; @@ -53,11 +53,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path { self = [super init]; @try { _path = [path copy]; @@ -67,12 +67,12 @@ } return self; } -- initWithPath: (OFString*)path - mode: (OFString*)mode +- initWithPath: (OFString *)path + mode: (OFString *)mode { self = [super init]; @try { _path = [path copy]; @@ -83,11 +83,11 @@ } return self; } -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path errNo: (int)errNo { self = [super init]; @try { @@ -99,12 +99,12 @@ } return self; } -- initWithPath: (OFString*)path - mode: (OFString*)mode +- initWithPath: (OFString *)path + mode: (OFString *)mode errNo: (int)errNo { self = [super init]; @try { @@ -125,11 +125,11 @@ [_mode release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_mode != nil) { if (_errNo != 0) return [OFString stringWithFormat: @"Failed to open item %@ with mode %@: %@", Index: src/exceptions/OFOutOfMemoryException.m ================================================================== --- src/exceptions/OFOutOfMemoryException.m +++ src/exceptions/OFOutOfMemoryException.m @@ -35,14 +35,14 @@ _requestedSize = requestedSize; return self; } -- (OFString*)description +- (OFString *)description { if (_requestedSize != 0) return [OFString stringWithFormat: @"Could not allocate %zu bytes!", _requestedSize]; else return @"Could not allocate enough memory!"; } @end Index: src/exceptions/OFOutOfRangeException.m ================================================================== --- src/exceptions/OFOutOfRangeException.m +++ src/exceptions/OFOutOfRangeException.m @@ -18,10 +18,10 @@ #import "OFOutOfRangeException.h" #import "OFString.h" @implementation OFOutOfRangeException -- (OFString*)description +- (OFString *)description { return @"Value out of range!"; } @end Index: src/exceptions/OFReadFailedException.m ================================================================== --- src/exceptions/OFReadFailedException.m +++ src/exceptions/OFReadFailedException.m @@ -18,11 +18,11 @@ #import "OFReadFailedException.h" #import "OFString.h" @implementation OFReadFailedException -- (OFString*)description +- (OFString *)description { if (_errNo != 0) return [OFString stringWithFormat: @"Failed to read %zu bytes from an object of type %@: %@", _requestedLength, [_object class], of_strerror(_errNo)]; Index: src/exceptions/OFReadOrWriteFailedException.m ================================================================== --- src/exceptions/OFReadOrWriteFailedException.m +++ src/exceptions/OFReadOrWriteFailedException.m @@ -73,11 +73,11 @@ [_object release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_errNo != 0) return [OFString stringWithFormat: @"Failed to read or write %zu bytes from / to an object of " @"type %@: %@", Index: src/exceptions/OFRemoveItemFailedException.h ================================================================== --- src/exceptions/OFRemoveItemFailedException.h +++ src/exceptions/OFRemoveItemFailedException.h @@ -45,20 +45,20 @@ * * @param path The path of the item which could not be removed * @param errNo The errno of the error that occurred * @return A new, autoreleased remove item failed exception */ -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo; /*! * @brief Initializes an already allocated remove failed exception. * * @param path The path of the item which could not be removed * @param errNo The errno of the error that occurred * @return An initialized remove item failed exception */ -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFRemoveItemFailedException.m ================================================================== --- src/exceptions/OFRemoveItemFailedException.m +++ src/exceptions/OFRemoveItemFailedException.m @@ -20,11 +20,11 @@ #import "OFString.h" @implementation OFRemoveItemFailedException @synthesize path = _path, errNo = _errNo; -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo { return [[[self alloc] initWithPath: path errNo: errNo] autorelease]; } @@ -32,11 +32,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path errNo: (int)errNo { self = [super init]; @try { @@ -55,12 +55,12 @@ [_path release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Failed to remove item at path %@: %@", _path, of_strerror(_errNo)]; } @end Index: src/exceptions/OFSandboxActivationFailedException.h ================================================================== --- src/exceptions/OFSandboxActivationFailedException.h +++ src/exceptions/OFSandboxActivationFailedException.h @@ -48,20 +48,20 @@ * * @param sandbox The sandbox which could not be activated * @param errNo The errno of the error that occurred * @return A new, autoreleased sandboxing failed exception */ -+ (instancetype)exceptionWithSandbox: (OFSandbox*)sandbox ++ (instancetype)exceptionWithSandbox: (OFSandbox *)sandbox errNo: (int)errNo; /*! * @brief Initializes an already allocated sandboxing failed exception. * * @param sandbox The sandbox which could not be activated * @param errNo The errno of the error that occurred * @return An initialized sandboxing failed exception */ -- initWithSandbox: (OFSandbox*)sandbox +- initWithSandbox: (OFSandbox *)sandbox errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFSandboxActivationFailedException.m ================================================================== --- src/exceptions/OFSandboxActivationFailedException.m +++ src/exceptions/OFSandboxActivationFailedException.m @@ -21,11 +21,11 @@ #import "OFSandbox.h" @implementation OFSandboxActivationFailedException @synthesize sandbox = _sandbox, errNo = _errNo; -+ (instancetype)exceptionWithSandbox: (OFSandbox*)sandbox ++ (instancetype)exceptionWithSandbox: (OFSandbox *)sandbox errNo: (int)errNo { return [[[self alloc] initWithSandbox: sandbox errNo: errNo] autorelease]; } @@ -33,11 +33,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithSandbox: (OFSandbox*)sandbox +- initWithSandbox: (OFSandbox *)sandbox errNo: (int)errNo { self = [super init]; _sandbox = [sandbox retain]; @@ -51,11 +51,11 @@ [_sandbox release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"The sandbox could not be applied: %@", of_strerror(_errNo)]; } @end Index: src/exceptions/OFSeekFailedException.h ================================================================== --- src/exceptions/OFSeekFailedException.h +++ src/exceptions/OFSeekFailedException.h @@ -59,11 +59,11 @@ * @param offset The offset to which seeking failed * @param whence To what the offset is relative * @param errNo The errno of the error that occurred * @return A new, autoreleased seek failed exception */ -+ (instancetype)exceptionWithStream: (OFSeekableStream*)stream ++ (instancetype)exceptionWithStream: (OFSeekableStream *)stream offset: (of_offset_t)offset whence: (int)whence errNo: (int)errNo; /*! @@ -73,12 +73,12 @@ * @param offset The offset to which seeking failed * @param whence To what the offset is relative * @param errNo The errno of the error that occurred * @return An initialized seek failed exception */ -- initWithStream: (OFSeekableStream*)stream +- initWithStream: (OFSeekableStream *)stream offset: (of_offset_t)offset whence: (int)whence errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFSeekFailedException.m ================================================================== --- src/exceptions/OFSeekFailedException.m +++ src/exceptions/OFSeekFailedException.m @@ -22,11 +22,11 @@ @implementation OFSeekFailedException @synthesize stream = _stream, offset = _offset, whence = _whence; @synthesize errNo = _errNo; -+ (instancetype)exceptionWithStream: (OFSeekableStream*)stream ++ (instancetype)exceptionWithStream: (OFSeekableStream *)stream offset: (of_offset_t)offset whence: (int)whence errNo: (int)errNo { return [[[self alloc] initWithStream: stream @@ -38,11 +38,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithStream: (OFSeekableStream*)stream +- initWithStream: (OFSeekableStream *)stream offset: (of_offset_t)offset whence: (int)whence errNo: (int)errNo { self = [super init]; @@ -60,12 +60,12 @@ [_stream release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Seeking failed in stream of type %@: %@", [_stream class], of_strerror(_errNo)]; } @end Index: src/exceptions/OFSetOptionFailedException.h ================================================================== --- src/exceptions/OFSetOptionFailedException.h +++ src/exceptions/OFSetOptionFailedException.h @@ -47,20 +47,20 @@ * * @param stream The stream for which the option could not be set * @param errNo The errno of the error that occurred * @return A new, autoreleased set option failed exception */ -+ (instancetype)exceptionWithStream: (OFStream*)stream ++ (instancetype)exceptionWithStream: (OFStream *)stream errNo: (int)errNo; /*! * @brief Initializes an already allocated set option failed exception. * * @param stream The stream for which the option could not be set * @param errNo The errno of the error that occurred * @return An initialized set option failed exception */ -- initWithStream: (OFStream*)stream +- initWithStream: (OFStream *)stream errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFSetOptionFailedException.m ================================================================== --- src/exceptions/OFSetOptionFailedException.m +++ src/exceptions/OFSetOptionFailedException.m @@ -21,11 +21,11 @@ #import "OFStream.h" @implementation OFSetOptionFailedException @synthesize stream = _stream, errNo = _errNo; -+ (instancetype)exceptionWithStream: (OFStream*)stream ++ (instancetype)exceptionWithStream: (OFStream *)stream errNo: (int)errNo { return [[[self alloc] initWithStream: stream errNo: errNo] autorelease]; } @@ -33,11 +33,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithStream: (OFStream*)stream +- initWithStream: (OFStream *)stream errNo: (int)errNo { self = [super init]; _stream = [stream retain]; @@ -51,12 +51,12 @@ [_stream release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Setting an option in a stream of type %@ failed: %@", [_stream class], of_strerror(_errNo)]; } @end Index: src/exceptions/OFStatItemFailedException.h ================================================================== --- src/exceptions/OFStatItemFailedException.h +++ src/exceptions/OFStatItemFailedException.h @@ -45,40 +45,40 @@ * * @param path A string with the path of the item whose status could not be * retrieved * @return A new, autoreleased stat item failed exception */ -+ (instancetype)exceptionWithPath: (OFString*)path; ++ (instancetype)exceptionWithPath: (OFString *)path; /*! * @brief Creates a new, autoreleased stat item failed exception. * * @param path A string with the path of the item whose status could not be * retrieved * @param errNo The errno of the error that occurred * @return A new, autoreleased stat item failed exception */ -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo; /*! * @brief Initializes an already allocated stat item failed exception. * * @param path A string with the path of the item whose status could not be * retrieved * @return An initialized stat item failed exception */ -- initWithPath: (OFString*)path; +- initWithPath: (OFString *)path; /*! * @brief Initializes an already allocated stat item failed exception. * * @param path A string with the path of the item whose status could not be * retrieved * @param errNo The errno of the error that occurred * @return An initialized stat item failed exception */ -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path errNo: (int)errNo; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFStatItemFailedException.m ================================================================== --- src/exceptions/OFStatItemFailedException.m +++ src/exceptions/OFStatItemFailedException.m @@ -20,16 +20,16 @@ #import "OFString.h" @implementation OFStatItemFailedException @synthesize path = _path, errNo = _errNo; -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path { return [[[self alloc] initWithPath: path] autorelease]; } -+ (instancetype)exceptionWithPath: (OFString*)path ++ (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo { return [[[self alloc] initWithPath: path errNo: errNo] autorelease]; } @@ -37,11 +37,11 @@ - init { OF_INVALID_INIT_METHOD } -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path { self = [super init]; @try { _path = [path copy]; @@ -51,11 +51,11 @@ } return self; } -- initWithPath: (OFString*)path +- initWithPath: (OFString *)path errNo: (int)errNo { self = [super init]; @try { @@ -74,15 +74,15 @@ [_path release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_errNo != 0) return [OFString stringWithFormat: @"Failed to stat item %@: %@", _path, of_strerror(_errNo)]; else return [OFString stringWithFormat: @"Failed to stat item %@!", _path]; } @end Index: src/exceptions/OFStillLockedException.m ================================================================== --- src/exceptions/OFStillLockedException.m +++ src/exceptions/OFStillLockedException.m @@ -41,11 +41,11 @@ [_lock release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_lock != nil) return [OFString stringWithFormat: @"Deallocation of a lock of type %@ even though it was " @"still locked!", [_lock class]]; Index: src/exceptions/OFThreadJoinFailedException.h ================================================================== --- src/exceptions/OFThreadJoinFailedException.h +++ src/exceptions/OFThreadJoinFailedException.h @@ -44,17 +44,17 @@ * @brief Creates a new, autoreleased thread join failed exception. * * @param thread The thread which could not be joined * @return A new, autoreleased thread join failed exception */ -+ (instancetype)exceptionWithThread: (nullable OFThread*)thread; ++ (instancetype)exceptionWithThread: (nullable OFThread *)thread; /*! * @brief Initializes an already allocated thread join failed exception. * * @param thread The thread which could not be joined * @return An initialized thread join failed exception */ -- initWithThread: (nullable OFThread*)thread; +- initWithThread: (nullable OFThread *)thread; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFThreadJoinFailedException.m ================================================================== --- src/exceptions/OFThreadJoinFailedException.m +++ src/exceptions/OFThreadJoinFailedException.m @@ -21,16 +21,16 @@ #import "OFThread.h" @implementation OFThreadJoinFailedException @synthesize thread = _thread; -+ (instancetype)exceptionWithThread: (OFThread*)thread ++ (instancetype)exceptionWithThread: (OFThread *)thread { return [[[self alloc] initWithThread: thread] autorelease]; } -- initWithThread: (OFThread*)thread +- initWithThread: (OFThread *)thread { self = [super init]; _thread = [thread retain]; @@ -42,11 +42,11 @@ [_thread release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_thread != nil) return [OFString stringWithFormat: @"Joining a thread of type %@ failed! Most likely, another " @"thread already waits for the thread to join.", Index: src/exceptions/OFThreadStartFailedException.h ================================================================== --- src/exceptions/OFThreadStartFailedException.h +++ src/exceptions/OFThreadStartFailedException.h @@ -44,17 +44,17 @@ * @brief Creates a new, autoreleased thread start failed exception. * * @param thread The thread which could not be started * @return A new, autoreleased thread start failed exception */ -+ (instancetype)exceptionWithThread: (nullable OFThread*)thread; ++ (instancetype)exceptionWithThread: (nullable OFThread *)thread; /*! * @brief Initializes an already allocated thread start failed exception. * * @param thread The thread which could not be started * @return An initialized thread start failed exception */ -- initWithThread: (nullable OFThread*)thread; +- initWithThread: (nullable OFThread *)thread; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFThreadStartFailedException.m ================================================================== --- src/exceptions/OFThreadStartFailedException.m +++ src/exceptions/OFThreadStartFailedException.m @@ -21,16 +21,16 @@ #import "OFThread.h" @implementation OFThreadStartFailedException @synthesize thread = _thread; -+ (instancetype)exceptionWithThread: (OFThread*)thread ++ (instancetype)exceptionWithThread: (OFThread *)thread { return [[[self alloc] initWithThread: thread] autorelease]; } -- initWithThread: (OFThread*)thread +- initWithThread: (OFThread *)thread { self = [super init]; _thread = [thread retain]; @@ -42,14 +42,14 @@ [_thread release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_thread != nil) return [OFString stringWithFormat: @"Starting a thread of type %@ failed!", [_thread class]]; else return @"Starting a thread failed!"; } @end Index: src/exceptions/OFThreadStillRunningException.h ================================================================== --- src/exceptions/OFThreadStillRunningException.h +++ src/exceptions/OFThreadStillRunningException.h @@ -44,17 +44,17 @@ * @brief Creates a new, autoreleased thread still running exception. * * @param thread The thread which is still running * @return A new, autoreleased thread still running exception */ -+ (instancetype)exceptionWithThread: (nullable OFThread*)thread; ++ (instancetype)exceptionWithThread: (nullable OFThread *)thread; /*! * @brief Initializes an already allocated thread still running exception. * * @param thread The thread which is still running * @return An initialized thread still running exception */ -- initWithThread: (nullable OFThread*)thread; +- initWithThread: (nullable OFThread *)thread; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFThreadStillRunningException.m ================================================================== --- src/exceptions/OFThreadStillRunningException.m +++ src/exceptions/OFThreadStillRunningException.m @@ -21,16 +21,16 @@ #import "OFThread.h" @implementation OFThreadStillRunningException @synthesize thread = _thread; -+ (instancetype)exceptionWithThread: (OFThread*)thread ++ (instancetype)exceptionWithThread: (OFThread *)thread { return [[[self alloc] initWithThread: thread] autorelease]; } -- initWithThread: (OFThread*)thread +- initWithThread: (OFThread *)thread { self = [super init]; _thread = [thread retain]; @@ -42,11 +42,11 @@ [_thread release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_thread) return [OFString stringWithFormat: @"Deallocation of a thread of type %@ was tried, even " @"though it was still running!", Index: src/exceptions/OFTruncatedDataException.m ================================================================== --- src/exceptions/OFTruncatedDataException.m +++ src/exceptions/OFTruncatedDataException.m @@ -18,11 +18,11 @@ #import "OFTruncatedDataException.h" #import "OFString.h" @implementation OFTruncatedDataException -- (OFString*)description +- (OFString *)description { return @"Truncated data was received or produced when it should not " @"have been truncated!"; } @end Index: src/exceptions/OFUnboundNamespaceException.h ================================================================== --- src/exceptions/OFUnboundNamespaceException.h +++ src/exceptions/OFUnboundNamespaceException.h @@ -51,20 +51,20 @@ * * @param namespace_ The namespace which is unbound * @param element The element in which the namespace was not bound * @return A new, autoreleased unbound namespace exception */ -+ (instancetype)exceptionWithNamespace: (OFString*)namespace_ - element: (OFXMLElement*)element; ++ (instancetype)exceptionWithNamespace: (OFString *)namespace_ + element: (OFXMLElement *)element; /*! * @brief Initializes an already allocated unbound namespace exception. * * @param namespace_ The namespace which is unbound * @param element The element in which the namespace was not bound * @return An initialized unbound namespace exception */ -- initWithNamespace: (OFString*)namespace_ - element: (OFXMLElement*)element; +- initWithNamespace: (OFString *)namespace_ + element: (OFXMLElement *)element; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFUnboundNamespaceException.m ================================================================== --- src/exceptions/OFUnboundNamespaceException.m +++ src/exceptions/OFUnboundNamespaceException.m @@ -21,12 +21,12 @@ #import "OFXMLElement.h" @implementation OFUnboundNamespaceException @synthesize namespace = _namespace, element = _element; -+ (instancetype)exceptionWithNamespace: (OFString*)namespace - element: (OFXMLElement*)element ++ (instancetype)exceptionWithNamespace: (OFString *)namespace + element: (OFXMLElement *)element { return [[[self alloc] initWithNamespace: namespace element: element] autorelease]; } @@ -33,12 +33,12 @@ - init { OF_INVALID_INIT_METHOD } -- initWithNamespace: (OFString*)namespace - element: (OFXMLElement*)element +- initWithNamespace: (OFString *)namespace + element: (OFXMLElement *)element { self = [super init]; @try { _namespace = [namespace copy]; @@ -57,12 +57,12 @@ [_element release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"The namespace %@ is not bound in an element of type %@!", _namespace, [_element class]]; } @end Index: src/exceptions/OFUnboundPrefixException.h ================================================================== --- src/exceptions/OFUnboundPrefixException.h +++ src/exceptions/OFUnboundPrefixException.h @@ -47,20 +47,20 @@ * * @param prefix The prefix which is unbound * @param parser The parser which encountered the unbound prefix * @return A new, autoreleased unbound prefix exception */ -+ (instancetype)exceptionWithPrefix: (OFString*)prefix - parser: (OFXMLParser*)parser; ++ (instancetype)exceptionWithPrefix: (OFString *)prefix + parser: (OFXMLParser *)parser; /*! * @brief Initializes an already allocated unbound prefix exception. * * @param prefix The prefix which is unbound * @param parser The parser which encountered the unbound prefix * @return An initialized unbound prefix exception */ -- initWithPrefix: (OFString*)prefix - parser: (OFXMLParser*)parser; +- initWithPrefix: (OFString *)prefix + parser: (OFXMLParser *)parser; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFUnboundPrefixException.m ================================================================== --- src/exceptions/OFUnboundPrefixException.m +++ src/exceptions/OFUnboundPrefixException.m @@ -21,12 +21,12 @@ #import "OFXMLParser.h" @implementation OFUnboundPrefixException @synthesize prefix = _prefix, parser = _parser; -+ (instancetype)exceptionWithPrefix: (OFString*)prefix - parser: (OFXMLParser*)parser ++ (instancetype)exceptionWithPrefix: (OFString *)prefix + parser: (OFXMLParser *)parser { return [[[self alloc] initWithPrefix: prefix parser: parser] autorelease]; } @@ -33,12 +33,12 @@ - init { OF_INVALID_INIT_METHOD } -- initWithPrefix: (OFString*)prefix - parser: (OFXMLParser*)parser +- initWithPrefix: (OFString *)prefix + parser: (OFXMLParser *)parser { self = [super init]; @try { _prefix = [prefix copy]; @@ -57,12 +57,12 @@ [_parser release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"An XML parser of type %@ encountered the unbound prefix %@ in " @"line %zu!", [_parser class], _prefix, [_parser lineNumber]]; } @end Index: src/exceptions/OFUndefinedKeyException.h ================================================================== --- src/exceptions/OFUndefinedKeyException.h +++ src/exceptions/OFUndefinedKeyException.h @@ -53,11 +53,11 @@ * @param key The key which is undefined * * @return A new, autoreleased undefined key exception */ + (instancetype)exceptionWithObject: (id)object - key: (OFString*)key; + key: (OFString *)key; /*! * @brief Creates a new, autoreleased undefined key exception. * * @param object The object on which the key is undefined @@ -65,11 +65,11 @@ * @param value The value for the undefined key * * @return A new, autoreleased undefined key exception */ + (instancetype)exceptionWithObject: (id)object - key: (OFString*)key + key: (OFString *)key value: (id)value; /*! * @brief Initializes an already allocated undefined key exception. * @@ -77,11 +77,11 @@ * @param key The key which is undefined * * @return An initialized undefined key exception */ - initWithObject: (id)object - key: (OFString*)key; + key: (OFString *)key; /*! * @brief Initializes an already allocated undefined key exception. * * @param object The object on which the key is undefined @@ -89,10 +89,10 @@ * @param value The value for the undefined key * * @return An initialized undefined key exception */ - initWithObject: (id)object - key: (OFString*)key + key: (OFString *)key value: (id)value; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFUndefinedKeyException.m ================================================================== --- src/exceptions/OFUndefinedKeyException.m +++ src/exceptions/OFUndefinedKeyException.m @@ -21,18 +21,18 @@ @implementation OFUndefinedKeyException @synthesize object = _object, key = _key, value = _value; + (instancetype)exceptionWithObject: (id)object - key: (OFString*)key + key: (OFString *)key { return [[[self alloc] initWithObject: object key: key] autorelease]; } + (instancetype)exceptionWithObject: (id)object - key: (OFString*)key + key: (OFString *)key value: (id)value { return [[[self alloc] initWithObject: object key: key value: value] autorelease]; @@ -42,11 +42,11 @@ { OF_INVALID_INIT_METHOD } - initWithObject: (id)object - key: (OFString*)key + key: (OFString *)key { self = [super init]; @try { _object = [object retain]; @@ -58,11 +58,11 @@ return self; } - initWithObject: (id)object - key: (OFString*)key + key: (OFString *)key value: (id)value { self = [super init]; @try { @@ -84,12 +84,12 @@ [_value release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"The key \"%@\" is undefined for an object of type %@!", _key, [_object className]]; } @end Index: src/exceptions/OFUnknownXMLEntityException.h ================================================================== --- src/exceptions/OFUnknownXMLEntityException.h +++ src/exceptions/OFUnknownXMLEntityException.h @@ -39,17 +39,17 @@ * @brief Creates a new, autoreleased unknown XML entity exception. * * @param entityName The name of the unknown XML entity * @return A new, autoreleased unknown XML entity exception */ -+ (instancetype)exceptionWithEntityName: (OFString*)entityName; ++ (instancetype)exceptionWithEntityName: (OFString *)entityName; /*! * @brief Initializes an already allocated unknown XML entity exception. * * @param entityName The name of the unknown XML entity * @return An initialized unknown XML entity exception */ -- initWithEntityName: (OFString*)entityName; +- initWithEntityName: (OFString *)entityName; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFUnknownXMLEntityException.m ================================================================== --- src/exceptions/OFUnknownXMLEntityException.m +++ src/exceptions/OFUnknownXMLEntityException.m @@ -20,16 +20,16 @@ #import "OFString.h" @implementation OFUnknownXMLEntityException @synthesize entityName = _entityName; -+ (instancetype)exceptionWithEntityName: (OFString*)entityName ++ (instancetype)exceptionWithEntityName: (OFString *)entityName { return [[[self alloc] initWithEntityName: entityName] autorelease]; } -- initWithEntityName: (OFString*)entityName +- initWithEntityName: (OFString *)entityName { self = [super init]; @try { _entityName = [entityName copy]; @@ -46,12 +46,12 @@ [_entityName release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"A parser encountered an unknown XML entity named %@!", _entityName]; } @end Index: src/exceptions/OFUnlockFailedException.m ================================================================== --- src/exceptions/OFUnlockFailedException.m +++ src/exceptions/OFUnlockFailedException.m @@ -41,14 +41,14 @@ [_lock release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { if (_lock != nil) return [OFString stringWithFormat: @"A lock of type %@ could not be unlocked!", [_lock class]]; else return @"A lock could not be unlocked!"; } @end Index: src/exceptions/OFUnsupportedProtocolException.m ================================================================== --- src/exceptions/OFUnsupportedProtocolException.m +++ src/exceptions/OFUnsupportedProtocolException.m @@ -21,21 +21,21 @@ #import "OFURL.h" @implementation OFUnsupportedProtocolException @synthesize URL = _URL; -+ (instancetype)exceptionWithURL: (OFURL*)url ++ (instancetype)exceptionWithURL: (OFURL *)URL { - return [[[self alloc] initWithURL: url] autorelease]; + return [[[self alloc] initWithURL: URL] autorelease]; } - init { OF_INVALID_INIT_METHOD } -- initWithURL: (OFURL*)URL +- initWithURL: (OFURL *)URL { self = [super init]; _URL = [URL retain]; @@ -47,11 +47,11 @@ [_URL release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"The protocol of URL %@ is not supported!", _URL]; } @end Index: src/exceptions/OFUnsupportedVersionException.h ================================================================== --- src/exceptions/OFUnsupportedVersionException.h +++ src/exceptions/OFUnsupportedVersionException.h @@ -39,17 +39,17 @@ * @brief Creates a new, autoreleased unsupported version exception. * * @param version The version which is unsupported * @return A new, autoreleased unsupported version exception */ -+ (instancetype)exceptionWithVersion: (OFString*)version; ++ (instancetype)exceptionWithVersion: (OFString *)version; /*! * @brief Initializes an already allocated unsupported protocol exception. * * @param version The version which is unsupported * @return An initialized unsupported version exception */ -- initWithVersion: (OFString*)version; +- initWithVersion: (OFString *)version; @end OF_ASSUME_NONNULL_END Index: src/exceptions/OFUnsupportedVersionException.m ================================================================== --- src/exceptions/OFUnsupportedVersionException.m +++ src/exceptions/OFUnsupportedVersionException.m @@ -20,21 +20,21 @@ #import "OFString.h" @implementation OFUnsupportedVersionException @synthesize version = _version; -+ (instancetype)exceptionWithVersion: (OFString*)version ++ (instancetype)exceptionWithVersion: (OFString *)version { return [[[self alloc] initWithVersion: version] autorelease]; } - init { OF_INVALID_INIT_METHOD } -- initWithVersion: (OFString*)version +- initWithVersion: (OFString *)version { self = [super init]; @try { _version = [version copy]; @@ -51,12 +51,12 @@ [_version release]; [super dealloc]; } -- (OFString*)description +- (OFString *)description { return [OFString stringWithFormat: @"Version %@ of the format or protocol is not supported!", _version]; } @end Index: src/exceptions/OFWriteFailedException.m ================================================================== --- src/exceptions/OFWriteFailedException.m +++ src/exceptions/OFWriteFailedException.m @@ -18,11 +18,11 @@ #import "OFWriteFailedException.h" #import "OFString.h" @implementation OFWriteFailedException -- (OFString*)description +- (OFString *)description { if (_errNo != 0) return [OFString stringWithFormat: @"Failed to write %zu bytes to an object of type %@: %@", _requestedLength, [_object class], of_strerror(_errNo)]; Index: src/instance.h ================================================================== --- src/instance.h +++ src/instance.h @@ -20,11 +20,11 @@ #ifdef __cplusplus extern "C" { #endif extern id objc_constructInstance(Class _Nullable, void *_Nullable); -extern void* objc_destructInstance(id); +extern void *objc_destructInstance(id); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/instance.m ================================================================== --- src/instance.m +++ src/instance.m @@ -36,13 +36,13 @@ constructSel = sel_registerName(".cxx_construct"); if (!class_respondsToSelector(cls, constructSel)) return true; - construct = (id(*)(id, SEL)) + construct = (id (*)(id, SEL)) class_getMethodImplementation(cls, constructSel); - last = (id(*)(id, SEL)) + last = (id (*)(id, SEL)) class_getMethodImplementation(super, constructSel); if (construct == last) return true; @@ -63,11 +63,11 @@ return nil; return obj; } -void* +void * objc_destructInstance(id obj) { Class cls; void (*last)(id, SEL) = NULL; @@ -81,11 +81,11 @@ for (cls = object_getClass(obj); cls != Nil; cls = class_getSuperclass(cls)) { void (*destruct)(id, SEL); if (class_respondsToSelector(cls, destructSel)) { - if ((destruct = (void(*)(id, SEL)) + if ((destruct = (void (*)(id, SEL)) class_getMethodImplementation(cls, destructSel)) != last) destruct(obj, destructSel); last = destruct; Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -589,17 +589,17 @@ of_bitset_clear(uint8_t *storage, size_t index) { storage[index / 8] &= ~(1 << (index % 8)); } -static OF_INLINE char* +static OF_INLINE char * of_strdup(const char *string) { char *copy; size_t length = strlen(string); - if ((copy = (char*)malloc(length + 1)) == NULL) + if ((copy = (char *)malloc(length + 1)) == NULL) return NULL; memcpy(copy, string, length + 1); return copy; @@ -606,13 +606,13 @@ } static OF_INLINE void of_explicit_memset(void *buffer_, int character, size_t length) { - volatile unsigned char *buffer = (volatile unsigned char*)buffer_; + volatile unsigned char *buffer = (volatile unsigned char *)buffer_; - while (buffer < (unsigned char*)buffer_ + length) + while (buffer < (unsigned char *)buffer_ + length) *buffer++ = character; } static OF_INLINE bool of_ascii_isalpha(char c) Index: src/of_asprintf.m ================================================================== --- src/of_asprintf.m +++ src/of_asprintf.m @@ -406,11 +406,11 @@ ctx->subformat[ctx->subformatLen - 1] = 's'; { const of_unichar_t *arg = - va_arg(ctx->arguments, const of_unichar_t*); + va_arg(ctx->arguments, const of_unichar_t *); size_t j, len = of_string_utf32_length(arg); char *buffer; if (SIZE_MAX / 4 < len || (SIZE_MAX / 4) - len < 1) return false; @@ -601,16 +601,16 @@ break; case 's': switch (ctx->lengthModifier) { case LENGTH_MODIFIER_NONE: tmpLen = asprintf(&tmp, ctx->subformat, - va_arg(ctx->arguments, const char*)); + va_arg(ctx->arguments, const char *)); break; #ifdef HAVE_WCHAR_T case LENGTH_MODIFIER_L: tmpLen = asprintf(&tmp, ctx->subformat, - va_arg(ctx->arguments, const wchar_t*)); + va_arg(ctx->arguments, const wchar_t *)); break; #endif default: return false; } @@ -619,45 +619,44 @@ case 'p': if (ctx->lengthModifier != LENGTH_MODIFIER_NONE) return false; tmpLen = asprintf(&tmp, ctx->subformat, - va_arg(ctx->arguments, void*)); + va_arg(ctx->arguments, void *)); break; case 'n': switch (ctx->lengthModifier) { case LENGTH_MODIFIER_NONE: - *va_arg(ctx->arguments, int*) = - (int)ctx->bufferLen; + *va_arg(ctx->arguments, int *) = (int)ctx->bufferLen; break; case LENGTH_MODIFIER_HH: - *va_arg(ctx->arguments, signed char*) = + *va_arg(ctx->arguments, signed char *) = (signed char)ctx->bufferLen; break; case LENGTH_MODIFIER_H: - *va_arg(ctx->arguments, short*) = + *va_arg(ctx->arguments, short *) = (short)ctx->bufferLen; break; case LENGTH_MODIFIER_L: - *va_arg(ctx->arguments, long*) = + *va_arg(ctx->arguments, long *) = (long)ctx->bufferLen; break; case LENGTH_MODIFIER_LL: - *va_arg(ctx->arguments, long long*) = + *va_arg(ctx->arguments, long long *) = (long long)ctx->bufferLen; break; case LENGTH_MODIFIER_J: - *va_arg(ctx->arguments, intmax_t*) = + *va_arg(ctx->arguments, intmax_t *) = (intmax_t)ctx->bufferLen; break; case LENGTH_MODIFIER_Z: - *va_arg(ctx->arguments, size_t*) = + *va_arg(ctx->arguments, size_t *) = (size_t)ctx->bufferLen; break; case LENGTH_MODIFIER_T: - *va_arg(ctx->arguments, ptrdiff_t*) = + *va_arg(ctx->arguments, ptrdiff_t *) = (ptrdiff_t)ctx->bufferLen; break; default: return false; } @@ -696,11 +695,11 @@ ctx->state = STATE_STRING; return true; } -static bool (*states[])(struct context*) = { +static bool (*states[])(struct context *) = { stringState, formatFlagsState, formatFieldWidthState, formatLengthModifierState, formatConversionSpecifierState Index: src/of_strptime.h ================================================================== --- src/of_strptime.h +++ src/of_strptime.h @@ -28,12 +28,12 @@ OF_ASSUME_NONNULL_BEGIN #ifdef __cplusplus extern "C" { #endif -extern const char* of_strptime(const char*, const char*, +extern const char *of_strptime(const char *buf, const char *fmt, struct tm *tm, int16_t *tz); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/of_strptime.m ================================================================== --- src/of_strptime.m +++ src/of_strptime.m @@ -20,11 +20,11 @@ #include #import "macros.h" -const char* +const char * of_strptime(const char *buffer, const char *format, struct tm *tm, int16_t *tz) { enum { SEARCH_CONVERSION_SPECIFIER, IN_CONVERSION_SPECIFIER Index: src/resolver.h ================================================================== --- src/resolver.h +++ src/resolver.h @@ -55,12 +55,12 @@ /*! * @brief Converts the specified address to a string and port pair. * * @param address The address to convert to a string * @param addressLength The length of the address to convert to a string - * @param host A pointer to an OFString* which should be set to the host of the - * address or NULL if the host is not needed + * @param host A pointer to an @ref OFString * which should be set to the host + * of the address or NULL if the host is not needed * @param port A pointer to an uint16_t which should be set to the port of the * address or NULL if the port is not needed */ extern void of_address_to_string_and_port(struct sockaddr *address, socklen_t addressLength, Index: src/resolver.m ================================================================== --- src/resolver.m +++ src/resolver.m @@ -51,11 +51,11 @@ if (!of_mutex_new(&mutex)) @throw [OFInitializationFailedException exception]; } #endif -of_resolver_result_t** +of_resolver_result_t ** of_resolve_host(OFString *host, uint16_t port, int type) { of_resolver_result_t **ret, **retIter; of_resolver_result_t *results, *resultsIter; size_t count; @@ -173,11 +173,11 @@ addr->sin_addr.s_addr = s_addr; tmp->family = AF_INET; tmp->type = type; tmp->protocol = 0; - tmp->address = (struct sockaddr*)addr; + tmp->address = (struct sockaddr *)addr; #ifndef OF_WII tmp->addressLength = sizeof(*addr); #else tmp->addressLength = 8; #endif @@ -233,11 +233,11 @@ memcpy(&addrsIter->sin_addr.s_addr, *ip, he->h_length); resultsIter->family = he->h_addrtype; resultsIter->type = type; resultsIter->protocol = 0; - resultsIter->address = (struct sockaddr*)addrsIter; + resultsIter->address = (struct sockaddr *)addrsIter; resultsIter->addressLength = sizeof(*addrsIter); *retIter = resultsIter; } # ifdef OF_HAVE_THREADS @@ -308,20 +308,20 @@ @throw [OFLockFailedException exception]; @try { # endif if ((hostCString = inet_ntoa( - ((struct sockaddr_in*)(void*)address)->sin_addr)) == NULL) + ((struct sockaddr_in *)(void *)address)->sin_addr)) == NULL) @throw [OFAddressTranslationFailedException exceptionWithError: h_errno]; if (host != NULL) *host = [OFString stringWithUTF8String: hostCString]; if (port != NULL) *port = OF_BSWAP16_IF_LE( - ((struct sockaddr_in*)(void*)address)->sin_port); + ((struct sockaddr_in *)(void *)address)->sin_port); # if OF_HAVE_THREADS } @finally { if (!of_mutex_unlock(&mutex)) @throw [OFUnlockFailedException exception]; } Index: src/runtime/arc.m ================================================================== --- src/runtime/arc.m +++ src/runtime/arc.m @@ -144,11 +144,11 @@ /* * We don't care if making it smaller * fails. */ if ((locations = realloc(old->locations, - old->count * sizeof(id*))) != NULL) + old->count * sizeof(id *))) != NULL) old->locations = locations; } break; } @@ -166,11 +166,11 @@ objc_hashtable_set(hashtable, value, ref); } if ((ref->locations = realloc(ref->locations, - (ref->count + 1) * sizeof(id*))) == NULL) + (ref->count + 1) * sizeof(id *))) == NULL) OBJC_ERROR("Not enough memory to allocate weak " "reference!") ref->locations[ref->count++] = object; } else Index: src/runtime/category.m ================================================================== --- src/runtime/category.m +++ src/runtime/category.m @@ -30,17 +30,17 @@ { for (struct objc_abi_method_list *ml = cat->instance_methods; ml != NULL; ml = ml->next) for (unsigned int i = 0; i < ml->count; i++) objc_register_selector( - (struct objc_abi_selector*)&ml->methods[i]); + (struct objc_abi_selector *)&ml->methods[i]); for (struct objc_abi_method_list *ml = cat->class_methods; ml != NULL; ml = ml->next) for (unsigned int i = 0; i < ml->count; i++) objc_register_selector( - (struct objc_abi_selector*)&ml->methods[i]); + (struct objc_abi_selector *)&ml->methods[i]); } static void register_category(struct objc_abi_category *cat) { @@ -49,21 +49,21 @@ if (categories == NULL) categories = objc_hashtable_new( objc_hash_string, objc_equal_string, 2); - cats = (struct objc_abi_category**)objc_hashtable_get(categories, + cats = (struct objc_abi_category **)objc_hashtable_get(categories, cat->class_name); if (cats != NULL) { struct objc_abi_category **ncats; size_t i; for (i = 0; cats[i] != NULL; i++); if ((ncats = realloc(cats, - (i + 2) * sizeof(struct objc_abi_category*))) == NULL) + (i + 2) * sizeof(struct objc_abi_category *))) == NULL) OBJC_ERROR("Not enough memory for category %s of " "class %s!", cat->category_name, cat->class_name); ncats[i] = cat; ncats[i + 1] = NULL; @@ -75,11 +75,11 @@ } return; } - if ((cats = malloc(2 * sizeof(struct objc_abi_category*))) == NULL) + if ((cats = malloc(2 * sizeof(struct objc_abi_category *))) == NULL) OBJC_ERROR("Not enough memory for category %s of class %s!\n", cat->category_name, cat->class_name); cats[0] = cat; cats[1] = NULL; @@ -93,25 +93,25 @@ void objc_register_all_categories(struct objc_abi_symtab *symtab) { struct objc_abi_category **cats = - (struct objc_abi_category**)symtab->defs + symtab->cls_def_cnt; + (struct objc_abi_category **)symtab->defs + symtab->cls_def_cnt; for (size_t i = 0; i < symtab->cat_def_cnt; i++) { register_selectors(cats[i]); register_category(cats[i]); } } -struct objc_category** +struct objc_category ** objc_categories_for_class(Class cls) { if (categories == NULL) return NULL; - return (struct objc_category**)objc_hashtable_get(categories, + return (struct objc_category **)objc_hashtable_get(categories, cls->name); } void objc_unregister_all_categories(void) @@ -119,10 +119,10 @@ if (categories == NULL) return; for (uint32_t i = 0; i < categories->size; i++) if (categories->data[i] != NULL) - free((void*)categories->data[i]->obj); + free((void *)categories->data[i]->obj); objc_hashtable_free(categories); categories = NULL; } Index: src/runtime/class.m ================================================================== --- src/runtime/class.m +++ src/runtime/class.m @@ -70,11 +70,11 @@ struct objc_abi_method_list *ml; for (ml = cls->methodlist; ml != NULL; ml = ml->next) for (unsigned int i = 0; i < ml->count; i++) objc_register_selector( - (struct objc_abi_selector*)&ml->methods[i]); + (struct objc_abi_selector *)&ml->methods[i]); } Class objc_classname_to_class(const char *name, bool cache) { @@ -133,11 +133,11 @@ for (struct objc_method_list *ml = cls->isa->methodlist; ml != NULL; ml = ml->next) for (unsigned int i = 0; i < ml->count; i++) if (sel_isEqual((SEL)&ml->methods[i].sel, selector)) - ((void(*)(id, SEL))ml->methods[i].imp)(cls, + ((void (*)(id, SEL))ml->methods[i].imp)(cls, selector); } static bool has_load(Class cls) @@ -270,11 +270,11 @@ const char *superclass; if (cls->info & OBJC_CLASS_INFO_SETUP) return; - if ((superclass = ((struct objc_abi_class*)cls)->superclass) != NULL) { + if ((superclass = ((struct objc_abi_class *)cls)->superclass) != NULL) { Class super = objc_classname_to_class(superclass, false); if (super == Nil) return; @@ -383,11 +383,11 @@ void objc_register_all_classes(struct objc_abi_symtab *symtab) { for (uint16_t i = 0; i < symtab->cls_def_cnt; i++) { struct objc_abi_class *cls = - (struct objc_abi_class*)symtab->defs[i]; + (struct objc_abi_class *)symtab->defs[i]; register_class(cls); register_selectors(cls); register_selectors(cls->metaclass); } @@ -454,11 +454,11 @@ void objc_registerClassPair(Class cls) { objc_global_mutex_lock(); - register_class((struct objc_abi_class*)cls); + register_class((struct objc_abi_class *)cls); if (cls->superclass != Nil) { add_subclass(cls); add_subclass(cls->isa); } @@ -566,11 +566,11 @@ objc_global_mutex_unlock(); return j; } -Class* +Class * objc_copyClassList(unsigned int *len) { Class *ret; unsigned int count; @@ -599,11 +599,11 @@ return false; return (cls->info & OBJC_CLASS_INFO_METACLASS); } -const char* +const char * class_getName(Class cls) { if (cls == Nil) return ""; @@ -668,11 +668,11 @@ dummy.isa = cls; return objc_msg_lookup_stret((id)&dummy, sel); } -static struct objc_method* +static struct objc_method * get_method(Class cls, SEL sel) { struct objc_method_list *ml; struct objc_category **cats; @@ -717,11 +717,11 @@ cls->methodlist = ml; objc_update_dtable(cls); } -const char* +const char * class_getMethodTypeEncoding(Class cls, SEL sel) { struct objc_method *method; if (cls == Nil) @@ -789,11 +789,11 @@ struct objc_object *obj; if (obj_ == nil) return Nil; - obj = (struct objc_object*)obj_; + obj = (struct objc_object *)obj_; return obj->isa; } Class @@ -803,28 +803,28 @@ Class old; if (obj_ == nil) return Nil; - obj = (struct objc_object*)obj_; + obj = (struct objc_object *)obj_; old = obj->isa; obj->isa = cls; return old; } -const char* +const char * object_getClassName(id obj) { return class_getName(object_getClass(obj)); } static void unregister_class(Class rcls) { - struct objc_abi_class *cls = (struct objc_abi_class*)rcls; + struct objc_abi_class *cls = (struct objc_abi_class *)rcls; if ((rcls->info & OBJC_CLASS_INFO_SETUP) && rcls->superclass != Nil && rcls->superclass->subclass_list != NULL) { size_t i = SIZE_MAX, count = 0; Index: src/runtime/dtable.m ================================================================== --- src/runtime/dtable.m +++ src/runtime/dtable.m @@ -49,11 +49,11 @@ for (uint_fast16_t i = 0; i < 256; i++) empty_level2->buckets[i] = (IMP)0; #endif } -struct objc_dtable* +struct objc_dtable * objc_dtable_new(void) { struct objc_dtable *dtable; #ifdef OF_SELUID24 Index: src/runtime/exception.m ================================================================== --- src/runtime/exception.m +++ src/runtime/exception.m @@ -114,11 +114,12 @@ } _Unwind_Reason_Code; struct objc_exception { struct _Unwind_Exception { uint64_t class; - void (*cleanup)(_Unwind_Reason_Code, struct _Unwind_Exception*); + void (*cleanup)( + _Unwind_Reason_Code, struct _Unwind_Exception *); #ifndef HAVE_ARM_EHABI_EXCEPTIONS # ifndef HAVE_SEH_EXCEPTIONS /* * The Itanium Exception ABI says to have those and never touch * them. @@ -163,28 +164,30 @@ uintptr_t typestable_base; uint8_t callsites_enc; const uint8_t *callsites, *actiontable; }; -extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception*); -extern void _Unwind_DeleteException(struct _Unwind_Exception*); -extern void* _Unwind_GetLanguageSpecificData(struct _Unwind_Context*); -extern uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context*); -extern uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context*); -extern uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context*); +extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *); +extern void _Unwind_DeleteException(struct _Unwind_Exception *); +extern void *_Unwind_GetLanguageSpecificData(struct _Unwind_Context *); +extern uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *); +extern uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *); +extern uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context *); #ifndef HAVE_ARM_EHABI_EXCEPTIONS # define CONTINUE_UNWIND return _URC_CONTINUE_UNWIND -extern uintptr_t _Unwind_GetIP(struct _Unwind_Context*); -extern void _Unwind_SetIP(struct _Unwind_Context*, uintptr_t); -extern void _Unwind_SetGR(struct _Unwind_Context*, int, uintptr_t); +extern uintptr_t _Unwind_GetIP(struct _Unwind_Context *); +extern void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t); +extern void _Unwind_SetGR(struct _Unwind_Context *, int, uintptr_t); #else -extern _Unwind_Reason_Code __gnu_unwind_frame(struct _Unwind_Exception*, - struct _Unwind_Context*); -extern int _Unwind_VRS_Get(struct _Unwind_Context*, int, uint32_t, int, void*); -extern int _Unwind_VRS_Set(struct _Unwind_Context*, int, uint32_t, int, void*); +extern _Unwind_Reason_Code __gnu_unwind_frame(struct _Unwind_Exception *, + struct _Unwind_Context *); +extern int _Unwind_VRS_Get(struct _Unwind_Context *, int, uint32_t, int, + void *); +extern int _Unwind_VRS_Set(struct _Unwind_Context *, int, uint32_t, int, + void *); # define CONTINUE_UNWIND \ { \ if (__gnu_unwind_frame(ex, ctx) != _URC_OK) \ return _URC_FAILURE; \ @@ -223,13 +226,13 @@ #ifdef CXX_PERSONALITY static PERSONALITY_FUNC(cxx_personality) OF_WEAK_REF(CXX_PERSONALITY_STR); #endif #ifdef HAVE_SEH_EXCEPTIONS -extern EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void*, - PCONTEXT, PDISPATCHER_CONTEXT, _Unwind_Reason_Code(*)(int, int, uint64_t, - struct _Unwind_Exception*, struct _Unwind_Context*)); +extern EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *, + PCONTEXT, PDISPATCHER_CONTEXT, _Unwind_Reason_Code (*)(int, int, uint64_t, + struct _Unwind_Exception *, struct _Unwind_Context *)); #endif static objc_uncaught_exception_handler uncaught_exception_handler; static struct objc_exception emergency_exceptions[NUM_EMERGENCY_EXCEPTIONS]; #ifdef OF_HAVE_THREADS @@ -301,11 +304,11 @@ if (enc == DW_EH_PE_omit) return 0; switch (enc & 0x07) { case DW_EH_PE_absptr: - return sizeof(void*); + return sizeof(void *); case DW_EH_PE_udata2: return 2; case DW_EH_PE_udata4: return 4; case DW_EH_PE_udata8: @@ -323,11 +326,11 @@ if (enc == DW_EH_PE_aligned) OBJC_ERROR("DW_EH_PE_aligned is not implemented!") #define READ(type) \ { \ - value = *(type*)(void*)*ptr; \ + value = *(type *)(void *)*ptr; \ *ptr += size_for_encoding(enc); \ break; \ } switch (enc & 0x0F) { case DW_EH_PE_absptr: @@ -366,11 +369,11 @@ return 0; value += ((enc & 0x70) == DW_EH_PE_pcrel ? (uintptr_t)start : base); if (enc & DW_EH_PE_indirect) - value = *(uintptr_t*)(uintptr_t)value; + value = *(uintptr_t *)(uintptr_t)value; return value; } #endif @@ -513,21 +516,21 @@ c = (uintptr_t)read_value(lsda->typestable_enc, &tmp); c = (uintptr_t)resolve_value(c, lsda->typestable_enc, lsda->typestable - i, lsda->typestable_base); #else tmp = lsda->typestable - (filter * 4); - c = *(uintptr_t*)(void*)tmp; + c = *(uintptr_t *)(void *)tmp; if (c != 0) { c += (uintptr_t)tmp; # if defined(OF_LINUX) || defined(OF_NETBSD) - c = *(uintptr_t*)c; + c = *(uintptr_t *)c; # endif } #endif - className = (const char*)c; + className = (const char *)c; if (className != NULL && *className != '\0' && strcmp(className, "@id") != 0) class = objc_getRequiredClass(className); else @@ -571,11 +574,11 @@ return _URC_FAILURE; } _Unwind_SetGR(ctx, 12, (uintptr_t)ex); #endif - struct objc_exception *e = (struct objc_exception*)ex; + struct objc_exception *e = (struct objc_exception *)ex; bool foreign = (ex_class != GNUCOBJC_EXCEPTION_CLASS); const uint8_t *lsda_addr, *actionrecords; struct lsda lsda; uintptr_t landingpad = 0; uint8_t found = 0; @@ -748,11 +751,11 @@ return old; } #ifdef HAVE_SEH_EXCEPTIONS -typedef EXCEPTION_DISPOSITION (*seh_personality_fn)(PEXCEPTION_RECORD, void*, +typedef EXCEPTION_DISPOSITION (*seh_personality_fn)(PEXCEPTION_RECORD, void *, PCONTEXT, PDISPATCHER_CONTEXT); static seh_personality_fn __gxx_personality_seh0; OF_CONSTRUCTOR() { @@ -773,11 +776,11 @@ EXCEPTION_DISPOSITION __gnu_objc_personality_seh0(PEXCEPTION_RECORD ms_exc, void *this_frame, PCONTEXT ms_orig_context, PDISPATCHER_CONTEXT ms_disp) { struct _Unwind_Exception *ex = - (struct _Unwind_Exception*)ms_exc->ExceptionInformation[0]; + (struct _Unwind_Exception *)ms_exc->ExceptionInformation[0]; switch (ex->class) { case GNUCCXX0_EXCEPTION_CLASS: case CLNGCXX0_EXCEPTION_CLASS: if (__gxx_personality_seh0 != NULL) Index: src/runtime/hashtable.m ================================================================== --- src/runtime/hashtable.m +++ src/runtime/hashtable.m @@ -51,13 +51,13 @@ objc_equal_string(const void *obj1, const void *obj2) { return (strcmp(obj1, obj2) == 0); } -struct objc_hashtable* -objc_hashtable_new(uint32_t (*hash)(const void*), - bool (*equal)(const void*, const void*), uint32_t size) +struct objc_hashtable * +objc_hashtable_new(uint32_t (*hash)(const void *), + bool (*equal)(const void *, const void *), uint32_t size) { struct objc_hashtable *table; if ((table = malloc(sizeof(struct objc_hashtable))) == NULL) OBJC_ERROR("Not enough memory to allocate hash table!"); @@ -65,11 +65,11 @@ table->hash = hash; table->equal = equal; table->count = 0; table->size = size; - table->data = calloc(size, sizeof(struct objc_hashtable_bucket*)); + table->data = calloc(size, sizeof(struct objc_hashtable_bucket *)); if (table->data == NULL) OBJC_ERROR("Not enough memory to allocate hash table!"); return table; @@ -202,19 +202,19 @@ table->data[i] = bucket; table->count++; } -void* +void * objc_hashtable_get(struct objc_hashtable *table, const void *key) { uint32_t idx; if (!index_for_key(table, key, &idx)) return NULL; - return (void*)table->data[idx]->obj; + return (void *)table->data[idx]->obj; } void objc_hashtable_delete(struct objc_hashtable *table, const void *key) { Index: src/runtime/property.m ================================================================== --- src/runtime/property.m +++ src/runtime/property.m @@ -41,11 +41,11 @@ id objc_getProperty(id self, SEL _cmd, ptrdiff_t offset, BOOL atomic) { if (atomic) { - id *ptr = (id*)(void*)((char*)self + offset); + id *ptr = (id *)(void *)((char *)self + offset); #ifdef OF_HAVE_THREADS unsigned hash = SPINLOCK_HASH(ptr); OF_ENSURE(of_spinlock_lock(&spinlocks[hash])); @try { @@ -56,19 +56,19 @@ #else return [[*ptr retain] autorelease]; #endif } - return *(id*)(void*)((char*)self + offset); + return *(id *)(void *)((char *)self + offset); } void objc_setProperty(id self, SEL _cmd, ptrdiff_t offset, id value, BOOL atomic, signed char copy) { if (atomic) { - id *ptr = (id*)(void*)((char*)self + offset); + id *ptr = (id *)(void *)((char *)self + offset); #ifdef OF_HAVE_THREADS unsigned hash = SPINLOCK_HASH(ptr); OF_ENSURE(of_spinlock_lock(&spinlocks[hash])); @try { @@ -94,11 +94,11 @@ #endif return; } - id *ptr = (id*)(void*)((char*)self + offset); + id *ptr = (id *)(void *)((char *)self + offset); id old = *ptr; switch (copy) { case 0: *ptr = [value retain]; Index: src/runtime/protocol.m ================================================================== --- src/runtime/protocol.m +++ src/runtime/protocol.m @@ -22,11 +22,11 @@ #import "runtime-private.h" @implementation Protocol @end -const char* +const char * protocol_getName(Protocol *p) { return p->name; } Index: src/runtime/runtime-private.h ================================================================== --- src/runtime/runtime-private.h +++ src/runtime/runtime-private.h @@ -121,42 +121,42 @@ IMP buckets[256]; #endif } *buckets[256]; }; -extern void objc_register_all_categories(struct objc_abi_symtab*); -extern struct objc_category** objc_categories_for_class(Class); +extern void objc_register_all_categories(struct objc_abi_symtab *); +extern struct objc_category **objc_categories_for_class(Class); extern void objc_unregister_all_categories(void); extern void objc_initialize_class(Class); extern void objc_update_dtable(Class); -extern void objc_register_all_classes(struct objc_abi_symtab*); -extern Class objc_classname_to_class(const char*, bool); +extern void objc_register_all_classes(struct objc_abi_symtab *); +extern Class objc_classname_to_class(const char *, bool); extern void objc_unregister_class(Class); extern void objc_unregister_all_classes(void); -extern uint32_t objc_hash_string(const void*); -extern bool objc_equal_string(const void*, const void*); -extern struct objc_hashtable* objc_hashtable_new(uint32_t (*)(const void*), - bool (*)(const void*, const void*), uint32_t); +extern uint32_t objc_hash_string(const void *); +extern bool objc_equal_string(const void *, const void *); +extern struct objc_hashtable *objc_hashtable_new(uint32_t (*)(const void *), + bool (*)(const void *, const void *), uint32_t); extern struct objc_hashtable_bucket objc_deleted_bucket; -extern void objc_hashtable_set(struct objc_hashtable*, const void*, - const void*); -extern void* objc_hashtable_get(struct objc_hashtable*, const void*); -extern void objc_hashtable_delete(struct objc_hashtable*, const void*); -extern void objc_hashtable_free(struct objc_hashtable*); -extern void objc_register_selector(struct objc_abi_selector*); -extern void objc_register_all_selectors(struct objc_abi_symtab*); +extern void objc_hashtable_set(struct objc_hashtable *, const void *, + const void *); +extern void *objc_hashtable_get(struct objc_hashtable *, const void *); +extern void objc_hashtable_delete(struct objc_hashtable *, const void *); +extern void objc_hashtable_free(struct objc_hashtable *); +extern void objc_register_selector(struct objc_abi_selector *); +extern void objc_register_all_selectors(struct objc_abi_symtab *); extern void objc_unregister_all_selectors(void); -extern struct objc_sparsearray* objc_sparsearray_new(uint8_t); -extern void* objc_sparsearray_get(struct objc_sparsearray*, uintptr_t); -extern void objc_sparsearray_set(struct objc_sparsearray*, uintptr_t, void*); -extern void objc_sparsearray_free(struct objc_sparsearray*); -extern struct objc_dtable* objc_dtable_new(void); -extern void objc_dtable_copy(struct objc_dtable*, struct objc_dtable*); -extern void objc_dtable_set(struct objc_dtable*, uint32_t, IMP); -extern void objc_dtable_free(struct objc_dtable*); +extern struct objc_sparsearray *objc_sparsearray_new(uint8_t); +extern void *objc_sparsearray_get(struct objc_sparsearray *, uintptr_t); +extern void objc_sparsearray_set(struct objc_sparsearray *, uintptr_t, void *); +extern void objc_sparsearray_free(struct objc_sparsearray *); +extern struct objc_dtable *objc_dtable_new(void); +extern void objc_dtable_copy(struct objc_dtable *, struct objc_dtable *); +extern void objc_dtable_set(struct objc_dtable *, uint32_t, IMP); +extern void objc_dtable_free(struct objc_dtable *); extern void objc_dtable_cleanup(void); -extern void objc_init_static_instances(struct objc_abi_symtab*); +extern void objc_init_static_instances(struct objc_abi_symtab *); extern void objc_forget_pending_static_instances(void); #ifdef OF_HAVE_THREADS extern void objc_global_mutex_lock(void); extern void objc_global_mutex_unlock(void); extern void objc_global_mutex_free(void); Index: src/runtime/runtime.h ================================================================== --- src/runtime/runtime.h +++ src/runtime/runtime.h @@ -51,13 +51,13 @@ #define Nil (Class)0 #define nil (id)0 #define YES (BOOL)1 #define NO (BOOL)0 -typedef struct objc_class* Class; -typedef struct objc_object* id; -typedef const struct objc_selector* SEL; +typedef struct objc_class *Class; +typedef struct objc_object *id; +typedef const struct objc_selector *SEL; typedef signed char BOOL; typedef id (*IMP)(id, SEL, ...); typedef void (*objc_uncaught_exception_handler)(id); struct objc_class { @@ -196,44 +196,44 @@ }; #ifdef __cplusplus extern "C" { #endif -extern SEL sel_registerName(const char*); -extern const char* sel_getName(SEL); +extern SEL sel_registerName(const char *); +extern const char *sel_getName(SEL); extern bool sel_isEqual(SEL, SEL); -extern Class objc_allocateClassPair(Class, const char*, size_t); +extern Class objc_allocateClassPair(Class, const char *, size_t); extern void objc_registerClassPair(Class); -extern id objc_lookUpClass(const char*); -extern id objc_getClass(const char*); -extern id objc_getRequiredClass(const char*); -extern unsigned int objc_getClassList(Class*, unsigned int); -extern Class* objc_copyClassList(unsigned int*); +extern id objc_lookUpClass(const char *); +extern id objc_getClass(const char *); +extern id objc_getRequiredClass(const char *); +extern unsigned int objc_getClassList(Class *, unsigned int); +extern Class *objc_copyClassList(unsigned int *); extern bool class_isMetaClass(Class); -extern const char* class_getName(Class); +extern const char *class_getName(Class); extern Class class_getSuperclass(Class); extern unsigned long class_getInstanceSize(Class); extern bool class_respondsToSelector(Class, SEL); -extern bool class_conformsToProtocol(Class, Protocol*); +extern bool class_conformsToProtocol(Class, Protocol *); extern IMP class_getMethodImplementation(Class, SEL); extern IMP class_getMethodImplementation_stret(Class, SEL); -extern const char* class_getMethodTypeEncoding(Class, SEL); -extern bool class_addMethod(Class, SEL, IMP, const char*); -extern IMP class_replaceMethod(Class, SEL, IMP, const char*); +extern const char *class_getMethodTypeEncoding(Class, SEL); +extern bool class_addMethod(Class, SEL, IMP, const char *); +extern IMP class_replaceMethod(Class, SEL, IMP, const char *); extern Class object_getClass(id); extern Class object_setClass(id, Class); -extern const char* object_getClassName(id); -extern const char* protocol_getName(Protocol*); -extern bool protocol_isEqual(Protocol*, Protocol*); -extern bool protocol_conformsToProtocol(Protocol*, Protocol*); +extern const char *object_getClassName(id); +extern const char *protocol_getName(Protocol *); +extern bool protocol_isEqual(Protocol *, Protocol *); +extern bool protocol_conformsToProtocol(Protocol *, Protocol *); extern void objc_exit(void); extern objc_uncaught_exception_handler objc_setUncaughtExceptionHandler( objc_uncaught_exception_handler); extern void objc_setForwardHandler(IMP, IMP); extern id objc_autorelease(id); -extern void* objc_autoreleasePoolPush(void); -extern void objc_autoreleasePoolPop(void*); +extern void *objc_autoreleasePoolPush(void); +extern void objc_autoreleasePoolPop(void *); extern id _objc_rootAutorelease(id); extern void objc_zero_weak_references(id); /* * Used by the compiler, but can also be called manually. @@ -240,22 +240,22 @@ * * These declarations are also required to prevent Clang's implicit * declarations which include __declspec(dllimport) on Windows. */ struct objc_abi_module; -extern void __objc_exec_class(void*); +extern void __objc_exec_class(void *); extern IMP objc_msg_lookup(id, SEL); extern IMP objc_msg_lookup_stret(id, SEL); -extern IMP objc_msg_lookup_super(struct objc_super*, SEL); -extern IMP objc_msg_lookup_super_stret(struct objc_super*, SEL); +extern IMP objc_msg_lookup_super(struct objc_super *, SEL); +extern IMP objc_msg_lookup_super_stret(struct objc_super *, SEL); extern void objc_exception_throw(id); extern int objc_sync_enter(id); extern int objc_sync_exit(id); extern id objc_getProperty(id, SEL, ptrdiff_t, BOOL); extern void objc_setProperty(id, SEL, ptrdiff_t, id, BOOL, signed char); -extern void objc_getPropertyStruct(void*, const void*, ptrdiff_t, BOOL, BOOL); -extern void objc_setPropertyStruct(void*, const void*, ptrdiff_t, BOOL, BOOL); +extern void objc_getPropertyStruct(void *, const void *, ptrdiff_t, BOOL, BOOL); +extern void objc_setPropertyStruct(void *, const void *, ptrdiff_t, BOOL, BOOL); extern void objc_enumerationMutation(id); extern void objc_setEnumerationMutationHandler(void (*handler)(id)); #ifdef __cplusplus } #endif Index: src/runtime/selector.m ================================================================== --- src/runtime/selector.m +++ src/runtime/selector.m @@ -50,23 +50,23 @@ if (selectors == NULL) selectors = objc_hashtable_new( objc_hash_string, objc_equal_string, 2); else if ((rsel = objc_hashtable_get(selectors, sel->name)) != NULL) { - ((struct objc_selector*)sel)->uid = rsel->uid; + ((struct objc_selector *)sel)->uid = rsel->uid; return; } if (selector_names == NULL) selector_names = objc_sparsearray_new(SEL_SIZE); name = sel->name; - rsel = (struct objc_selector*)sel; + rsel = (struct objc_selector *)sel; rsel->uid = selectors_cnt++; objc_hashtable_set(selectors, name, rsel); - objc_sparsearray_set(selector_names, (uint32_t)rsel->uid, (void*)name); + objc_sparsearray_set(selector_names, (uint32_t)rsel->uid, (void *)name); } SEL sel_registerName(const char *name) { @@ -88,15 +88,15 @@ OBJC_ERROR("Not enough memory to allocate selector!"); sel->types = NULL; if ((free_list = realloc(free_list, - sizeof(void*) * (free_list_cnt + 2))) == NULL) + sizeof(void *) * (free_list_cnt + 2))) == NULL) OBJC_ERROR("Not enough memory to allocate selector!"); free_list[free_list_cnt++] = sel; - free_list[free_list_cnt++] = (char*)sel->name; + free_list[free_list_cnt++] = (char *)sel->name; objc_register_selector(sel); objc_global_mutex_unlock(); return (SEL)sel; @@ -112,11 +112,11 @@ for (sel = symtab->sel_refs; sel->name != NULL; sel++) objc_register_selector(sel); } -const char* +const char * sel_getName(SEL sel) { const char *ret; objc_global_mutex_lock(); Index: src/runtime/sparsearray.m ================================================================== --- src/runtime/sparsearray.m +++ src/runtime/sparsearray.m @@ -20,11 +20,11 @@ #include #import "runtime.h" #import "runtime-private.h" -struct objc_sparsearray* +struct objc_sparsearray * objc_sparsearray_new(uint8_t index_size) { struct objc_sparsearray *sparsearray; if ((sparsearray = calloc(1, sizeof(*sparsearray))) == NULL) @@ -36,11 +36,11 @@ sparsearray->index_size = index_size; return sparsearray; } -void* +void * objc_sparsearray_get(struct objc_sparsearray *sparsearray, uintptr_t idx) { struct objc_sparsearray_data *iter = sparsearray->data; for (uint8_t i = 0; i < sparsearray->index_size - 1; i++) { Index: src/runtime/static-instances.m ================================================================== --- src/runtime/static-instances.m +++ src/runtime/static-instances.m @@ -49,20 +49,20 @@ static_instances[i] = static_instances[static_instances_cnt]; static_instances = realloc(static_instances, - sizeof(struct objc_abi_static_instances*) * + sizeof(struct objc_abi_static_instances *) * static_instances_cnt); if (static_instances == NULL) OBJC_ERROR("Not enough memory for list of " "static instances!"); } } - si = (struct objc_abi_static_instances**) + si = (struct objc_abi_static_instances **) symtab->defs[symtab->cls_def_cnt + symtab->cat_def_cnt]; if (si == NULL) return; @@ -73,11 +73,11 @@ for (id *instances = (*si)->instances; *instances != nil; instances++) object_setClass(*instances, cls); } else { static_instances = realloc(static_instances, - sizeof(struct objc_abi_static_instances*) * + sizeof(struct objc_abi_static_instances *) * (static_instances_cnt + 1)); if (static_instances == NULL) OBJC_ERROR("Not enough memory for list of " "static instances!"); Index: src/scrypt.m ================================================================== --- src/scrypt.m +++ src/scrypt.m @@ -179,17 +179,17 @@ blockSize]; HMAC = [[OFHMAC alloc] initWithHashClass: [OFSHA256Hash class]]; of_pbkdf2(HMAC, 1, salt, saltLength, password, passwordLength, - (unsigned char*)buffer, parallelization * 128 * blockSize); + (unsigned char *)buffer, parallelization * 128 * blockSize); for (size_t i = 0; i < parallelization; i++) of_scrypt_romix(buffer + i * 32 * blockSize, blockSize, costFactor, tmp); - of_pbkdf2(HMAC, 1, (unsigned char*)buffer, parallelization * + of_pbkdf2(HMAC, 1, (unsigned char *)buffer, parallelization * 128 * blockSize, password, passwordLength, key, keyLength); } @finally { of_explicit_memset(tmp, 0, (costFactor + 1) * blockSize * 128); free(tmp); Index: src/socket.m ================================================================== --- src/socket.m +++ src/socket.m @@ -61,11 +61,11 @@ return; if (socInit(ctx, 0x100000) != 0) return; - atexit((void(*))socExit); + atexit((void (*)(void))socExit); #endif #ifdef OF_HAVE_THREADS if (!of_mutex_new(&mutex)) return; Index: src/threading.h ================================================================== --- src/threading.h +++ src/threading.h @@ -127,11 +127,11 @@ extern bool of_condition_free(of_condition_t *condition); /* TLS keys and spinlocks are inlined for performance. */ #if defined(OF_HAVE_PTHREADS) -static OF_INLINE void* +static OF_INLINE void * of_tlskey_get(of_tlskey_t key) { return pthread_getspecific(key); } @@ -139,11 +139,11 @@ of_tlskey_set(of_tlskey_t key, void *ptr) { return !pthread_setspecific(key, ptr); } #elif defined(OF_WINDOWS) -static OF_INLINE void* +static OF_INLINE void * of_tlskey_get(of_tlskey_t key) { return TlsGetValue(key); } Index: src/threading.m ================================================================== --- src/threading.m +++ src/threading.m @@ -59,20 +59,20 @@ of_rmutex_lock(of_rmutex_t *rmutex) { uintptr_t count = (uintptr_t)of_tlskey_get(rmutex->count); if (count > 0) { - if (!of_tlskey_set(rmutex->count, (void*)(count + 1))) + if (!of_tlskey_set(rmutex->count, (void *)(count + 1))) return false; return true; } if (!of_mutex_lock(&rmutex->mutex)) return false; - if (!of_tlskey_set(rmutex->count, (void*)1)) { + if (!of_tlskey_set(rmutex->count, (void *)1)) { of_mutex_unlock(&rmutex->mutex); return false; } return true; @@ -82,20 +82,20 @@ of_rmutex_trylock(of_rmutex_t *rmutex) { uintptr_t count = (uintptr_t)of_tlskey_get(rmutex->count); if (count > 0) { - if (!of_tlskey_set(rmutex->count, (void*)(count + 1))) + if (!of_tlskey_set(rmutex->count, (void *)(count + 1))) return false; return true; } if (!of_mutex_trylock(&rmutex->mutex)) return false; - if (!of_tlskey_set(rmutex->count, (void*)1)) { + if (!of_tlskey_set(rmutex->count, (void *)1)) { of_mutex_unlock(&rmutex->mutex); return false; } return true; @@ -105,17 +105,17 @@ of_rmutex_unlock(of_rmutex_t *rmutex) { uintptr_t count = (uintptr_t)of_tlskey_get(rmutex->count); if (count > 1) { - if (!of_tlskey_set(rmutex->count, (void*)(count - 1))) + if (!of_tlskey_set(rmutex->count, (void *)(count - 1))) return false; return true; } - if (!of_tlskey_set(rmutex->count, (void*)0)) + if (!of_tlskey_set(rmutex->count, (void *)0)) return false; if (!of_mutex_unlock(&rmutex->mutex)) return false; Index: src/threading_pthread.m ================================================================== --- src/threading_pthread.m +++ src/threading_pthread.m @@ -52,11 +52,11 @@ normalPrio = param.sched_priority; pthread_attr_destroy(&pattr); } -static void* +static void * function_wrapper(void *data) { struct thread_ctx *ctx = data; pthread_cleanup_push(free, data); Index: src/threading_winapi.m ================================================================== --- src/threading_winapi.m +++ src/threading_winapi.m @@ -30,11 +30,11 @@ bool of_thread_new(of_thread_t *thread, void (*function)(id), id object, const of_thread_attr_t *attr) { *thread = CreateThread(NULL, (attr != NULL ? attr->stackSize : 0), - (LPTHREAD_START_ROUTINE)function, (__bridge void*)object, 0, NULL); + (LPTHREAD_START_ROUTINE)function, (__bridge void *)object, 0, NULL); if (thread == NULL) return false; if (attr != NULL && attr->priority != 0) { Index: tests/ForwardingTests.m ================================================================== --- tests/ForwardingTests.m +++ tests/ForwardingTests.m @@ -47,11 +47,11 @@ - (void)test; - (uint32_t)forwardingTargetTest: (intptr_t)a0 : (intptr_t)a1 : (double)a2 : (double)a3; -- (OFString*)forwardingTargetVarArgTest: (OFConstantString*)fmt, ...; +- (OFString *)forwardingTargetVarArgTest: (OFConstantString *)fmt, ...; - (long double)forwardingTargetFPRetTest; - (struct stret_test)forwardingTargetStRetTest; - (void)forwardingTargetNilTest; - (void)forwardingTargetSelfTest; - (struct stret_test)forwardingTargetNilStRetTest; @@ -112,11 +112,11 @@ if (sel_isEqual(selector, @selector(forwardingTargetTest::::)) || sel_isEqual(selector, @selector(forwardingTargetVarArgTest:)) || sel_isEqual(selector, @selector(forwardingTargetFPRetTest)) || sel_isEqual(selector, @selector(forwardingTargetStRetTest))) - return (id)((char*)target + (ptrdiff_t)add); + return (id)((char *)target + (ptrdiff_t)add); if (sel_isEqual(selector, @selector(forwardingTargetNilTest)) || sel_isEqual(selector, @selector(forwardingTargetNilStRetTest))) return nil; @@ -146,11 +146,11 @@ return 0; return 0x12345678; } -- (OFString*)forwardingTargetVarArgTest: (OFConstantString*)fmt, ... +- (OFString *)forwardingTargetVarArgTest: (OFConstantString *)fmt, ... { va_list args; OFString *ret; OF_ENSURE(self == target); Index: tests/OFArrayTests.m ================================================================== --- tests/OFArrayTests.m +++ tests/OFArrayTests.m @@ -75,11 +75,11 @@ } return self; } -- initWithObjects: (id const*)objects +- initWithObjects: (id const *)objects count: (size_t)count { self = [super init]; @try { Index: tests/OFDataArrayTests.m ================================================================== --- tests/OFDataArrayTests.m +++ tests/OFDataArrayTests.m @@ -125,11 +125,11 @@ !memcmp([[class dataArrayWithBase64EncodedString: @"YWJjZGU="] items], "abcde", 5)) TEST(@"Building strings", (array[0] = [class dataArray]) && - R([array[0] addItems: (void*)str + R([array[0] addItems: (void *)str count: 6]) && R([array[0] addItem: ""]) && !strcmp([array[0] items], str)) EXPECT_EXCEPTION(@"Detect out of range in -[itemAtIndex:]", OFOutOfRangeException, [array[0] itemAtIndex: [array[0] count]]) Index: tests/OFDictionaryTests.m ================================================================== --- tests/OFDictionaryTests.m +++ tests/OFDictionaryTests.m @@ -79,12 +79,12 @@ } return self; } -- initWithObjects: (const id*)objects - forKeys: (const id*)keys +- initWithObjects: (const id *)objects + forKeys: (const id *)keys count: (size_t)count { self = [super init]; @try { @@ -115,22 +115,22 @@ - (size_t)count { return [_dictionary count]; } -- (OFEnumerator*)keyEnumerator +- (OFEnumerator *)keyEnumerator { return [_dictionary keyEnumerator]; } -- (OFEnumerator*)objectEnumerator +- (OFEnumerator *)objectEnumerator { return [_dictionary objectEnumerator]; } -- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state - objects: (id*)objects +- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state + objects: (id *)objects count: (int)count { return [_dictionary countByEnumeratingWithState: state objects: objects count: count]; Index: tests/OFKernelEventObserverTests.m ================================================================== --- tests/OFKernelEventObserverTests.m +++ tests/OFKernelEventObserverTests.m @@ -53,11 +53,11 @@ - (void)run; @end @implementation ObserverTest -- initWithTestsAppDelegate: (TestsAppDelegate*)testsAppDelegate +- initWithTestsAppDelegate: (TestsAppDelegate *)testsAppDelegate { self = [super init]; @try { uint16_t port; Index: tests/OFStreamTests.m ================================================================== --- tests/OFStreamTests.m +++ tests/OFStreamTests.m @@ -37,11 +37,11 @@ - (bool)lowlevelIsAtEndOfStream { return (state > 1); } -- (size_t)lowlevelReadIntoBuffer: (void*)buffer +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)size { size_t pageSize = [OFSystemInfo pageSize]; switch (state) { @@ -56,11 +56,11 @@ case 1: if (size < pageSize) return 0; memcpy(buffer, "oo\n", 3); - memset((char*)buffer + 3, 'X', pageSize - 3); + memset((char *)buffer + 3, 'X', pageSize - 3); state++; return pageSize; } Index: tests/OFStringTests.m ================================================================== --- tests/OFStringTests.m +++ tests/OFStringTests.m @@ -33,11 +33,11 @@ #import "OFUnknownXMLEntityException.h" #import "TestsAppDelegate.h" static OFString *module = nil; -static OFString* whitespace[] = { +static OFString *whitespace[] = { @" \r \t\n\t \tasd \t \t\t\r\n", @" \t\t \t\t \t \t" }; static of_unichar_t ucstr[] = { 0xFEFF, 'f', 0xF6, 0xF6, 'b', 0xE4, 'r', 0x1F03A, 0 @@ -79,11 +79,11 @@ } return self; } -- initWithString: (OFString*)string +- initWithString: (OFString *)string { self = [super init]; @try { _string = [string mutableCopy]; @@ -93,11 +93,11 @@ } return self; } -- initWithCString: (const char*)cString +- initWithCString: (const char *)cString encoding: (of_string_encoding_t)encoding length: (size_t)length { self = [super init]; @@ -111,11 +111,11 @@ } return self; } -- initWithUTF16String: (const of_char16_t*)UTF16String +- initWithUTF16String: (const of_char16_t *)UTF16String length: (size_t)length byteOrder: (of_byte_order_t)byteOrder { self = [super init]; @@ -130,11 +130,11 @@ } return self; } -- initWithUTF32String: (const of_char32_t*)UTF32String +- initWithUTF32String: (const of_char32_t *)UTF32String length: (size_t)length byteOrder: (of_byte_order_t)byteOrder { self = [super init]; @@ -149,11 +149,11 @@ } return self; } -- initWithFormat: (OFConstantString*)format +- initWithFormat: (OFConstantString *)format arguments: (va_list)arguments { self = [super init]; @try { @@ -191,11 +191,11 @@ if (self == [SimpleMutableString class]) [self inheritMethodsFromClass: [SimpleString class]]; } - (void)replaceCharactersInRange: (of_range_t)range - withString: (OFString*)string + withString: (OFString *)string { [_string replaceCharactersInRange: range withString: string]; } @end @@ -202,12 +202,12 @@ @interface EntityHandler: OFObject @end @implementation EntityHandler -- (OFString*)string: (OFString*)string - containsUnknownEntityNamed: (OFString*)entity +- (OFString *)string: (OFString *)string + containsUnknownEntityNamed: (OFString *)entity { if ([entity isEqual: @"foo"]) return @"bar"; return nil; @@ -931,11 +931,11 @@ isEqual: @"xbary"]) #ifdef OF_HAVE_BLOCKS TEST(@"-[stringByXMLUnescapingWithBlock:]", [[C(@"x&foo;y") stringByXMLUnescapingWithBlock: - ^ OFString* (OFString *str, OFString *entity) { + ^ OFString *(OFString *str, OFString *entity) { if ([entity isEqual: @"foo"]) return @"bar"; return nil; }] isEqual: @"xbary"]) Index: tests/OFXMLElementBuilderTests.m ================================================================== --- tests/OFXMLElementBuilderTests.m +++ tests/OFXMLElementBuilderTests.m @@ -26,19 +26,19 @@ static OFString *module = @"OFXMLElementBuilder"; static OFXMLNode *nodes[2]; static size_t i = 0; @implementation TestsAppDelegate (OFXMLElementBuilderTests) -- (void)elementBuilder: (OFXMLElementBuilder*)builder - didBuildElement: (OFXMLElement*)element +- (void)elementBuilder: (OFXMLElementBuilder *)builder + didBuildElement: (OFXMLElement *)element { OF_ENSURE(i == 0); nodes[i++] = [element retain]; } -- (void)elementBuilder: (OFXMLElementBuilder*)builder - didBuildParentlessNode: (OFXMLNode*)node +- (void)elementBuilder: (OFXMLElementBuilder *)builder + didBuildParentlessNode: (OFXMLNode *)node { OF_ENSURE(i == 1); nodes[i++] = [node retain]; } Index: tests/OFXMLParserTests.m ================================================================== --- tests/OFXMLParserTests.m +++ tests/OFXMLParserTests.m @@ -42,15 +42,15 @@ COMMENT }; @implementation TestsAppDelegate (OFXMLParser) - (void)parserCallbackWithEventType: (enum event_type)et - name: (OFString*)name - prefix: (OFString*)prefix - namespace: (OFString*)ns - attributes: (OFArray*)attrs - string: (OFString*)string + name: (OFString *)name + prefix: (OFString *)prefix + namespace: (OFString *)ns + attributes: (OFArray *)attrs + string: (OFString *)string { OFString *msg; i++; msg = [OFString stringWithFormat: @"Parsing part #%d", i]; @@ -239,83 +239,83 @@ prefix == nil && ns == nil); break; } } -- (void)parser: (OFXMLParser*)parser - foundProcessingInstructions: (OFString*)pi +- (void)parser: (OFXMLParser *)parser + foundProcessingInstructions: (OFString *)pi { [self parserCallbackWithEventType: PROCESSING_INSTRUCTIONS name: nil prefix: nil namespace: nil attributes: nil string: pi]; } -- (void)parser: (OFXMLParser*)parser - didStartElement: (OFString*)name - prefix: (OFString*)prefix - namespace: (OFString*)ns - attributes: (OFArray*)attrs +- (void)parser: (OFXMLParser *)parser + didStartElement: (OFString *)name + prefix: (OFString *)prefix + namespace: (OFString *)ns + attributes: (OFArray *)attrs { [self parserCallbackWithEventType: TAG_START name: name prefix: prefix namespace: ns attributes: attrs string: nil]; } -- (void)parser: (OFXMLParser*)parser - didEndElement: (OFString*)name - prefix: (OFString*)prefix - namespace: (OFString*)ns +- (void)parser: (OFXMLParser *)parser + didEndElement: (OFString *)name + prefix: (OFString *)prefix + namespace: (OFString *)ns { [self parserCallbackWithEventType: TAG_END name: name prefix: prefix namespace: ns attributes: nil string: nil]; } -- (void)parser: (OFXMLParser*)parser - foundCharacters: (OFString*)string +- (void)parser: (OFXMLParser *)parser + foundCharacters: (OFString *)string { [self parserCallbackWithEventType: STRING name: nil prefix: nil namespace: nil attributes: nil string: string]; } -- (void)parser: (OFXMLParser*)parser - foundCDATA: (OFString*)cdata +- (void)parser: (OFXMLParser *)parser + foundCDATA: (OFString *)cdata { [self parserCallbackWithEventType: CDATA name: nil prefix: nil namespace: nil attributes: nil string: cdata]; } -- (void)parser: (OFXMLParser*)parser - foundComment: (OFString*)comment +- (void)parser: (OFXMLParser *)parser + foundComment: (OFString *)comment { [self parserCallbackWithEventType: COMMENT name: nil prefix: nil namespace: nil attributes: nil string: comment]; } -- (OFString*)parser: (OFXMLParser*)parser - foundUnknownEntityNamed: (OFString*)entity +- (OFString *)parser: (OFXMLParser *)parser + foundUnknownEntityNamed: (OFString *)entity { if ([entity isEqual: @"foo"]) return @"foobar"; return nil; Index: tests/PBKDF2Tests.m ================================================================== --- tests/PBKDF2Tests.m +++ tests/PBKDF2Tests.m @@ -37,47 +37,47 @@ unsigned char key[25]; /* Test vectors from RFC 6070 */ TEST(@"PBKDF2-SHA1, 1 iteration", - R(of_pbkdf2(HMAC, 1, (unsigned char*)"salt", 4, "password", 8, key, + R(of_pbkdf2(HMAC, 1, (unsigned char *)"salt", 4, "password", 8, key, 20)) && memcmp(key, "\x0C\x60\xC8\x0F\x96\x1F\x0E\x71\xF3\xA9\xB5\x24\xAF" "\x60\x12\x06\x2F\xE0\x37\xA6", 20) == 0) TEST(@"PBKDF2-SHA1, 2 iterations", - R(of_pbkdf2(HMAC, 2, (unsigned char*)"salt", 4, "password", 8, key, + R(of_pbkdf2(HMAC, 2, (unsigned char *)"salt", 4, "password", 8, key, 20)) && memcmp(key, "\xEA\x6C\x01\x4D\xC7\x2D\x6F\x8C\xCD\x1E\xD9\x2A\xCE" "\x1D\x41\xF0\xD8\xDE\x89\x57", 20) == 0) TEST(@"PBKDF2-SHA1, 4096 iterations", - R(of_pbkdf2(HMAC, 4096, (unsigned char*)"salt", 4, "password", 8, + R(of_pbkdf2(HMAC, 4096, (unsigned char *)"salt", 4, "password", 8, key, 20)) && memcmp(key, "\x4B\x00\x79\x01\xB7\x65\x48\x9A\xBE\xAD\x49\xD9\x26" "\xF7\x21\xD0\x65\xA4\x29\xC1", 20) == 0) /* This test takes too long, even on a fast machine. */ #if 0 TEST(@"PBKDF2-SHA1, 16777216 iterations", - R(of_pbkdf2(HMAC, 16777216, (unsigned char*)"salt", 4, "password", + R(of_pbkdf2(HMAC, 16777216, (unsigned char *)"salt", 4, "password", 8, key, 20)) && memcmp(key, "\xEE\xFE\x3D\x61\xCD\x4D\xA4\xE4\xE9\x94\x5B\x3D\x6B" "\xA2\x15\x8C\x26\x34\xE9\x84", 20) == 0) #endif TEST(@"PBKDF2-SHA1, 4096 iterations, key > 1 block", R(of_pbkdf2(HMAC, 4096, - (unsigned char*)"saltSALTsaltSALTsaltSALTsaltSALTsalt", 36, + (unsigned char *)"saltSALTsaltSALTsaltSALTsaltSALTsalt", 36, "passwordPASSWORDpassword", 24, key, 25)) && memcmp(key, "\x3D\x2E\xEC\x4F\xE4\x1C\x84\x9B\x80\xC8\xD8\x36\x62" "\xC0\xE4\x4A\x8B\x29\x1A\x96\x4C\xF2\xF0\x70\x38", 25) == 0) TEST(@"PBKDF2-SHA1, 4096 iterations, key < 1 block", - R(of_pbkdf2(HMAC, 4096, (unsigned char*)"sa\0lt", 5, "pass\0word", + R(of_pbkdf2(HMAC, 4096, (unsigned char *)"sa\0lt", 5, "pass\0word", 9, key, 16)) && memcmp(key, "\x56\xFA\x6A\xA7\x55\x48\x09\x9D\xCC\x37\xD7\xF0\x34" "\x25\xE0\xC3", 16) == 0) [pool drain]; } @end Index: tests/ScryptTests.m ================================================================== --- tests/ScryptTests.m +++ tests/ScryptTests.m @@ -158,28 +158,28 @@ R(memcpy(ROMixBuffer, ROMixInput, 128)) && R(of_scrypt_romix(ROMixBuffer, 1, 16, ROMixTmp)) && memcmp(ROMixBuffer, ROMixOutput, 128) == 0) TEST(@"scrypt test vector #1", - R(of_scrypt(1, 16, 1, (unsigned char*)"", 0, "", 0, output, 64)) && + R(of_scrypt(1, 16, 1, (unsigned char *)"", 0, "", 0, output, 64)) && memcmp(output, testVector1, 64) == 0) TEST(@"scrypt test vector #2", - R(of_scrypt(8, 1024, 16, (unsigned char*)"NaCl", 4, "password", 8, + R(of_scrypt(8, 1024, 16, (unsigned char *)"NaCl", 4, "password", 8, output, 64)) && memcmp(output, testVector2, 64) == 0) TEST(@"scrypt test vector #3", - R(of_scrypt(8, 16384, 1, (unsigned char*)"SodiumChloride", 14, + R(of_scrypt(8, 16384, 1, (unsigned char *)"SodiumChloride", 14, "pleaseletmein", 13, output, 64)) && memcmp(output, testVector3, 64) == 0) /* The forth test vector is too expensive to include it in the tests. */ #if 0 TEST(@"scrypt test vector #4", - R(of_scrypt(8, 1048576, 1, (unsigned char*)"SodiumChloride", 14, + R(of_scrypt(8, 1048576, 1, (unsigned char *)"SodiumChloride", 14, "pleaseletmein", 13, output, 64)) && memcmp(output, testVector4, 64) == 0) #endif [pool drain]; } @end Index: tests/TestsAppDelegate.h ================================================================== --- tests/TestsAppDelegate.h +++ tests/TestsAppDelegate.h @@ -60,18 +60,18 @@ @interface TestsAppDelegate: OFObject { int _fails; } -- (void)outputString: (OFString*)str +- (void)outputString: (OFString *)str inColor: (int)color; -- (void)outputTesting: (OFString*)test - inModule: (OFString*)module; -- (void)outputSuccess: (OFString*)test - inModule: (OFString*)module; -- (void)outputFailure: (OFString*)test - inModule: (OFString*)module; +- (void)outputTesting: (OFString *)test + inModule: (OFString *)module; +- (void)outputSuccess: (OFString *)test + inModule: (OFString *)module; +- (void)outputFailure: (OFString *)test + inModule: (OFString *)module; @end @interface TestsAppDelegate (OFArrayTests) - (void)arrayTests; @end Index: tests/TestsAppDelegate.m ================================================================== --- tests/TestsAppDelegate.m +++ tests/TestsAppDelegate.m @@ -203,11 +203,11 @@ return of_application_main(&argc, &argv, [TestsAppDelegate class]); #endif } @implementation TestsAppDelegate -- (void)outputString: (OFString*)str +- (void)outputString: (OFString *)str inColor: (int)color { #if defined(OF_PSP) char space = ' '; int y = pspDebugScreenGetY(); @@ -259,12 +259,12 @@ #else # error No output method! #endif } -- (void)outputTesting: (OFString*)test - inModule: (OFString*)module +- (void)outputTesting: (OFString *)test + inModule: (OFString *)module { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; #ifndef STDOUT_SIMPLE [self outputString: [OFString stringWithFormat: @"[%@] %@: testing...", module, test] @@ -275,12 +275,12 @@ inColor: YELLOW]; #endif [pool release]; } -- (void)outputSuccess: (OFString*)test - inModule: (OFString*)module +- (void)outputSuccess: (OFString *)test + inModule: (OFString *)module { #ifndef STDOUT_SIMPLE OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; [self outputString: [OFString stringWithFormat: @"[%@] %@: ok\n", module, test] @@ -290,12 +290,12 @@ [self outputString: @"ok\n" inColor: GREEN]; #endif } -- (void)outputFailure: (OFString*)test - inModule: (OFString*)module +- (void)outputFailure: (OFString *)test + inModule: (OFString *)module { #ifndef STDOUT_SIMPLE OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; [self outputString: [OFString stringWithFormat: @"[%@] %@: failed\n", module, test] @@ -370,11 +370,11 @@ [of_stderr writeString: @"Failed to locate resources!\n"]; [OFApplication terminateWithStatus: 1]; } [[OFFileManager defaultManager] changeCurrentDirectoryPath: - [OFString stringWithUTF8String: (const char*)resourcesPath]]; + [OFString stringWithUTF8String: (const char *)resourcesPath]]; #endif #if defined(OF_WII) && defined(OF_HAVE_FILES) [[OFFileManager defaultManager] changeCurrentDirectoryPath: @"/apps/objfw-tests"]; #endif Index: utils/ofhash/OFHash.m ================================================================== --- utils/ofhash/OFHash.m +++ utils/ofhash/OFHash.m @@ -71,11 +71,11 @@ } @implementation OFHash - (void)applicationDidFinishLaunching { - OFArray OF_GENERIC(OFString*) *arguments = [OFApplication arguments]; + OFArray OF_GENERIC(OFString *) *arguments = [OFApplication arguments]; id hash; bool first = true; int exitStatus = 0; #ifdef OF_HAVE_SANDBOX Index: utils/ofhttp/OFHTTP.m ================================================================== --- utils/ofhttp/OFHTTP.m +++ utils/ofhttp/OFHTTP.m @@ -52,11 +52,11 @@ #define MEBIBYTE (1024 * 1024) #define KIBIBYTE (1024) @interface OFHTTP: OFObject { - OFArray OF_GENERIC(OFString*) *_URLs; + OFArray OF_GENERIC(OFString *) *_URLs; size_t _URLIndex; int _errorCode; OFString *_outputPath; bool _continue, _force, _detectFileName, _quiet, _verbose, _insecure; OFDataArray *_body; @@ -135,11 +135,11 @@ } return self; } -- (void)addHeader: (OFString*)header +- (void)addHeader: (OFString *)header { size_t pos = [header rangeOfString: @":"].location; OFString *name, *value; if (pos == OF_NOT_FOUND) { @@ -158,11 +158,11 @@ [_clientHeaders setObject: value forKey: name]; } -- (void)setBody: (OFString*)file +- (void)setBody: (OFString *)file { [_body release]; if ([file isEqual: @"-"]) { void *pool = objc_autoreleasePoolPush(); @@ -172,11 +172,11 @@ objc_autoreleasePoolPop(pool); } else _body = [[OFDataArray alloc] initWithContentsOfFile: file]; } -- (void)setMethod: (OFString*)method +- (void)setMethod: (OFString *)method { void *pool = objc_autoreleasePoolPush(); method = [method uppercaseString]; @@ -201,11 +201,11 @@ } objc_autoreleasePoolPop(pool); } -- (void)setProxy: (OFString*)proxy +- (void)setProxy: (OFString *)proxy { @try { size_t pos = [proxy rangeOfString: @":" options: OF_STRING_SEARCH_BACKWARDS].location; @@ -369,31 +369,31 @@ [self performSelector: @selector(downloadNextURL) afterDelay: 0]; } -- (void)client: (OFHTTPClient*)client - didCreateSocket: (OF_KINDOF(OFTCPSocket*))socket - request: (OFHTTPRequest*)request +- (void)client: (OFHTTPClient *)client + didCreateSocket: (OF_KINDOF(OFTCPSocket *))socket + request: (OFHTTPRequest *)request { if (_insecure && [socket respondsToSelector: @selector(setCertificateVerificationEnabled:)]) [socket setCertificateVerificationEnabled: false]; } -- (bool)client: (OFHTTPClient*)client - shouldFollowRedirect: (OFURL*)URL +- (bool)client: (OFHTTPClient *)client + shouldFollowRedirect: (OFURL *)URL statusCode: (int)statusCode - request: (OFHTTPRequest*)request - response: (OFHTTPResponse*)response + request: (OFHTTPRequest *)request + response: (OFHTTPResponse *)response { if (!_quiet) [of_stdout writeFormat: @" ➜ %d\n", statusCode]; if (_verbose) { void *pool = objc_autoreleasePoolPush(); - OFDictionary OF_GENERIC(OFString*, OFString*) *headers = + OFDictionary OF_GENERIC(OFString *, OFString *) *headers = [response headers]; OFEnumerator *keyEnumerator = [headers keyEnumerator]; OFEnumerator *objectEnumerator = [headers objectEnumerator]; OFString *key, *object; @@ -410,11 +410,11 @@ [of_stdout writeFormat: @"☇ %@", [URL string]]; return true; } -- (OFHTTPResponse*)performRequest: (OFHTTPRequest*)request +- (OFHTTPResponse *)performRequest: (OFHTTPRequest *)request { OFHTTPResponse *response = nil; @try { response = [_HTTPClient performRequest: request]; @@ -500,11 +500,11 @@ [of_stdout writeFormat: @" ➜ %d\n", [response statusCode]]; return response; } -- (OFString*)fileNameFromContentDisposition: (OFString*)contentDisposition +- (OFString *)fileNameFromContentDisposition: (OFString *)contentDisposition { void *pool; const char *UTF8String; size_t UTF8StringLength; enum { @@ -620,14 +620,14 @@ [fileName retain]; objc_autoreleasePoolPop(pool); return [fileName autorelease]; } -- (bool)stream: (OFHTTPResponse*)response - didReadIntoBuffer: (void*)buffer +- (bool)stream: (OFHTTPResponse *)response + didReadIntoBuffer: (void *)buffer length: (size_t)length - exception: (OFException*)e + exception: (OFException *)e { if (e != nil) { OFString *URL; [_progressBar stop]; @@ -687,11 +687,11 @@ OFString *URLString = nil; OFURL *URL; OFMutableDictionary *clientHeaders; OFHTTPRequest *request; OFHTTPResponse *response; - OFDictionary OF_GENERIC(OFString*, OFString*) *headers; + OFDictionary OF_GENERIC(OFString *, OFString *) *headers; OFString *fileName = nil, *lengthString, *type; _length = -1; _received = _resumedFrom = 0; @@ -827,12 +827,12 @@ lengthString = OF_LOCALIZED(@"size_unknown", @"unknown"); if (_verbose) { void *pool = objc_autoreleasePoolPush(); - OFDictionary OF_GENERIC(OFString*, OFString*) *headers = - [response headers]; + OFDictionary OF_GENERIC(OFString *, OFString *) + *headers = [response headers]; OFEnumerator *keyEnumerator = [headers keyEnumerator]; OFEnumerator *objectEnumerator = [headers objectEnumerator]; OFString *key, *object; Index: utils/ofzip/Archive.h ================================================================== --- utils/ofzip/Archive.h +++ utils/ofzip/Archive.h @@ -17,11 +17,11 @@ #import "OFObject.h" #import "OFFile.h" #import "OFArray.h" @protocol Archive -+ (instancetype)archiveWithStream: (OF_KINDOF(OFStream*))stream; -- initWithStream: (OF_KINDOF(OFStream*))stream; ++ (instancetype)archiveWithStream: (OF_KINDOF(OFStream *))stream; +- initWithStream: (OF_KINDOF(OFStream *))stream; - (void)listFiles; -- (void)extractFiles: (OFArray OF_GENERIC(OFString*)*)files; -- (void)printFiles: (OFArray OF_GENERIC(OFString*)*)files; +- (void)extractFiles: (OFArray OF_GENERIC(OFString *) *)files; +- (void)printFiles: (OFArray OF_GENERIC(OFString* ) *)files; @end Index: utils/ofzip/GZIPArchive.m ================================================================== --- utils/ofzip/GZIPArchive.m +++ utils/ofzip/GZIPArchive.m @@ -43,19 +43,19 @@ @implementation GZIPArchive + (void)initialize { if (self == [GZIPArchive class]) - app = (OFZIP*)[[OFApplication sharedApplication] delegate]; + app = (OFZIP *)[[OFApplication sharedApplication] delegate]; } -+ (instancetype)archiveWithStream: (OF_KINDOF(OFStream*))stream ++ (instancetype)archiveWithStream: (OF_KINDOF(OFStream *))stream { return [[[self alloc] initWithStream: stream] autorelease]; } -- initWithStream: (OF_KINDOF(OFStream*))stream +- initWithStream: (OF_KINDOF(OFStream *))stream { self = [super init]; @try { _stream = [[OFGZIPStream alloc] initWithStream: stream]; @@ -79,11 +79,11 @@ [of_stderr writeLine: OF_LOCALIZED(@"cannot_list_gz", @"Cannot list files of a .gz archive!")]; app->_exitStatus = 1; } -- (void)extractFiles: (OFArray OF_GENERIC(OFString*)*)files +- (void)extractFiles: (OFArray OF_GENERIC(OFString *) *)files { OFString *fileName; OFFile *output; if ([files count] != 0) { @@ -127,11 +127,11 @@ @"Extracting %[file]... done", @"file", fileName)]; } } -- (void)printFiles: (OFArray OF_GENERIC(OFString*)*)files +- (void)printFiles: (OFArray OF_GENERIC(OFString *) *)files { OFString *fileName = [[app->_archivePath lastPathComponent] stringByDeletingPathExtension]; if ([files count] > 0) { Index: utils/ofzip/OFZIP.h ================================================================== --- utils/ofzip/OFZIP.h +++ utils/ofzip/OFZIP.h @@ -35,13 +35,13 @@ int8_t _outputLevel; OFString *_archivePath; int _exitStatus; } -- (id )openArchiveWithPath: (OFString*)path - type: (OFString*)type; -- (bool)shouldExtractFile: (OFString*)fileName - outFileName: (OFString*)outFileName; -- (ssize_t)copyBlockFromStream: (OFStream*)input - toStream: (OFStream*)output - fileName: (OFString*)fileName; +- (id )openArchiveWithPath: (OFString *)path + type: (OFString *)type; +- (bool)shouldExtractFile: (OFString *)fileName + outFileName: (OFString *)outFileName; +- (ssize_t)copyBlockFromStream: (OFStream *)input + toStream: (OFStream *)output + fileName: (OFString *)fileName; @end Index: utils/ofzip/OFZIP.m ================================================================== --- utils/ofzip/OFZIP.m +++ utils/ofzip/OFZIP.m @@ -134,11 +134,11 @@ { 'x', @"extract", 0, NULL, NULL }, { '\0', nil, 0, NULL, NULL } }; OFOptionsParser *optionsParser; of_unichar_t option, mode = '\0'; - OFArray OF_GENERIC(OFString*) *remainingArguments, *files; + OFArray OF_GENERIC(OFString *) *remainingArguments, *files; id archive; #ifdef OF_HAVE_SANDBOX OFSandbox *sandbox = [[OFSandbox alloc] init]; @try { @@ -295,12 +295,12 @@ } [OFApplication terminateWithStatus: _exitStatus]; } -- (id )openArchiveWithPath: (OFString*)path - type: (OFString*)type +- (id )openArchiveWithPath: (OFString *)path + type: (OFString *)type { OFFile *file = nil; id archive = nil; [_archivePath release]; @@ -382,12 +382,12 @@ } return archive; } -- (bool)shouldExtractFile: (OFString*)fileName - outFileName: (OFString*)outFileName +- (bool)shouldExtractFile: (OFString *)fileName + outFileName: (OFString *)outFileName { OFString *line; if (_overwrite == 1 || ![[OFFileManager defaultManager] fileExistsAtPath: outFileName]) @@ -440,13 +440,13 @@ @"file", fileName)]; return true; } -- (ssize_t)copyBlockFromStream: (OFStream*)input - toStream: (OFStream*)output - fileName: (OFString*)fileName +- (ssize_t)copyBlockFromStream: (OFStream *)input + toStream: (OFStream *)output + fileName: (OFString *)fileName { char buffer[BUFFER_SIZE]; size_t length; @try { Index: utils/ofzip/TarArchive.m ================================================================== --- utils/ofzip/TarArchive.m +++ utils/ofzip/TarArchive.m @@ -54,19 +54,19 @@ @implementation TarArchive + (void)initialize { if (self == [TarArchive class]) - app = (OFZIP*)[[OFApplication sharedApplication] delegate]; + app = (OFZIP *)[[OFApplication sharedApplication] delegate]; } -+ (instancetype)archiveWithStream: (OF_KINDOF(OFStream*))stream ++ (instancetype)archiveWithStream: (OF_KINDOF(OFStream *))stream { return [[[self alloc] initWithStream: stream] autorelease]; } -- initWithStream: (OF_KINDOF(OFStream*))stream +- initWithStream: (OF_KINDOF(OFStream *))stream { self = [super init]; @try { _archive = [[OFTarArchive alloc] initWithStream: stream]; @@ -233,23 +233,23 @@ objc_autoreleasePoolPop(pool); } } -- (void)extractFiles: (OFArray OF_GENERIC(OFString*)*)files +- (void)extractFiles: (OFArray OF_GENERIC(OFString *) *)files { OFFileManager *fileManager = [OFFileManager defaultManager]; bool all = ([files count] == 0); - OFMutableSet OF_GENERIC(OFString*) *missing = + OFMutableSet OF_GENERIC(OFString *) *missing = [OFMutableSet setWithArray: files]; OFTarArchiveEntry *entry; while ((entry = [_archive nextEntry]) != nil) { void *pool = objc_autoreleasePoolPush(); OFString *fileName = [entry fileName]; OFString *outFileName = [fileName stringByStandardizingPath]; - OFArray OF_GENERIC(OFString*) *pathComponents; + OFArray OF_GENERIC(OFString *) *pathComponents; OFString *directory; OFFile *output; uint64_t written = 0, size = [entry size]; int8_t percent = -1, newPercent; @@ -381,11 +381,11 @@ app->_exitStatus = 1; } } -- (void)printFiles: (OFArray OF_GENERIC(OFString*)*)files_ +- (void)printFiles: (OFArray OF_GENERIC(OFString *) *)files_ { OFMutableSet *files; OFTarArchiveEntry *entry; if ([files_ count] < 1) { Index: utils/ofzip/ZIPArchive.m ================================================================== --- utils/ofzip/ZIPArchive.m +++ utils/ofzip/ZIPArchive.m @@ -54,19 +54,19 @@ @implementation ZIPArchive + (void)initialize { if (self == [ZIPArchive class]) - app = (OFZIP*)[[OFApplication sharedApplication] delegate]; + app = (OFZIP *)[[OFApplication sharedApplication] delegate]; } -+ (instancetype)archiveWithStream: (OF_KINDOF(OFStream*))stream ++ (instancetype)archiveWithStream: (OF_KINDOF(OFStream *))stream { return [[[self alloc] initWithStream: stream] autorelease]; } -- initWithStream: (OF_KINDOF(OFStream*))stream +- initWithStream: (OF_KINDOF(OFStream *))stream { self = [super init]; @try { _archive = [[OFZIPArchive alloc] @@ -185,22 +185,22 @@ objc_autoreleasePoolPop(pool); } } -- (void)extractFiles: (OFArray OF_GENERIC(OFString*)*)files +- (void)extractFiles: (OFArray OF_GENERIC(OFString *) *)files { OFFileManager *fileManager = [OFFileManager defaultManager]; bool all = ([files count] == 0); - OFMutableSet OF_GENERIC(OFString*) *missing = + OFMutableSet OF_GENERIC(OFString *) *missing = [OFMutableSet setWithArray: files]; for (OFZIPArchiveEntry *entry in [_archive entries]) { void *pool = objc_autoreleasePoolPush(); OFString *fileName = [entry fileName]; OFString *outFileName = [fileName stringByStandardizingPath]; - OFArray OF_GENERIC(OFString*) *pathComponents; + OFArray OF_GENERIC(OFString *) *pathComponents; OFString *directory; OFStream *stream; OFFile *output; uint64_t written = 0, size = [entry uncompressedSize]; int8_t percent = -1, newPercent; @@ -325,11 +325,11 @@ app->_exitStatus = 1; } } -- (void)printFiles: (OFArray OF_GENERIC(OFString*)*)files +- (void)printFiles: (OFArray OF_GENERIC(OFString *) *)files { OFStream *stream; if ([files count] < 1) { [of_stderr writeLine: OF_LOCALIZED(@"print_no_file_specified",