Differences From Artifact [6d5e327cda]:
- File src/OFDictionary_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: 9075) [annotate] [blame] [check-ins using]
To Artifact [4b2eb176eb]:
- File
src/OFDictionary_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: 9173) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
70 71 72 73 74 75 76 | .retain = retain, .release = release, .hash = hash, .equal = equal }; @implementation OFDictionary_hashtable | | | | | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | .retain = retain, .release = release, .hash = hash, .equal = equal }; @implementation OFDictionary_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)initWithDictionary: (OFDictionary *)dictionary { size_t count; if (dictionary == nil) return [self init]; if ([dictionary isKindOfClass: [OFDictionary_hashtable class]] || |
︙ | ︙ | |||
146 147 148 149 150 151 152 | [self release]; @throw e; } return self; } | | | | | | | | | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | [self release]; @throw e; } return self; } - (instancetype)initWithObject: (id)object forKey: (id)key { self = [self initWithCapacity: 1]; @try { [_mapTable setObject: object forKey: key]; } @catch (id e) { [self release]; @throw e; } return self; } - (instancetype)initWithObjects: (id const *)objects forKeys: (id const *)keys count: (size_t)count { self = [self initWithCapacity: count]; @try { size_t i; for (i = 0; i < count; i++) [_mapTable setObject: objects[i] forKey: keys[i]]; } @catch (id e) { [self release]; @throw e; } return self; } - (instancetype)initWithKey: (id)firstKey arguments: (va_list)arguments { self = [super init]; @try { va_list argumentsCopy; id key, object; size_t i, count; |
︙ | ︙ | |||
236 237 238 239 240 241 242 | [self release]; @throw e; } return self; } | | | 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | [self release]; @throw e; } return self; } - (instancetype)initWithSerialization: (OFXMLElement *)element { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); OFArray *keys, *objects; OFEnumerator *keyEnumerator, *objectEnumerator; |
︙ | ︙ |