Differences From Artifact [d94672b28e]:
- File
src/OFObject.m
— part of check-in
[e47c219327]
at
2017-10-01 14:05:29
on branch trunk
— Disable -Wnullable-to-nonnull-conversion again
It does not work well enough yet: While creating a lot of noise, it
fails to even find many of the obvious cases. Depending on the static
analyzer seems to be the better approach for now. (user: js, size: 30202) [annotate] [blame] [check-ins using]
To Artifact [fdaee34133]:
- File
src/OFObject.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: 30324) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
276 277 278 279 280 281 282 | { } + (void)initialize { } | | | | 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | { } + (void)initialize { } + (instancetype)alloc { return of_alloc_object(self, 0, 0, NULL); } + (instancetype)new { return [[self alloc] init]; } + (Class)class { return self; |
︙ | ︙ | |||
473 474 475 476 477 478 479 | } + (BOOL)resolveInstanceMethod: (SEL)selector { return NO; } | | | 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | } + (BOOL)resolveInstanceMethod: (SEL)selector { return NO; } - (instancetype)init { return self; } - (Class)class { return object_getClass(self); |
︙ | ︙ | |||
1153 1154 1155 1156 1157 1158 1159 | - (void)doesNotRecognizeSelector: (SEL)selector { @throw [OFNotImplementedException exceptionWithSelector: selector object: self]; } | | | 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 | - (void)doesNotRecognizeSelector: (SEL)selector { @throw [OFNotImplementedException exceptionWithSelector: selector object: self]; } - (instancetype)retain { #if defined(OF_HAVE_ATOMIC_OPS) of_atomic_int_inc(&PRE_IVARS->retainCount); #else OF_ENSURE(of_spinlock_lock(&PRE_IVARS->retainCountSpinlock)); PRE_IVARS->retainCount++; OF_ENSURE(of_spinlock_unlock(&PRE_IVARS->retainCountSpinlock)); |
︙ | ︙ | |||
1194 1195 1196 1197 1198 1199 1200 | OF_ENSURE(of_spinlock_unlock(&PRE_IVARS->retainCountSpinlock)); if (c == 0) [self dealloc]; #endif } | | | | 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 | OF_ENSURE(of_spinlock_unlock(&PRE_IVARS->retainCountSpinlock)); if (c == 0) [self dealloc]; #endif } - (instancetype)autorelease { return _objc_rootAutorelease(self); } - (instancetype)self { return self; } - (bool)isProxy { return false; |
︙ | ︙ | |||
1246 1247 1248 1249 1250 1251 1252 | iter = next; } free((char *)self - PRE_IVARS_ALIGN); } /* Required to use properties with the Apple runtime */ | | | | 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 | iter = next; } free((char *)self - PRE_IVARS_ALIGN); } /* Required to use properties with the Apple runtime */ - (id)copyWithZone: (void *)zone { if OF_UNLIKELY (zone != NULL) { [self doesNotRecognizeSelector: _cmd]; abort(); } return [(id)self copy]; } - (id)mutableCopyWithZone: (void *)zone { if OF_UNLIKELY (zone != NULL) { [self doesNotRecognizeSelector: _cmd]; abort(); } return [(id)self mutableCopy]; |
︙ | ︙ | |||
1299 1300 1301 1302 1303 1304 1305 | } + (void)freeMemory: (void *)pointer { OF_UNRECOGNIZED_SELECTOR } | | | | | | | 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 | } + (void)freeMemory: (void *)pointer { OF_UNRECOGNIZED_SELECTOR } + (id)retain { return self; } + (id)autorelease { return self; } + (unsigned int)retainCount { return OF_RETAIN_COUNT_MAX; } + (void)release { } + (void)dealloc { OF_UNRECOGNIZED_SELECTOR } + (id)copy { return self; } + (id)mutableCopyWithZone: (void *)zone { OF_UNRECOGNIZED_SELECTOR } /* Required to use ObjFW from Swift */ + (instancetype)allocWithZone: (void *)zone { if OF_UNLIKELY (zone != NULL) { [self doesNotRecognizeSelector: _cmd]; abort(); } return [self alloc]; } @end |