Differences From Artifact [706da4f76f]:
- File src/OFMutableArray.m — part of check-in [daa11c19cb] at 2017-08-12 21:03:02 on branch trunk — Add -[OFMutableArray sortUsingSelector:options:] (user: js, size: 9248) [annotate] [blame] [check-ins using]
To Artifact [d9547cea8c]:
- File
src/OFMutableArray.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: 9434) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
134 135 136 137 138 139 140 | left = i + 1; } } #endif @implementation OFMutableArray_placeholder | | | | | | | | | | | | | | 134 135 136 137 138 139 140 141 142 143 144 145 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 | left = i + 1; } } #endif @implementation OFMutableArray_placeholder - (instancetype)init { return (id)[[OFMutableArray_adjacent alloc] init]; } - (instancetype)initWithCapacity: (size_t)capacity { return (id)[[OFMutableArray_adjacent alloc] initWithCapacity: capacity]; } - (instancetype)initWithObject: (id)object { return (id)[[OFMutableArray_adjacent alloc] initWithObject: object]; } - (instancetype)initWithObjects: (id)firstObject, ... { id ret; va_list arguments; va_start(arguments, firstObject); ret = [[OFMutableArray_adjacent alloc] initWithObject: firstObject arguments: arguments]; va_end(arguments); return ret; } - (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { return (id)[[OFMutableArray_adjacent alloc] initWithObject: firstObject arguments: arguments]; } - (instancetype)initWithArray: (OFArray *)array { return (id)[[OFMutableArray_adjacent alloc] initWithArray: array]; } - (instancetype)initWithObjects: (id const *)objects count: (size_t)count { return (id)[[OFMutableArray_adjacent alloc] initWithObjects: objects count: count]; } - (instancetype)initWithSerialization: (OFXMLElement *)element { return (id)[[OFMutableArray_adjacent alloc] initWithSerialization: element]; } - (instancetype)retain { return self; } - (instancetype)autorelease { return self; } - (void)release { } |
︙ | ︙ | |||
214 215 216 217 218 219 220 | @implementation OFMutableArray + (void)initialize { if (self == [OFMutableArray class]) placeholder.isa = [OFMutableArray_placeholder class]; } | | | | | | 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | @implementation OFMutableArray + (void)initialize { if (self == [OFMutableArray class]) placeholder.isa = [OFMutableArray_placeholder class]; } + (instancetype)alloc { if (self == [OFMutableArray class]) return (id)&placeholder; return [super alloc]; } + (instancetype)arrayWithCapacity: (size_t)capacity { return [[[self alloc] initWithCapacity: capacity] autorelease]; } - (instancetype)init { if (object_getClass(self) == [OFMutableArray class]) { @try { [self doesNotRecognizeSelector: _cmd]; abort(); } @catch (id e) { [self release]; @throw e; } } return [super init]; } - (instancetype)initWithCapacity: (size_t)capacity { OF_INVALID_INIT_METHOD } - (id)copy { return [[OFArray alloc] initWithArray: self]; } - (void)addObject: (id)object { [self insertObject: object |
︙ | ︙ |