Differences From Artifact [6c6cb9f3db]:
- File src/OFFile.m — part of check-in [d67734339a] at 2021-01-13 18:15:26 on branch trunk — Define _LARGEFILE64_SOURCE where necessary (user: js, size: 11763) [annotate] [blame] [check-ins using]
To Artifact [1933c9d596]:
- File
src/OFFile.m
— part of check-in
[a0fd103a0b]
at
2021-03-07 02:36:04
on branch trunk
— Style change: Allow more than 1 argument per line
This is only migrating some places, others will be migrated as they are
touched. (user: js, size: 11690) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
178 179 180 181 182 183 184 | #ifdef OF_NINTENDO_DS if (!nitroFSInit(NULL)) @throw [OFInitializationFailedException exceptionWithClass: self]; #endif } | | < | < | < | < | < | 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 205 206 207 208 209 210 211 212 | #ifdef OF_NINTENDO_DS if (!nitroFSInit(NULL)) @throw [OFInitializationFailedException exceptionWithClass: self]; #endif } + (instancetype)fileWithPath: (OFString *)path mode: (OFString *)mode { return [[[self alloc] initWithPath: path mode: mode] autorelease]; } + (instancetype)fileWithURL: (OFURL *)URL mode: (OFString *)mode { return [[[self alloc] initWithURL: URL mode: mode] autorelease]; } + (instancetype)fileWithHandle: (of_file_handle_t)handle { return [[[self alloc] initWithHandle: handle] autorelease]; } - (instancetype)init { OF_INVALID_INIT_METHOD } - (instancetype)initWithPath: (OFString *)path mode: (OFString *)mode { of_file_handle_t handle; @try { void *pool = objc_autoreleasePoolPush(); int flags; |
︙ | ︙ | |||
322 323 324 325 326 327 328 | closeHandle(handle); @throw e; } return self; } | | < | < | 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 | closeHandle(handle); @throw e; } return self; } - (instancetype)initWithURL: (OFURL *)URL mode: (OFString *)mode { void *pool = objc_autoreleasePoolPush(); OFString *fileSystemRepresentation; @try { fileSystemRepresentation = URL.fileSystemRepresentation; } @catch (id e) { [self release]; @throw e; } self = [self initWithPath: fileSystemRepresentation mode: mode]; objc_autoreleasePoolPop(pool); return self; } - (instancetype)initWithHandle: (of_file_handle_t)handle |
︙ | ︙ | |||
360 361 362 363 364 365 366 | { if (_handle == OF_INVALID_FILE_HANDLE) @throw [OFNotOpenException exceptionWithObject: self]; return _atEndOfStream; } | | < | 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | { if (_handle == OF_INVALID_FILE_HANDLE) @throw [OFNotOpenException exceptionWithObject: self]; return _atEndOfStream; } - (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { ssize_t ret; if (_handle == OF_INVALID_FILE_HANDLE) @throw [OFNotOpenException exceptionWithObject: self]; #if defined(OF_WINDOWS) |
︙ | ︙ | |||
397 398 399 400 401 402 403 | if (ret == 0) _atEndOfStream = true; return ret; } | | < | 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | if (ret == 0) _atEndOfStream = true; return ret; } - (size_t)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { if (_handle == OF_INVALID_FILE_HANDLE) @throw [OFNotOpenException exceptionWithObject: self]; #if defined(OF_WINDOWS) int bytesWritten; |
︙ | ︙ | |||
456 457 458 459 460 461 462 | bytesWritten: 0 errNo: errno]; #endif return (size_t)bytesWritten; } | | < | 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | bytesWritten: 0 errNo: errno]; #endif return (size_t)bytesWritten; } - (of_offset_t)lowlevelSeekToOffset: (of_offset_t)offset whence: (int)whence { of_offset_t ret; if (_handle == OF_INVALID_FILE_HANDLE) @throw [OFNotOpenException exceptionWithObject: self]; #ifndef OF_AMIGAOS |
︙ | ︙ |