Differences From Artifact [9a3d14535d]:
- File src/OFSet.m — part of check-in [00476e4430] at 2017-10-11 20:53:10 on branch trunk — Fix shadowed variables and enable -Wshadow (user: js, size: 8260) [annotate] [blame] [check-ins using] [more...]
To Artifact [3a024855e7]:
- File
src/OFSet.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: 8502) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
29 30 31 32 33 34 35 | Class isa; } placeholder; @interface OFSet_placeholder: OFSet @end @implementation OFSet_placeholder | | | | | | | | | | | | | 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 OFSet_placeholder: OFSet @end @implementation OFSet_placeholder - (instancetype)init { return (id)[[OFSet_hashtable alloc] init]; } - (instancetype)initWithSet: (OFSet *)set { return (id)[[OFSet_hashtable alloc] initWithSet: set]; } - (instancetype)initWithArray: (OFArray *)array { return (id)[[OFSet_hashtable alloc] initWithArray: array]; } - (instancetype)initWithObjects: (id)firstObject, ... { id ret; va_list arguments; va_start(arguments, firstObject); ret = [[OFSet_hashtable alloc] initWithObject: firstObject arguments: arguments]; va_end(arguments); return ret; } - (instancetype)initWithObjects: (id const *)objects count: (size_t)count { return (id)[[OFSet_hashtable alloc] initWithObjects: objects count: count]; } - (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { return (id)[[OFSet_hashtable alloc] initWithObject: firstObject arguments: arguments]; } - (instancetype)initWithSerialization: (OFXMLElement *)element { return (id)[[OFSet_hashtable alloc] initWithSerialization: element]; } - (instancetype)retain { return self; } - (instancetype)autorelease { return self; } - (void)release { } |
︙ | ︙ | |||
103 104 105 106 107 108 109 | @implementation OFSet + (void)initialize { if (self == [OFSet class]) placeholder.isa = [OFSet_placeholder class]; } | | | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | @implementation OFSet + (void)initialize { if (self == [OFSet class]) placeholder.isa = [OFSet_placeholder class]; } + (instancetype)alloc { if (self == [OFSet class]) return (id)&placeholder; return [super alloc]; } |
︙ | ︙ | |||
146 147 148 149 150 151 152 | + (instancetype)setWithObjects: (id const *)objects count: (size_t)count { return [[[self alloc] initWithObjects: objects count: count] autorelease]; } | | | | | | | | | | 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 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | + (instancetype)setWithObjects: (id const *)objects count: (size_t)count { return [[[self alloc] initWithObjects: objects count: count] autorelease]; } - (instancetype)init { if (object_getClass(self) == [OFSet class]) { @try { [self doesNotRecognizeSelector: _cmd]; } @catch (id e) { [self release]; @throw e; } abort(); } return [super init]; } - (instancetype)initWithSet: (OFSet *)set { OF_INVALID_INIT_METHOD } - (instancetype)initWithArray: (OFArray *)array { OF_INVALID_INIT_METHOD } - (instancetype)initWithObjects: (id const *)objects count: (size_t)count { OF_INVALID_INIT_METHOD } - (instancetype)initWithObjects: (id)firstObject, ... { id ret; va_list arguments; va_start(arguments, firstObject); ret = [self initWithObject: firstObject arguments: arguments]; va_end(arguments); return ret; } - (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { OF_INVALID_INIT_METHOD } - (instancetype)initWithSerialization: (OFXMLElement *)element { OF_INVALID_INIT_METHOD } - (size_t)count { OF_UNRECOGNIZED_SELECTOR |
︙ | ︙ | |||
335 336 337 338 339 340 341 | [ret makeImmutable]; objc_autoreleasePoolPop(pool); return ret; } | | | | 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | [ret makeImmutable]; objc_autoreleasePoolPop(pool); return ret; } - (id)copy { return [self retain]; } - (id)mutableCopy { return [[OFMutableSet alloc] initWithSet: self]; } - (bool)isSubsetOfSet: (OFSet *)set { for (id object in self) |
︙ | ︙ |