Differences From Artifact [b2d94e1a72]:
- File src/OFObject.m — part of check-in [5882409fd0] at 2017-10-01 09:54:52 on branch trunk — Nullability fixes for ObjFW runtime (user: js, size: 30271) [annotate] [blame] [check-ins using]
To 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]
︙ | ︙ | |||
293 294 295 296 297 298 299 | + (Class)class { return self; } + (OFString *)className { | | < | | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | + (Class)class { return self; } + (OFString *)className { return [OFString stringWithCString: class_getName(self) encoding: OF_STRING_ENCODING_ASCII]; } + (bool)isSubclassOfClass: (Class)class { for (Class iter = self; iter != Nil; iter = class_getSuperclass(iter)) if (iter == class) return true; |
︙ | ︙ | |||
356 357 358 359 360 361 362 | withMethodFromClass: (Class)class { IMP method = [class methodForSelector: selector]; if (method == NULL) @throw [OFInvalidArgumentException exception]; | | | < | | 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 | withMethodFromClass: (Class)class { IMP method = [class methodForSelector: selector]; if (method == NULL) @throw [OFInvalidArgumentException exception]; return class_replaceMethod(object_getClass(self), selector, method, typeEncodingForSelector(object_getClass(class), selector)); } + (IMP)replaceInstanceMethod: (SEL)selector withMethodFromClass: (Class)class { IMP method = [class instanceMethodForSelector: selector]; if (method == NULL) @throw [OFInvalidArgumentException exception]; return class_replaceMethod(self, selector, method, typeEncodingForSelector(class, selector)); } + (void)inheritMethodsFromClass: (Class)class { Class superclass = [self superclass]; |
︙ | ︙ | |||
482 483 484 485 486 487 488 | - init { return self; } - (Class)class { | | | < | | 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 | - init { return self; } - (Class)class { return object_getClass(self); } - (Class)superclass { return class_getSuperclass(object_getClass(self)); } - (OFString *)className { return [OFString stringWithCString: object_getClassName(self) encoding: OF_STRING_ENCODING_ASCII]; } - (bool)isKindOfClass: (Class)class { for (Class iter = object_getClass(self); iter != Nil; iter = class_getSuperclass(iter)) if (iter == class) |
︙ | ︙ |