Index: src/OFApplication.h ================================================================== --- src/OFApplication.h +++ src/OFApplication.h @@ -182,12 +182,12 @@ * @brief Gets args and argv. * * @param argc A pointer where a pointer to argc should be stored * @param argv A pointer where a pointer to argv should be stored */ -- (void)getArgumentCount: (__nonnull int **__nonnull)argc - andArgumentValues: (__nonnull char **__nonnull *__nonnull[])argv; +- (void)getArgumentCount: (int *OF_NONNULL *OF_NONNULL)argc + andArgumentValues: (char *OF_NONNULL *OF_NONNULL *OF_NONNULL[])argv; /*! * @brief Returns the name of the program (argv[0]). * * @return The name of the program (argv[0]) @@ -239,12 +239,12 @@ @end #ifdef __cplusplus extern "C" { #endif -extern int of_application_main(__nonnull int*, __nonnull char **__nonnull[], +extern int of_application_main(int *OF_NONNULL, char *OF_NONNULL *OF_NONNULL[], Class); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -67,20 +67,20 @@ * * @param object The object to map * @param index The index of the object to map * @return The object to map to */ -typedef __nonnull id (^of_array_map_block_t)(id object, size_t index); +typedef id OF_NONNULL (^of_array_map_block_t)(id object, size_t index); /*! * @brief A block for folding an OFArray. * * @param left The object to which the object has been folded so far * @param right The object that should be added to the left object * @return The left and right side folded into one object */ -typedef __nullable id (^of_array_fold_block_t)(__nullable id left, id right); +typedef id OF_NULLABLE (^of_array_fold_block_t)(id OF_NULLABLE left, id right); #endif /*! * @class OFArray OFArray.h ObjFW/OFArray.h * @@ -137,12 +137,13 @@ * * @param objects A C array of objects * @param count The length of the C array * @return A new autoreleased OFArray */ -+ (instancetype)arrayWithObjects: (__nonnull ObjectType const *__nonnull)objects - count: (size_t)count; ++ (instancetype) + arrayWithObjects: (ObjectType const OF_NONNULL *OF_NONNULL)objects + count: (size_t)count; /*! * @brief Initializes an OFArray with the specified object. * * @param object An object @@ -182,11 +183,11 @@ * * @param objects A C array of objects * @param count The length of the C array * @return An initialized OFArray */ -- initWithObjects: (__nonnull ObjectType const *__nonnull)objects +- initWithObjects: (ObjectType const OF_NONNULL *OF_NONNULL)objects count: (size_t)count; /*! * @brief Returns the object at the specified index in the array. * @@ -203,19 +204,20 @@ * @brief Copies the objects at the specified range to the specified buffer. * * @param buffer The buffer to copy the objects to * @param range The range to copy */ -- (void)getObjects: (__unsafe_unretained __nonnull ObjectType *__nonnull)buffer +- (void)getObjects: (ObjectType __unsafe_unretained OF_NONNULL *OF_NONNULL) + buffer inRange: (of_range_t)range; /*! * @brief Returns the objects of the array as a C array. * * @return The objects of the array as a C array */ -- (__nonnull ObjectType const *__nonnull)objects; +- (ObjectType const __unsafe_unretained OF_NONNULL *OF_NONNULL)objects; /*! * @brief Returns the index of the first object that is equivalent to the * specified object or `OF_NOT_FOUND` if it was not found. * @@ -467,11 +469,11 @@ unsigned long *_mutationsPtr; size_t _position; } - initWithArray: (OFArray*)data - mutationsPtr: (__nullable unsigned long*)mutationsPtr; + mutationsPtr: (unsigned long *OF_NULLABLE)mutationsPtr; @end OF_ASSUME_NONNULL_END #import "OFMutableArray.h" Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -36,11 +36,11 @@ #ifdef OF_HAVE_BLOCKS typedef void (^of_dictionary_enumeration_block_t)(id key, id object, bool *stop); typedef bool (^of_dictionary_filter_block_t)(id key, id object); -typedef __nonnull id (^of_dictionary_map_block_t)(id key, id object); +typedef id OF_NONNULL (^of_dictionary_map_block_t)(id key, id object); #endif /*! * @class OFDictionary OFDictionary.h ObjFW/OFDictionary.h * @@ -106,12 +106,12 @@ * @param objects An array of objects * @param count The number of objects in the arrays * @return A new autoreleased OFDictionary */ + (instancetype) - dictionaryWithObjects: (__nonnull ObjectType const *__nonnull)objects - forKeys: (__nonnull KeyType const *__nonnull)keys + dictionaryWithObjects: (ObjectType const OF_NONNULL *OF_NONNULL)objects + forKeys: (KeyType const OF_NONNULL *OF_NONNULL)keys count: (size_t)count; /*! * @brief Creates a new OFDictionary with the specified keys objects. * @@ -159,12 +159,12 @@ * @param keys An array of keys * @param objects An array of objects * @param count The number of objects in the arrays * @return An initialized OFDictionary */ -- initWithObjects: (__nonnull ObjectType const *__nonnull)objects - forKeys: (__nonnull KeyType const *__nonnull)keys +- initWithObjects: (ObjectType const OF_NONNULL *OF_NONNULL)objects + forKeys: (KeyType const OF_NONNULL *OF_NONNULL)keys count: (size_t)count; /*! * @brief Initializes an already allocated OFDictionary with the specified keys * and objects. Index: src/OFEnumerator.h ================================================================== --- src/OFEnumerator.h +++ src/OFEnumerator.h @@ -90,13 +90,13 @@ #ifndef NSINTEGER_DEFINED typedef struct { /// Arbitrary state information for the enumeration unsigned long state; /// Pointer to a C array of objects to return - __unsafe_unretained __nullable id *__nullable itemsPtr; + id __unsafe_unretained OF_NULLABLE *OF_NULLABLE itemsPtr; /// Arbitrary state information to detect mutations - __nullable unsigned long *mutationsPtr; + unsigned long *OF_NULLABLE mutationsPtr; /// Additional arbitrary state information unsigned long extra[5]; } of_fast_enumeration_state_t; #endif @@ -118,11 +118,11 @@ * @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 - objects: (__unsafe_unretained __nonnull id - *__nonnull)objects + objects: (id __unsafe_unretained OF_NONNULL + *OF_NONNULL)objects count: (int)count; @end OF_ASSUME_NONNULL_END Index: src/OFHTTPRequest.h ================================================================== --- src/OFHTTPRequest.h +++ src/OFHTTPRequest.h @@ -239,11 +239,11 @@ * @brief Returns a C string describing the specified request method. * * @param method The request method which should be described as a C string * @return A C string describing the specified request method */ -extern __nullable const char* of_http_request_method_to_string( +extern const char *OF_NULLABLE of_http_request_method_to_string( of_http_request_method_t method); /*! * @brief Returns the request method for the specified string. * Index: src/OFKernelEventObserver_poll.h ================================================================== --- src/OFKernelEventObserver_poll.h +++ src/OFKernelEventObserver_poll.h @@ -22,10 +22,10 @@ @interface OFKernelEventObserver_poll: OFKernelEventObserver { OFDataArray *_FDs; size_t _maxFD; - __unsafe_unretained id *_FDToObject; + id __unsafe_unretained *_FDToObject; } @end OF_ASSUME_NONNULL_END Index: src/OFList.h ================================================================== --- src/OFList.h +++ src/OFList.h @@ -34,11 +34,11 @@ /// A pointer to the next list object in the list of_list_object_t *next; /// A pointer to the previous list object in the list of_list_object_t *previous; /// The object for the list object - __unsafe_unretained id object; + id __unsafe_unretained object; }; /*! * @class OFList OFList.h ObjFW/OFList.h * Index: src/OFMapTable.h ================================================================== --- src/OFMapTable.h +++ src/OFMapTable.h @@ -26,18 +26,17 @@ * * @brief A struct describing the functions to be used by the map table. */ typedef struct { /// The function to retain keys / values - __nonnull void* (*__nullable retain)(__nonnull void *value); + void *OF_NONNULL (*OF_NULLABLE retain)(void *value); /// The function to release keys / values - void (*__nullable release)(__nonnull void *value); + void (*OF_NULLABLE release)(void *value); /// The function to hash keys - uint32_t (*__nullable hash)(__nonnull void *value); + uint32_t (*OF_NULLABLE hash)(void *value); /// The function to compare keys / values - bool (*__nullable equal)(__nonnull void *value1, - __nonnull void *value2); + bool (*OF_NULLABLE equal)(void *value1, void *value2); } of_map_table_functions_t; #ifdef OF_HAVE_BLOCKS /*! * @brief A block for enumerating an OFMapTable. @@ -55,11 +54,12 @@ * * @param key The key of the value to replace * @param value The value to replace * @return The value to replace the value with */ -typedef __nonnull void* (^of_map_table_replace_block_t)(void *key, void *value); +typedef void *OF_NONNULL (^of_map_table_replace_block_t)( + void *key, void *value); #endif @class OFMapTableEnumerator; /*! Index: src/OFMutableArray.h ================================================================== --- src/OFMutableArray.h +++ src/OFMutableArray.h @@ -26,11 +26,11 @@ * * @param object The object to replace * @param index The index of the object to replace * @return The object to replace the object with */ -typedef __nonnull id (^of_array_replace_block_t)(id object, size_t index); +typedef id OF_NONNULL (^of_array_replace_block_t)(id object, size_t index); #endif /*! * @class OFMutableArray OFArray.h ObjFW/OFArray.h * Index: src/OFMutableDictionary.h ================================================================== --- src/OFMutableDictionary.h +++ src/OFMutableDictionary.h @@ -26,11 +26,11 @@ * * @param key The key of the object to replace * @param object The object to replace * @return The object to replace the object with */ -typedef __nonnull id (^of_dictionary_replace_block_t)(id key, id object); +typedef id OF_NONNULL (^of_dictionary_replace_block_t)(id key, id object); #endif /*! * @class OFMutableDictionary OFDictionary.h ObjFW/OFDictionary.h * Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -941,15 +941,15 @@ #ifdef __cplusplus extern "C" { #endif extern id of_alloc_object(Class class_, size_t extraSize, - size_t extraAlignment, __nonnull void **__nullable extra); + size_t extraAlignment, void *OF_NULLABLE *OF_NULLABLE extra); extern void OF_NO_RETURN_FUNC of_method_not_found(id self, SEL _cmd); extern uint32_t of_hash_seed; #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END #import "OFObject+Serialization.h" Index: src/OFSet.h ================================================================== --- src/OFSet.h +++ src/OFSet.h @@ -105,11 +105,11 @@ * * @param objects An array of objects for the set * @param count The number of objects in the specified array * @return A new, autoreleased set with the specified objects */ -+ (instancetype)setWithObjects: (__nonnull ObjectType const *__nonnull)objects ++ (instancetype)setWithObjects: (ObjectType const OF_NONNULL *OF_NONNULL)objects count: (size_t)count; /*! * @brief Initializes an already allocated set with the specified set. * @@ -139,11 +139,11 @@ * * @param objects An array of objects for the set * @param count The number of objects in the specified array * @return An initialized set with the specified objects */ -- initWithObjects: (__nonnull ObjectType const *__nonnull)objects +- initWithObjects: (ObjectType const OF_NONNULL *OF_NONNULL)objects count: (size_t)count; /*! * @brief Initializes an already allocated set with the specified object and * va_list. Index: src/OFStdIOStream.h ================================================================== --- src/OFStdIOStream.h +++ src/OFStdIOStream.h @@ -39,23 +39,23 @@ /*! @file */ /*! * @brief The standard input as an OFStream. */ -extern __nullable OFStdIOStream *of_stdin; +extern OFStdIOStream *OF_NULLABLE of_stdin; /*! * @brief The standard output as an OFStream. */ -extern __nullable OFStdIOStream *of_stdout; +extern OFStdIOStream *OF_NULLABLE of_stdout; /*! * @brief The standard error as an OFStream. */ -extern __nullable OFStdIOStream *of_stderr; +extern OFStdIOStream *OF_NULLABLE of_stderr; extern void of_log(OFConstantString*, ...); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/OFStream.h ================================================================== --- src/OFStream.h +++ src/OFStream.h @@ -46,11 +46,11 @@ * @param length The length of the data that has been read * @param exception An exception which occurred while reading or nil on success * @return A bool whether the same block should be used for the next read */ typedef bool (^of_stream_async_read_block_t)(OFStream *stream, void *buffer, - size_t length, __nullable OFException *exception); + size_t length, OFException *OF_NULLABLE exception); /*! * @brief A block which is called when a line was read from the stream. * * @param stream The stream on which a line was read @@ -58,11 +58,11 @@ * occurred * @param exception An exception which occurred while reading or nil on success * @return A bool whether the same block should be used for the next read */ typedef bool (^of_stream_async_read_line_block_t)(OFStream *stream, - __nullable OFString *line, __nullable OFException *exception); + OFString *OF_NULLABLE line, OFException *OF_NULLABLE exception); #endif /*! * @class OFStream OFStream.h ObjFW/OFStream.h * Index: src/OFString+XMLUnescaping.h ================================================================== --- src/OFString+XMLUnescaping.h +++ src/OFString+XMLUnescaping.h @@ -35,11 +35,11 @@ * * @param string The XML string which contains an unknown entity * @param entity The XML entity which is unknown * @return A replacement string for the unknown entity */ -typedef __nullable OFString* (^of_string_xml_unescaping_block_t)( +typedef OFString *OF_NULLABLE (^of_string_xml_unescaping_block_t)( OFString *string, OFString *entity); #endif /*! * @protocol OFStringXMLUnescapingDelegate OFString.h ObjFW/OFString.h Index: src/OFTCPSocket.h ================================================================== --- src/OFTCPSocket.h +++ src/OFTCPSocket.h @@ -32,11 +32,11 @@ * @param socket The socket which connected * @param exception An exception which occurred while connecting the socket or * nil on success */ typedef void (^of_tcp_socket_async_connect_block_t)(OFTCPSocket *socket, - __nullable OFException *exception); + OFException *OF_NULLABLE exception); /*! * @brief A block which is called when the socket accepted a connection. * * @param socket The socket which accepted the connection @@ -45,11 +45,11 @@ * nil on success * @return A bool whether the same block should be used for the next incoming * connection */ typedef bool (^of_tcp_socket_async_accept_block_t)(OFTCPSocket *socket, - OFTCPSocket *acceptedSocket, __nullable OFException *exception); + OFTCPSocket *acceptedSocket, OFException *OF_NULLABLE exception); #endif /*! * @class OFTCPSocket OFTCPSocket.h ObjFW/OFTCPSocket.h * @@ -275,11 +275,11 @@ @end #ifdef __cplusplus extern "C" { #endif -extern __nullable Class of_tls_socket_class; +extern Class OF_NULLABLE of_tls_socket_class; #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/OFThread.h ================================================================== --- src/OFThread.h +++ src/OFThread.h @@ -32,11 +32,11 @@ /*! * @brief A block to be executed in a new thread. * * @return The object which should be returned when the thread is joined */ -typedef __nullable id (^of_thread_block_t)(void); +typedef id OF_NULLABLE (^of_thread_block_t)(void); #endif /*! * @class OFThread OFThread.h ObjFW/OFThread.h * Index: src/OFUDPSocket.h ================================================================== --- src/OFUDPSocket.h +++ src/OFUDPSocket.h @@ -47,11 +47,11 @@ * @param exception An exception which occurred while resolving or nil on * success */ typedef void (^of_udp_socket_async_resolve_block_t)(OFString *host, uint16_t port, of_udp_socket_address_t address, - __nullable OFException *exception); + OFException *OF_NULLABLE exception); /*! * @brief A block which is called when a packet has been received. * * @param socket The UDP which received a packet @@ -62,11 +62,11 @@ * success * @return A bool whether the same block should be used for the next receive */ typedef bool (^of_udp_socket_async_receive_block_t)(OFUDPSocket *socket, void *buffer, size_t length, of_udp_socket_address_t sender, - __nullable OFException *exception); + OFException *OF_NULLABLE exception); #endif /*! * @class OFUDPSocket OFUDPSocket.h ObjFW/OFUDPSocket.h * @@ -152,12 +152,12 @@ * 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: (__nonnull OFString *__autoreleasing *__nullable)host - andPort: (__nullable uint16_t*)port ++ (void)getHost: (OFString *__autoreleasing OF_NONNULL *OF_NULLABLE)host + andPort: (uint16_t *OF_NULLABLE)port forAddress: (of_udp_socket_address_t*)address; /*! * @brief Binds the socket to the specified host and port. * Index: src/OFZIPArchiveEntry.h ================================================================== --- src/OFZIPArchiveEntry.h +++ src/OFZIPArchiveEntry.h @@ -233,11 +233,11 @@ * @param data A pointer to a pointer that should be set to the start of the * extra field with the specified tag * @param size A pointer to an uint16_t that should be set to the size */ extern void of_zip_archive_entry_extra_field_find(OFDataArray *extraField, - uint16_t tag, __nonnull uint8_t **__nonnull data, __nonnull uint16_t *size); + uint16_t tag, uint8_t *OF_NONNULL *OF_NONNULL data, uint16_t *size); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/atomic.h ================================================================== --- src/atomic.h +++ src/atomic.h @@ -29,11 +29,11 @@ #endif OF_ASSUME_NONNULL_BEGIN static OF_INLINE int -of_atomic_int_add(volatile __nonnull int *p, int i) +of_atomic_int_add(volatile int *OF_NONNULL p, int i) { #if !defined(OF_HAVE_THREADS) return (*p += i); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_add_and_fetch(p, i); @@ -78,11 +78,11 @@ # error of_atomic_int_add not implemented! #endif } static OF_INLINE int32_t -of_atomic_int32_add(volatile __nonnull int32_t *p, int32_t i) +of_atomic_int32_add(volatile int32_t *OF_NONNULL p, int32_t i) { #if !defined(OF_HAVE_THREADS) return (*p += i); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_add_and_fetch(p, i); @@ -114,11 +114,11 @@ # error of_atomic_int32_add not implemented! #endif } static OF_INLINE void* -of_atomic_ptr_add(__nullable void *volatile *__nonnull p, intptr_t i) +of_atomic_ptr_add(void *volatile OF_NULLABLE *OF_NONNULL p, intptr_t i) { #if !defined(OF_HAVE_THREADS) return (*(char* volatile*)p += i); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_add_and_fetch(p, (void*)i); @@ -164,11 +164,11 @@ # error of_atomic_ptr_add not implemented! #endif } static OF_INLINE int -of_atomic_int_sub(volatile __nonnull int *p, int i) +of_atomic_int_sub(volatile int *OF_NONNULL p, int i) { #if !defined(OF_HAVE_THREADS) return (*p -= i); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_sub_and_fetch(p, i); @@ -215,11 +215,11 @@ # error of_atomic_int_sub not implemented! #endif } static OF_INLINE int32_t -of_atomic_int32_sub(volatile __nonnull int32_t *p, int32_t i) +of_atomic_int32_sub(volatile int32_t *OF_NONNULL p, int32_t i) { #if !defined(OF_HAVE_THREADS) return (*p -= i); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_sub_and_fetch(p, i); @@ -252,11 +252,11 @@ # error of_atomic_int32_sub not implemented! #endif } static OF_INLINE void* -of_atomic_ptr_sub(__nullable void *volatile *__nonnull p, intptr_t i) +of_atomic_ptr_sub(void *volatile OF_NULLABLE *OF_NONNULL p, intptr_t i) { #if !defined(OF_HAVE_THREADS) return (*(char* volatile*)p -= i); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_sub_and_fetch(p, (void*)i); @@ -304,11 +304,11 @@ # error of_atomic_ptr_sub not implemented! #endif } static OF_INLINE int -of_atomic_int_inc(volatile __nonnull int *p) +of_atomic_int_inc(volatile int *OF_NONNULL p) { #if !defined(OF_HAVE_THREADS) return ++*p; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_add_and_fetch(p, 1); @@ -361,11 +361,11 @@ # error of_atomic_int_inc not implemented! #endif } static OF_INLINE int32_t -of_atomic_int32_inc(volatile __nonnull int32_t *p) +of_atomic_int32_inc(volatile int32_t *OF_NONNULL p) { #if !defined(OF_HAVE_THREADS) return ++*p; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_add_and_fetch(p, 1); @@ -403,11 +403,11 @@ # error of_atomic_int32_inc not implemented! #endif } static OF_INLINE int -of_atomic_int_dec(volatile __nonnull int *p) +of_atomic_int_dec(volatile int *OF_NONNULL p) { #if !defined(OF_HAVE_THREADS) return --*p; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_sub_and_fetch(p, 1); @@ -460,11 +460,11 @@ # error of_atomic_int_dec not implemented! #endif } static OF_INLINE int32_t -of_atomic_int32_dec(volatile __nonnull int32_t *p) +of_atomic_int32_dec(volatile int32_t *OF_NONNULL p) { #if !defined(OF_HAVE_THREADS) return --*p; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_sub_and_fetch(p, 1); @@ -502,11 +502,11 @@ # error of_atomic_int32_dec not implemented! #endif } static OF_INLINE unsigned int -of_atomic_int_or(volatile __nonnull unsigned int *p, unsigned int i) +of_atomic_int_or(volatile unsigned int *OF_NONNULL p, unsigned int i) { #if !defined(OF_HAVE_THREADS) return (*p |= i); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_or_and_fetch(p, i); @@ -561,11 +561,11 @@ # error of_atomic_int_or not implemented! #endif } static OF_INLINE uint32_t -of_atomic_int32_or(volatile __nonnull uint32_t *p, uint32_t i) +of_atomic_int32_or(volatile uint32_t *OF_NONNULL p, uint32_t i) { #if !defined(OF_HAVE_THREADS) return (*p |= i); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_or_and_fetch(p, i); @@ -602,11 +602,11 @@ # error of_atomic_int32_or not implemented! #endif } static OF_INLINE unsigned int -of_atomic_int_and(volatile __nonnull unsigned int *p, unsigned int i) +of_atomic_int_and(volatile unsigned int *OF_NONNULL p, unsigned int i) { #if !defined(OF_HAVE_THREADS) return (*p &= i); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_and_and_fetch(p, i); @@ -661,11 +661,11 @@ # error of_atomic_int_and not implemented! #endif } static OF_INLINE uint32_t -of_atomic_int32_and(volatile __nonnull uint32_t *p, uint32_t i) +of_atomic_int32_and(volatile uint32_t *OF_NONNULL p, uint32_t i) { #if !defined(OF_HAVE_THREADS) return (*p &= i); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_and_and_fetch(p, i); @@ -702,11 +702,11 @@ # error of_atomic_int32_and not implemented! #endif } static OF_INLINE unsigned int -of_atomic_int_xor(volatile __nonnull unsigned int *p, unsigned int i) +of_atomic_int_xor(volatile unsigned int *OF_NONNULL p, unsigned int i) { #if !defined(OF_HAVE_THREADS) return (*p ^= i); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_xor_and_fetch(p, i); @@ -761,11 +761,11 @@ # error of_atomic_int_xor not implemented! #endif } static OF_INLINE uint32_t -of_atomic_int32_xor(volatile __nonnull uint32_t *p, uint32_t i) +of_atomic_int32_xor(volatile uint32_t *OF_NONNULL p, uint32_t i) { #if !defined(OF_HAVE_THREADS) return (*p ^= i); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_xor_and_fetch(p, i); @@ -802,11 +802,11 @@ # error of_atomic_int32_xor not implemented! #endif } static OF_INLINE bool -of_atomic_int_cmpswap(volatile __nonnull int *p, int o, int n) +of_atomic_int_cmpswap(volatile int *OF_NONNULL p, int o, int n) { #if !defined(OF_HAVE_THREADS) if (*p == o) { *p = n; return true; @@ -857,11 +857,11 @@ # error of_atomic_int_cmpswap not implemented! #endif } static OF_INLINE bool -of_atomic_int32_cmpswap(volatile __nonnull int32_t *p, int32_t o, int32_t n) +of_atomic_int32_cmpswap(volatile int32_t *OF_NONNULL p, int32_t o, int32_t n) { #if !defined(OF_HAVE_THREADS) if (*p == o) { *p = n; return true; @@ -912,12 +912,12 @@ # error of_atomic_int32_cmpswap not implemented! #endif } static OF_INLINE bool -of_atomic_ptr_cmpswap(__nullable void *volatile *__nonnull p, - __nullable void *o, __nullable void *n) +of_atomic_ptr_cmpswap(void *volatile OF_NULLABLE *OF_NONNULL p, + void *OF_NULLABLE o, void *OF_NULLABLE n) { #if !defined(OF_HAVE_THREADS) if (*p == o) { *p = n; return true; Index: src/instance.h ================================================================== --- src/instance.h +++ src/instance.h @@ -19,12 +19,12 @@ OF_ASSUME_NONNULL_BEGIN #ifdef __cplusplus extern "C" { #endif -extern id objc_constructInstance(__nullable Class, __nullable void*); +extern id objc_constructInstance(Class OF_NULLABLE, void *OF_NULLABLE); extern void* objc_destructInstance(id); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -175,15 +175,17 @@ #endif #if __has_feature(nullability) # define OF_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") # define OF_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") +# define OF_NONNULL __nonnull +# define OF_NULLABLE __nullable #else # define OF_ASSUME_NONNULL_BEGIN # define OF_ASSUME_NONNULL_END -# define __nonnull -# define __nullable +# define OF_NONNULL +# define OF_NULLABLE # define nonnull # define nullable #endif #if __has_feature(objc_kindof) Index: src/of_asprintf.h ================================================================== --- src/of_asprintf.h +++ src/of_asprintf.h @@ -28,13 +28,14 @@ OF_ASSUME_NONNULL_BEGIN #ifdef __cplusplus extern "C" { #endif -extern int of_asprintf(__nullable char **__nonnull, const __nonnull char*, ...); -extern int of_vasprintf(__nullable char **__nonnull, const __nonnull char*, - va_list); +extern int of_asprintf( + char *OF_NULLABLE *OF_NONNULL, const char *OF_NONNULL, ...); +extern int of_vasprintf( + char *OF_NULLABLE *OF_NONNULL, const char *OF_NONNULL, va_list); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/resolver.h ================================================================== --- src/resolver.h +++ src/resolver.h @@ -47,11 +47,11 @@ * address struct * * @return An array of results. The list is terminated by NULL and should be * free'd after use. */ -extern __nullable of_resolver_result_t **__nonnull +extern of_resolver_result_t *OF_NULLABLE *OF_NONNULL of_resolve_host(OFString *host, uint16_t port, int protocol); /*! * @brief Converts the specified address to a string and port pair. * @@ -62,20 +62,20 @@ * @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, - __nonnull OFString *__autoreleasing *__nullable host, - __nullable uint16_t *port); + OFString *__autoreleasing OF_NONNULL *OF_NULLABLE host, + uint16_t *OF_NULLABLE port); /*! * @brief Frees the results returned by @ref of_resolve_host. * * @param results The results returned by @ref of_resolve_host */ extern void of_resolver_free( - __nullable of_resolver_result_t **__nonnull results); + of_resolver_result_t *OF_NULLABLE *OF_NONNULL results); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/runtime/runtime.h ================================================================== --- src/runtime/runtime.h +++ src/runtime/runtime.h @@ -89,11 +89,11 @@ uintptr_t uid; const char *types; }; struct objc_super { - OBJC_UNSAFE_UNRETAINED id self; + id OBJC_UNSAFE_UNRETAINED self; Class cls; }; struct objc_method { struct objc_selector sel; @@ -182,11 +182,11 @@ #endif struct objc_protocol_list { struct objc_protocol_list *next; long count; - OBJC_UNSAFE_UNRETAINED Protocol *list[1]; + Protocol *OBJC_UNSAFE_UNRETAINED list[1]; }; #ifdef __cplusplus extern "C" { #endif