Differences From Artifact [511512b3be]:
- File src/OFMutableData.m — part of check-in [e3c4bf8e3b] at 2017-08-13 11:51:48 on branch trunk — Add -[OFMutableData increaseCountBy:] (user: js, size: 6221) [annotate] [blame] [check-ins using]
To Artifact [1ec47eeb35]:
- File
src/OFMutableData.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: 6365) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
62 63 64 65 66 67 68 | itemSize: (size_t)itemSize count: (size_t)count freeWhenDone: (bool)freeWhenDone { OF_UNRECOGNIZED_SELECTOR } | | | | | | | | | | | | | | | | | | 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 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 | itemSize: (size_t)itemSize count: (size_t)count freeWhenDone: (bool)freeWhenDone { OF_UNRECOGNIZED_SELECTOR } - (instancetype)init { self = [super of_init]; _itemSize = 1; return self; } - (instancetype)initWithItemSize: (size_t)itemSize { self = [super of_init]; @try { if (itemSize == 0) @throw [OFInvalidArgumentException exception]; _itemSize = itemSize; } @catch (id e) { [self release]; @throw e; } return self; } - (instancetype)initWithCapacity: (size_t)capacity { return [self initWithItemSize: 1 capacity: capacity]; } - (instancetype)initWithItemSize: (size_t)itemSize capacity: (size_t)capacity { self = [super of_init]; @try { if (itemSize == 0) @throw [OFInvalidArgumentException exception]; _items = [self allocMemoryWithSize: itemSize count: capacity]; _itemSize = itemSize; _capacity = capacity; } @catch (id e) { [self release]; @throw e; } return self; } - (instancetype)initWithItems: (const void *)items itemSize: (size_t)itemSize count: (size_t)count { self = [super initWithItems: items itemSize: itemSize count: count]; _capacity = _count; return self; } - (instancetype)initWithItemsNoCopy: (const void *)items count: (size_t)count freeWhenDone: (bool)freeWhenDone { OF_INVALID_INIT_METHOD } - (instancetype)initWithItemsNoCopy: (const void *)items itemSize: (size_t)itemSize count: (size_t)count freeWhenDone: (bool)freeWhenDone { OF_INVALID_INIT_METHOD } - (instancetype)initWithStringRepresentation: (OFString *)string { self = [super initWithStringRepresentation: string]; _capacity = _count; return self; } |
︙ | ︙ | |||
283 284 285 286 287 288 289 | [self freeMemory: _items]; _items = NULL; _count = 0; _capacity = 0; } | | | 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | [self freeMemory: _items]; _items = NULL; _count = 0; _capacity = 0; } - (id)copy { return [[OFData alloc] initWithItems: _items itemSize: _itemSize count: _count]; } - (void)makeImmutable { object_setClass(self, [OFData class]); } @end |