Index: src/OFEpollKernelEventObserver.m ================================================================== --- src/OFEpollKernelEventObserver.m +++ src/OFEpollKernelEventObserver.m @@ -33,11 +33,11 @@ #import "OFInitializationFailedException.h" #import "OFObserveFailedException.h" #define EVENTLIST_SIZE 64 -static const of_map_table_functions_t mapFunctions = { NULL }; +static const OFMapTableFunctions mapFunctions = { NULL }; @implementation OFEpollKernelEventObserver - (instancetype)init { self = [super init]; Index: src/OFMapTable.h ================================================================== --- src/OFMapTable.h +++ src/OFMapTable.h @@ -19,15 +19,15 @@ OF_ASSUME_NONNULL_BEGIN /** @file */ /** - * @struct of_map_table_functions_t OFMapTable.h ObjFW/OFMapTable.h + * @struct OFMapTableFunctions OFMapTable.h ObjFW/OFMapTable.h * * @brief A struct describing the functions to be used by the map table. */ -struct of_map_table_functions_t { +struct OFMapTableFunctions { /** The function to retain keys / objects */ void *_Nullable (*_Nullable retain)(void *_Nullable object); /** The function to release keys / objects */ void (*_Nullable release)(void *_Nullable object); /** The function to hash keys */ @@ -34,11 +34,11 @@ unsigned long (*_Nullable hash)(void *_Nullable object); /** The function to compare keys / objects */ bool (*_Nullable equal)(void *_Nullable object1, void *_Nullable object2); }; -typedef struct of_map_table_functions_t of_map_table_functions_t; +typedef struct OFMapTableFunctions OFMapTableFunctions; #ifdef OF_HAVE_BLOCKS /** * @brief A block for enumerating an OFMapTable. * @@ -70,26 +70,26 @@ * and objects should be retained, released, compared and hashed. */ OF_SUBCLASSING_RESTRICTED @interface OFMapTable: OFObject { - of_map_table_functions_t _keyFunctions, _objectFunctions; + OFMapTableFunctions _keyFunctions, _objectFunctions; struct of_map_table_bucket *_Nonnull *_Nullable _buckets; unsigned long _count, _capacity; unsigned char _rotate; unsigned long _mutations; } /** * @brief The key functions used by the map table. */ -@property (readonly, nonatomic) of_map_table_functions_t keyFunctions; +@property (readonly, nonatomic) OFMapTableFunctions keyFunctions; /** * @brief The object functions used by the map table. */ -@property (readonly, nonatomic) of_map_table_functions_t objectFunctions; +@property (readonly, nonatomic) OFMapTableFunctions objectFunctions; /** * @brief The number of objects in the map table. */ @property (readonly, nonatomic) size_t count; @@ -99,13 +99,12 @@ * * @param keyFunctions A structure of functions for handling keys * @param objectFunctions A structure of functions for handling objects * @return A new autoreleased OFMapTable */ -+ (instancetype)mapTableWithKeyFunctions: (of_map_table_functions_t)keyFunctions - objectFunctions: (of_map_table_functions_t) - objectFunctions; ++ (instancetype)mapTableWithKeyFunctions: (OFMapTableFunctions)keyFunctions + objectFunctions: (OFMapTableFunctions)objectFunctions; /** * @brief Creates a new OFMapTable with the specified key functions, object * functions and capacity. * @@ -113,13 +112,12 @@ * @param objectFunctions A structure of functions for handling objects * @param capacity A hint about the count of elements expected to be in the map * table * @return A new autoreleased OFMapTable */ -+ (instancetype)mapTableWithKeyFunctions: (of_map_table_functions_t)keyFunctions - objectFunctions: (of_map_table_functions_t) - objectFunctions ++ (instancetype)mapTableWithKeyFunctions: (OFMapTableFunctions)keyFunctions + objectFunctions: (OFMapTableFunctions)objectFunctions capacity: (size_t)capacity; - (instancetype)init OF_UNAVAILABLE; /** @@ -128,12 +126,12 @@ * * @param keyFunctions A structure of functions for handling keys * @param objectFunctions A structure of functions for handling objects * @return An initialized OFMapTable */ -- (instancetype)initWithKeyFunctions: (of_map_table_functions_t)keyFunctions - objectFunctions: (of_map_table_functions_t)objectFunctions; +- (instancetype)initWithKeyFunctions: (OFMapTableFunctions)keyFunctions + objectFunctions: (OFMapTableFunctions)objectFunctions; /** * @brief Initializes an already allocated OFMapTable with the specified key * functions, object functions and capacity. * @@ -141,12 +139,12 @@ * @param objectFunctions A structure of functions for handling objects * @param capacity A hint about the count of elements expected to be in the map * table * @return An initialized OFMapTable */ -- (instancetype)initWithKeyFunctions: (of_map_table_functions_t)keyFunctions - objectFunctions: (of_map_table_functions_t)objectFunctions +- (instancetype)initWithKeyFunctions: (OFMapTableFunctions)keyFunctions + objectFunctions: (OFMapTableFunctions)objectFunctions capacity: (size_t)capacity OF_DESIGNATED_INITIALIZER; /** * @brief Returns the object for the given key or NULL if the key was not found. Index: src/OFMapTable.m ================================================================== --- src/OFMapTable.m +++ src/OFMapTable.m @@ -75,22 +75,20 @@ @end @implementation OFMapTable @synthesize keyFunctions = _keyFunctions, objectFunctions = _objectFunctions; -+ (instancetype)mapTableWithKeyFunctions: (of_map_table_functions_t)keyFunctions - objectFunctions: (of_map_table_functions_t) - objectFunctions ++ (instancetype)mapTableWithKeyFunctions: (OFMapTableFunctions)keyFunctions + objectFunctions: (OFMapTableFunctions)objectFunctions { return [[[self alloc] initWithKeyFunctions: keyFunctions objectFunctions: objectFunctions] autorelease]; } -+ (instancetype)mapTableWithKeyFunctions: (of_map_table_functions_t)keyFunctions - objectFunctions: (of_map_table_functions_t) - objectFunctions ++ (instancetype)mapTableWithKeyFunctions: (OFMapTableFunctions)keyFunctions + objectFunctions: (OFMapTableFunctions)objectFunctions capacity: (size_t)capacity { return [[[self alloc] initWithKeyFunctions: keyFunctions objectFunctions: objectFunctions @@ -100,20 +98,20 @@ - (instancetype)init { OF_INVALID_INIT_METHOD } -- (instancetype)initWithKeyFunctions: (of_map_table_functions_t)keyFunctions - objectFunctions: (of_map_table_functions_t)objectFunctions +- (instancetype)initWithKeyFunctions: (OFMapTableFunctions)keyFunctions + objectFunctions: (OFMapTableFunctions)objectFunctions { return [self initWithKeyFunctions: keyFunctions objectFunctions: objectFunctions capacity: 0]; } -- (instancetype)initWithKeyFunctions: (of_map_table_functions_t)keyFunctions - objectFunctions: (of_map_table_functions_t)objectFunctions +- (instancetype)initWithKeyFunctions: (OFMapTableFunctions)keyFunctions + objectFunctions: (OFMapTableFunctions)objectFunctions capacity: (size_t)capacity { self = [super init]; @try { Index: src/OFMapTableDictionary.m ================================================================== --- src/OFMapTableDictionary.m +++ src/OFMapTableDictionary.m @@ -57,17 +57,17 @@ equal(void *object1, void *object2) { return [(id)object1 isEqual: (id)object2]; } -static const of_map_table_functions_t keyFunctions = { +static const OFMapTableFunctions keyFunctions = { .retain = copy, .release = release, .hash = hash, .equal = equal }; -static const of_map_table_functions_t objectFunctions = { +static const OFMapTableFunctions objectFunctions = { .retain = retain, .release = release, .hash = hash, .equal = equal }; Index: src/OFMapTableSet.m ================================================================== --- src/OFMapTableSet.m +++ src/OFMapTableSet.m @@ -49,17 +49,17 @@ equal(void *object1, void *object2) { return [(id)object1 isEqual: (id)object2]; } -static const of_map_table_functions_t keyFunctions = { +static const OFMapTableFunctions keyFunctions = { .retain = retain, .release = release, .hash = hash, .equal = equal }; -static const of_map_table_functions_t objectFunctions = { NULL }; +static const OFMapTableFunctions objectFunctions = { NULL }; @implementation OFMapTableSet - (instancetype)init { return [self initWithCapacity: 0]; Index: src/OFOptionsParser.m ================================================================== --- src/OFOptionsParser.m +++ src/OFOptionsParser.m @@ -54,15 +54,15 @@ @try { size_t count = 0; const OFOptionsParserOption *iter; OFOptionsParserOption *iter2; - const of_map_table_functions_t keyFunctions = { + const OFMapTableFunctions keyFunctions = { .hash = stringHash, .equal = stringEqual }; - const of_map_table_functions_t objectFunctions = { NULL }; + const OFMapTableFunctions objectFunctions = { NULL }; /* Count, sanity check, initialize pointers */ for (iter = options; iter->shortOption != '\0' || iter->longOption != nil; iter++) {