Differences From Artifact [504d17c5e3]:
- File
src/OFData.m
— part of check-in
[23e57c5040]
at
2017-07-22 23:04:35
on branch trunk
— OFFile: Simplify mode
This removes "b" for binary and always uses binary, as there is no good
reason to not use binary. (user: js, size: 13991) [annotate] [blame] [check-ins using]
To Artifact [ab1e932258]:
- File src/OFData.m — part of check-in [8da165721c] at 2017-07-24 20:10:55 on branch trunk — OFData: Add casts to make 32 bit Clang happy (user: js, size: 14023) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
205 206 207 208 209 210 211 | sizeOfFileAtPath: path]; char *buffer; if (sizeof(of_offset_t) > sizeof(size_t) && size > (of_offset_t)SIZE_MAX) @throw [OFOutOfRangeException exception]; | | | | | | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | sizeOfFileAtPath: path]; char *buffer; if (sizeof(of_offset_t) > sizeof(size_t) && size > (of_offset_t)SIZE_MAX) @throw [OFOutOfRangeException exception]; buffer = malloc((size_t)size); if (buffer == NULL) @throw [OFOutOfMemoryException exceptionWithRequestedSize: (size_t)size]; @try { OFFile *file = [[OFFile alloc] initWithPath: path mode: @"r"]; @try { [file readIntoBuffer: buffer exactLength: (size_t)size]; } @finally { [file release]; } self = [self initWithItemsNoCopy: buffer count: (size_t)size freeWhenDone: true]; } @catch (id e) { free(buffer); @throw e; } } @catch (id e) { [self release]; |
︙ | ︙ |