Differences From Artifact [aa10f00100]:
- File src/OFData.m — part of check-in [9d74d1b74e] at 2020-11-06 02:12:39 on branch trunk — OFData: Make parameter order more consistent (user: js, size: 14754) [annotate] [blame] [check-ins using] [more...]
To Artifact [7ddb882b03]:
- File
src/OFData.m
— part of check-in
[627511b032]
at
2020-11-14 12:23:55
on branch trunk
— Rename of_malloc and of_calloc
The new names should be more accurate. (user: js, size: 14750) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
129 130 131 132 133 134 135 | { self = [super init]; @try { if (itemSize == 0) @throw [OFInvalidArgumentException exception]; | | | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | { self = [super init]; @try { if (itemSize == 0) @throw [OFInvalidArgumentException exception]; _items = of_alloc(count, itemSize); _count = count; _itemSize = itemSize; _freeWhenDone = true; memcpy(_items, items, count * itemSize); } @catch (id e) { [self release]; |
︙ | ︙ | |||
193 194 195 196 197 198 199 | attributesOfItemAtPath: path].fileSize; # if ULLONG_MAX > SIZE_MAX if (size > SIZE_MAX) @throw [OFOutOfRangeException exception]; # endif | | | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | attributesOfItemAtPath: path].fileSize; # if ULLONG_MAX > SIZE_MAX if (size > SIZE_MAX) @throw [OFOutOfRangeException exception]; # endif buffer = of_alloc((size_t)size, 1); file = [[OFFile alloc] initWithPath: path mode: @"r"]; @try { [file readIntoBuffer: buffer exactLength: (size_t)size]; } @finally { [file release]; |
︙ | ︙ | |||
245 246 247 248 249 250 251 | mode: @"r"]; _count = 0; _itemSize = 1; _freeWhenDone = true; pageSize = [OFSystemInfo pageSize]; | | | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | mode: @"r"]; _count = 0; _itemSize = 1; _freeWhenDone = true; pageSize = [OFSystemInfo pageSize]; buffer = of_alloc(1, pageSize); @try { while (!stream.atEndOfStream) { size_t length = [stream readIntoBuffer: buffer length: pageSize]; |
︙ | ︙ | |||
288 289 290 291 292 293 294 | const char *cString; if (count % 2 != 0) @throw [OFInvalidFormatException exception]; count /= 2; | | | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | const char *cString; if (count % 2 != 0) @throw [OFInvalidFormatException exception]; count /= 2; _items = of_alloc(count, 1); _count = count; _itemSize = 1; _freeWhenDone = true; cString = [string cStringWithEncoding: OF_STRING_ENCODING_ASCII]; |
︙ | ︙ |