Differences From Artifact [5cf73c1314]:
- File
src/OFMutableArray_adjacent.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: 7772) [annotate] [blame] [check-ins using]
To Artifact [271b9597ba]:
- File src/OFMutableArray_adjacent.m — part of check-in [a06354b42a] at 2017-10-22 15:05:39 on branch trunk — Make Apple GCC with -Wshadow happy (user: js, size: 7734) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
56 57 58 59 60 61 62 | [_array addItem: &object]; [object retain]; _mutations++; } - (void)insertObject: (id)object | | | | | | 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 | [_array addItem: &object]; [object retain]; _mutations++; } - (void)insertObject: (id)object atIndex: (size_t)idx { if (object == nil) @throw [OFInvalidArgumentException exception]; @try { [_array insertItem: &object atIndex: idx]; } @catch (OFOutOfRangeException *e) { @throw [OFOutOfRangeException exception]; } [object retain]; _mutations++; } - (void)insertObjectsFromArray: (OFArray *)array atIndex: (size_t)idx { id const *objects = [array objects]; size_t count = [array count]; @try { [_array insertItems: objects atIndex: idx count: count]; } @catch (OFOutOfRangeException *e) { @throw [OFOutOfRangeException exception]; } for (size_t i = 0; i < count; i++) [objects[i] retain]; |
︙ | ︙ | |||
115 116 117 118 119 120 121 | objects[i] = newObject; return; } } } | | | | | | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | objects[i] = newObject; return; } } } - (void)replaceObjectAtIndex: (size_t)idx withObject: (id)object { id *objects; id oldObject; if (object == nil) @throw [OFInvalidArgumentException exception]; objects = [_array items]; if (idx >= [_array count]) @throw [OFOutOfRangeException exception]; oldObject = objects[idx]; objects[idx] = [object retain]; [oldObject release]; } - (void)replaceObjectIdenticalTo: (id)oldObject withObject: (id)newObject { id *objects; |
︙ | ︙ | |||
205 206 207 208 209 210 211 | [object release]; return; } } } | | | | | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | [object release]; return; } } } - (void)removeObjectAtIndex: (size_t)idx { #ifndef __clang_analyzer__ id object = [self objectAtIndex: idx]; [_array removeItemAtIndex: idx]; [object release]; _mutations++; #endif } - (void)removeAllObjects |
︙ | ︙ | |||
268 269 270 271 272 273 274 | [_array removeLastItem]; [object release]; _mutations++; #endif } | | | | | | | | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | [_array removeLastItem]; [object release]; _mutations++; #endif } - (void)exchangeObjectAtIndex: (size_t)idx1 withObjectAtIndex: (size_t)idx2 { id *objects = [_array items]; size_t count = [_array count]; id tmp; if (idx1 >= count || idx2 >= count) @throw [OFOutOfRangeException exception]; tmp = objects[idx1]; objects[idx1] = objects[idx2]; objects[idx2] = tmp; } - (void)reverse { id *objects = [_array items]; size_t i, j, count = [_array count]; |
︙ | ︙ |