Differences From Artifact [917f8ad622]:
- File src/OFCountedSet.m — part of check-in [8823a4df67] at 2017-08-19 08:24:40 on branch trunk — Add -[OFMutableSet removeAllObjects] (user: js, size: 5595) [annotate] [blame] [check-ins using]
To Artifact [5a24ff85a6]:
- File
src/OFCountedSet.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: 5757) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
28 29 30 31 32 33 34 | Class isa; } placeholder; @interface OFCountedSet_placeholder: OFCountedSet @end @implementation OFCountedSet_placeholder | | | | | | | | | | | | | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 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 94 95 | Class isa; } placeholder; @interface OFCountedSet_placeholder: OFCountedSet @end @implementation OFCountedSet_placeholder - (instancetype)init { return (id)[[OFCountedSet_hashtable alloc] init]; } - (instancetype)initWithSet: (OFSet *)set { return (id)[[OFCountedSet_hashtable alloc] initWithSet: set]; } - (instancetype)initWithArray: (OFArray *)array { return (id)[[OFCountedSet_hashtable alloc] initWithArray: array]; } - (instancetype)initWithObjects: (id)firstObject, ... { id ret; va_list arguments; va_start(arguments, firstObject); ret = [[OFCountedSet_hashtable alloc] initWithObject: firstObject arguments: arguments]; va_end(arguments); return ret; } - (instancetype)initWithObjects: (id const *)objects count: (size_t)count { return (id)[[OFCountedSet_hashtable alloc] initWithObjects: objects count: count]; } - (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { return (id)[[OFCountedSet_hashtable alloc] initWithObject: firstObject arguments: arguments]; } - (instancetype)initWithSerialization: (OFXMLElement *)element { return (id)[[OFCountedSet_hashtable alloc] initWithSerialization: element]; } - (instancetype)retain { return self; } - (instancetype)autorelease { return self; } - (void)release { } |
︙ | ︙ | |||
103 104 105 106 107 108 109 | @implementation OFCountedSet + (void)initialize { if (self == [OFCountedSet class]) placeholder.isa = [OFCountedSet_placeholder class]; } | | | | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | @implementation OFCountedSet + (void)initialize { if (self == [OFCountedSet class]) placeholder.isa = [OFCountedSet_placeholder class]; } + (instancetype)alloc { if (self == [OFCountedSet class]) return (id)&placeholder; return [super alloc]; } - (instancetype)init { if (object_getClass(self) == [OFCountedSet class]) { @try { [self doesNotRecognizeSelector: _cmd]; } @catch (id e) { [self release]; @throw e; |
︙ | ︙ | |||
168 169 170 171 172 173 174 | [ret makeImmutable]; objc_autoreleasePoolPop(pool); return ret; } | | | | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | [ret makeImmutable]; objc_autoreleasePoolPop(pool); return ret; } - (id)copy { return [[OFCountedSet alloc] initWithSet: self]; } - (id)mutableCopy { return [[OFCountedSet alloc] initWithSet: self]; } - (OFXMLElement *)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); |
︙ | ︙ |