Differences From Artifact [995026f596]:
- File
src/instance.m
— part of check-in
[44f45c2e35]
at
2017-01-09 17:36:36
on branch trunk
— Update copyright
Forgot to add 2017, even though I already did quite some changes in
2017. (user: js, size: 2119) [annotate] [blame] [check-ins using]
To Artifact [dcb3da3872]:
- File
src/instance.m
— part of check-in
[4af49a13c3]
at
2017-05-07 20:10:13
on branch trunk
— Small code style change
Casts are now written like types in variable declarations. (user: js, size: 2123) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
34 35 36 37 38 39 40 | if (constructSel == NULL) constructSel = sel_registerName(".cxx_construct"); if (!class_respondsToSelector(cls, constructSel)) return true; | | | | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | if (constructSel == NULL) constructSel = sel_registerName(".cxx_construct"); if (!class_respondsToSelector(cls, constructSel)) return true; construct = (id (*)(id, SEL)) class_getMethodImplementation(cls, constructSel); last = (id (*)(id, SEL)) class_getMethodImplementation(super, constructSel); if (construct == last) return true; return (construct(obj, constructSel) != nil); } |
︙ | ︙ | |||
61 62 63 64 65 66 67 | if (!callConstructors(cls, obj)) return nil; return obj; } | | | | 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 94 95 96 97 | if (!callConstructors(cls, obj)) return nil; return obj; } void * objc_destructInstance(id obj) { Class cls; void (*last)(id, SEL) = NULL; #ifdef OF_OBJFW_RUNTIME objc_zero_weak_references(obj); #endif if (destructSel == NULL) destructSel = sel_registerName(".cxx_destruct"); for (cls = object_getClass(obj); cls != Nil; cls = class_getSuperclass(cls)) { void (*destruct)(id, SEL); if (class_respondsToSelector(cls, destructSel)) { if ((destruct = (void (*)(id, SEL)) class_getMethodImplementation(cls, destructSel)) != last) destruct(obj, destructSel); last = destruct; } else break; } return obj; } |