Differences From Artifact [dab1aab8a3]:
- File src/OFSet_hashtable.m — part of check-in [2de9660312] at 2017-09-28 23:02:23 on branch trunk — Enable -Wnullable-to-nonnull-conversion and adjust (user: js, size: 5811) [annotate] [blame] [check-ins using]
To Artifact [59c9aa82a8]:
- File
src/OFSet_hashtable.m
— part of check-in
[2f4e0df8be]
at
2017-10-17 00:33:37
on branch trunk
— Do not use implicit method return types
Instead, explicitly declare them, as OF_ASSUME_NONNULL_{BEGIN,END} does
not apply to implicit return types. This means that after this commit,
all init methods have a nonnull return type, as they should have. (user: js, size: 5909) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
57 58 59 60 61 62 63 | .release = release, .hash = hash, .equal = equal }; static const of_map_table_functions_t objectFunctions = { NULL }; @implementation OFSet_hashtable | | | | | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | .release = release, .hash = hash, .equal = equal }; static const of_map_table_functions_t objectFunctions = { NULL }; @implementation OFSet_hashtable - (instancetype)init { return [self initWithCapacity: 0]; } - (instancetype)initWithCapacity: (size_t)capacity { self = [super init]; @try { _mapTable = [[OFMapTable alloc] initWithKeyFunctions: keyFunctions objectFunctions: objectFunctions capacity: capacity]; } @catch (id e) { [self release]; @throw e; } return self; } - (instancetype)initWithSet: (OFSet *)set { size_t count; if (set == nil) return [self init]; @try { |
︙ | ︙ | |||
107 108 109 110 111 112 113 | [self release]; @throw e; } return self; } | | | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | [self release]; @throw e; } return self; } - (instancetype)initWithArray: (OFArray *)array { size_t count; if (array == nil) return self; @try { |
︙ | ︙ | |||
135 136 137 138 139 140 141 | [self release]; @throw e; } return self; } | | | | | | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | [self release]; @throw e; } return self; } - (instancetype)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 forKey: objects[i]]; } @catch (id e) { [self release]; @throw e; } return self; } - (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { self = [super init]; @try { id object; va_list argumentsCopy; size_t count; |
︙ | ︙ | |||
185 186 187 188 189 190 191 | [self release]; @throw e; } return self; } | | | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | [self release]; @throw e; } return self; } - (instancetype)initWithSerialization: (OFXMLElement *)element { self = [self init]; @try { void *pool = objc_autoreleasePoolPush(); if ((![[element name] isEqual: @"OFSet"] && |
︙ | ︙ |