Overview
Comment: | Check more arguments for nil. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
f5c422025133239f6895ab11107c9505 |
User & Date: | js on 2012-11-12 11:24:46 |
Other Links: | manifest | tags |
Context
2012-11-12
| ||
11:30 | Update ChangeLog for 0.7.1. check-in: f2e5c1b668 user: js tags: trunk | |
11:24 | Check more arguments for nil. check-in: f5c4220251 user: js tags: trunk | |
2012-11-11
| ||
12:12 | Add -[OFString stringByAppendingFormat:]. check-in: da23dca008 user: js tags: trunk | |
Changes
Modified src/OFArray.m from [626ce7ee3d] to [4f7e60625c].
︙ | |||
169 170 171 172 173 174 175 176 177 178 179 180 181 182 | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | + + + + + + | } return [super init]; } - initWithObject: (id)object { if (object == nil) { Class c = [self class]; [self release]; @throw [OFInvalidArgumentException exceptionWithClass: c]; } return [self initWithObjects: object, nil]; } - initWithObjects: (id)firstObject, ... { id ret; va_list arguments; |
︙ | |||
274 275 276 277 278 279 280 | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | - + + + + + + - + + + + + + | - (id)objectAtIndexedSubscript: (size_t)index { return [self objectAtIndex: index]; } - (size_t)indexOfObject: (id)object { |
︙ | |||
363 364 365 366 367 368 369 | 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | - + + + + + + + | - (OFString*)componentsJoinedByString: (OFString*)separator usingSelector: (SEL)selector { void *pool; OFMutableString *ret; id *objects; |
︙ | |||
606 607 608 609 610 611 612 | 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 | + + + + + + - + | break; } } #endif - (OFArray*)arrayByAddingObject: (id)object { OFMutableArray *ret; if (object == nil) @throw [OFInvalidArgumentException exceptionWithClass: [self class]]; |
︙ |
Modified src/OFArray_adjacent.m from [cdb0c9cc7a] to [7116965323].
︙ | |||
48 49 50 51 52 53 54 55 56 57 58 59 60 61 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | + + + + | } - initWithObject: (id)object { self = [self init]; @try { if (object == nil) @throw [OFInvalidArgumentException exceptionWithClass: [self class]]; [array addItem: &object]; [object retain]; } @catch (id e) { [self release]; @throw e; } |
︙ | |||
88 89 90 91 92 93 94 95 96 97 98 99 100 101 | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | + + + | - initWithArray: (OFArray*)array_ { id *objects; size_t i, count; self = [self init]; if (array_ == nil) return self; @try { objects = [array_ objects]; count = [array_ count]; } @catch (id e) { [self release]; @throw e; } |
︙ | |||
124 125 126 127 128 129 130 131 | 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | + - + + + + + + + + + | - initWithObjects: (id const*)objects count: (size_t)count { self = [self init]; @try { size_t i; BOOL ok = YES; |
︙ | |||
218 219 220 221 222 223 224 | 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 262 263 264 265 266 267 268 269 270 271 272 273 | + + + + + + - - + + + + + + + + - - + + | for (i = 0; i < range.length; i++) buffer[i] = objects[range.location + i]; } - (size_t)indexOfObject: (id)object { id *objects; size_t i, count; if (object == nil) return OF_NOT_FOUND; |
︙ |
Modified src/OFDictionary.m from [9c777b7efa] to [a3f4a24963].
︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | + | #import "OFDictionary.h" #import "OFDictionary_hashtable.h" #import "OFArray.h" #import "OFString.h" #import "OFXMLElement.h" #import "OFInvalidArgumentException.h" #import "OFNotImplementedException.h" #import "autorelease.h" static struct { Class isa; } placeholder; |
︙ | |||
198 199 200 201 202 203 204 205 206 207 208 209 210 211 | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | + + + + | @throw [OFNotImplementedException exceptionWithClass: c selector: _cmd]; } - initWithObject: (id)object forKey: (id)key { if (key == nil || object == nil) @throw [OFInvalidArgumentException exceptionWithClass: [self class]]; return [self initWithKeysAndObjects: key, object, nil]; } - initWithObjects: (OFArray*)objects forKeys: (OFArray*)keys { Class c = [self class]; |
︙ | |||
312 313 314 315 316 317 318 | 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | - - + + + + + + + + - - + + + + + + + + | objc_autoreleasePoolPop(pool); return YES; } - (BOOL)containsObject: (id)object { |
︙ |
Modified src/OFDictionary_hashtable.m from [f94483610d] to [a181bd3b11].
︙ | |||
62 63 64 65 66 67 68 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | - - - - - | { self = [super init]; @try { uint32_t i; OFDictionary_hashtable *hashtable; |
︙ | |||
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | 107 108 109 110 111 112 113 114 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 | + + + + + + + | } return self; } - initWithDictionary: (OFDictionary*)dictionary { if (dictionary == nil) return [self init]; if ([dictionary class] == [OFDictionary_hashtable class] || [dictionary class] == [OFMutableDictionary_hashtable class]) return [self OF_initWithDictionary: dictionary copyKeys: YES]; self = [super init]; @try { void *pool; OFEnumerator *enumerator; id key; uint32_t i, newSize; if (dictionary == nil) @throw [OFInvalidArgumentException exceptionWithClass: [self class]]; count = [dictionary count]; if (count > UINT32_MAX) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; for (newSize = 1; newSize < count; newSize <<= 1); |
︙ | |||
284 285 286 287 288 289 290 291 292 293 294 295 296 297 | 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | + + + + | for (j = 0; j < newSize; j++) data[j] = NULL; size = newSize; for (i = 0; i < count; i++) { uint32_t hash, last; if (keys[i] == nil || objects[i] == nil) @throw [OFInvalidArgumentException exceptionWithClass: [self class]]; hash = [keys[i] hash]; last = size; for (j = hash & (size - 1); j < last && data[j] != NULL; j++) if ([data[j]->key isEqual: keys[i]]) |
︙ | |||
620 621 622 623 624 625 626 | 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 | - + - + | return YES; } - (BOOL)containsObject: (id)object { uint32_t i; |
︙ |
Modified src/OFMutableArray.m from [880c8c3997] to [ef9ecd25ad].
︙ | |||
228 229 230 231 232 233 234 | 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 262 263 264 265 266 267 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 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | - + + + + + + + - + + + + + + + - + + + + + + + - + + + + + + + | [self replaceObjectAtIndex: index withObject: object]; } - (void)replaceObject: (id)oldObject withObject: (id)newObject { |
︙ |
Modified src/OFMutableArray_adjacent.m from [d741de4264] to [6fbb272bbe].
︙ | |||
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | 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 | + + + + + + + + | { if (self == [OFMutableArray_adjacent class]) [self inheritMethodsFromClass: [OFArray_adjacent class]]; } - (void)addObject: (id)object { if (object == nil) @throw [OFInvalidArgumentException exceptionWithClass: [self class]]; [array addItem: &object]; [object retain]; mutations++; } - (void)insertObject: (id)object atIndex: (size_t)index { if (object == nil) @throw [OFInvalidArgumentException exceptionWithClass: [self class]]; [array insertItem: &object atIndex: index]; [object retain]; mutations++; } |
︙ | |||
66 67 68 69 70 71 72 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 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 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 | + + + + + + + - - + + - + + + + + + + + + + + + + + - - + + + + + + + + + - - + + + + + + + + + - - + + | mutations++; } - (void)replaceObject: (id)oldObject withObject: (id)newObject { id *objects; size_t i, count; if (oldObject == nil || newObject == nil) @throw [OFInvalidArgumentException exceptionWithClass: [self class]]; |
︙ |
Modified src/OFMutableSet.m from [e5b23d482d] to [0f6765c635].
︙ | |||
160 161 162 163 164 165 166 | 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 | - + - + + + - + + | size_t count = [self count]; id *cArray; cArray = [self allocMemoryWithSize: sizeof(id) count: count]; @try { |
Modified src/OFSet.m from [64a43ff987] to [da395819f0].
︙ | |||
322 323 324 325 326 327 328 | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | - + + - + + | { return [[OFMutableSet alloc] initWithSet: self]; } - (BOOL)isSubsetOfSet: (OFSet*)set { void *pool = objc_autoreleasePoolPush(); |
︙ |
Modified src/OFSet_hashtable.m from [246ec8ee26] to [b5f65d1f93].
︙ | |||
46 47 48 49 50 51 52 53 54 | 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 96 97 98 99 100 101 102 103 104 105 106 | + + + - - + + + + + + + + + - + - - + + - + | return self; } - initWithSet: (OFSet*)set { self = [self init]; if (set == nil) return self; @try { void *pool = objc_autoreleasePoolPush(); |
︙ | |||
200 201 202 203 204 205 206 207 208 209 210 211 212 213 | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | + + + | - (size_t)count { return [dictionary count]; } - (BOOL)containsObject: (id)object { if (object == nil) return NO; return ([dictionary objectForKey: object] != nil); } - (BOOL)isEqual: (id)object { OFSet_hashtable *otherSet; |
︙ |