@@ -76,11 +76,11 @@ uint32_t _CRC32; bool _atEndOfStream; } - initWithArchiveFile: (OFString*)path - offset: (off_t)offset + offset: (of_offset_t)offset localFileHeader: (OFZIPArchive_LocalFileHeader*)localFileHeader; @end uint32_t of_zip_archive_read_field32(uint8_t **data, uint16_t *size) @@ -178,11 +178,11 @@ - (void)OF_readZIPInfo { void *pool = objc_autoreleasePoolPush(); uint16_t commentLength; - off_t offset = -22; + of_offset_t offset = -22; bool valid = false; do { @try { [_file seekToOffset: offset @@ -236,14 +236,14 @@ * central directory record. */ [_file readLittleEndianInt32]; offset64 = [_file readLittleEndianInt64]; - if ((off_t)offset64 != offset64) + if ((of_offset_t)offset64 != offset64) @throw [OFOutOfRangeException exception]; - [_file seekToOffset: (off_t)offset64 + [_file seekToOffset: (of_offset_t)offset64 whence: SEEK_SET]; if ([_file readLittleEndianInt32] != 0x06064B50) @throw [OFInvalidFormatException exception]; @@ -261,11 +261,12 @@ _centralDirectoryEntriesInDisk = [_file readLittleEndianInt64]; _centralDirectoryEntries = [_file readLittleEndianInt64]; _centralDirectorySize = [_file readLittleEndianInt64]; _centralDirectoryOffset = [_file readLittleEndianInt64]; - if ((off_t)_centralDirectoryOffset != _centralDirectoryOffset) + if ((of_offset_t)_centralDirectoryOffset != + _centralDirectoryOffset) @throw [OFOutOfRangeException exception]; } objc_autoreleasePoolPop(pool); } @@ -273,14 +274,14 @@ - (void)OF_readEntries { void *pool = objc_autoreleasePoolPush(); size_t i; - if ((off_t)_centralDirectoryOffset != _centralDirectoryOffset) + if ((of_offset_t)_centralDirectoryOffset != _centralDirectoryOffset) @throw [OFOutOfRangeException exception]; - [_file seekToOffset: (off_t)_centralDirectoryOffset + [_file seekToOffset: (of_offset_t)_centralDirectoryOffset whence: SEEK_SET]; _entries = [[OFMutableArray alloc] init]; _pathToEntryMap = [[OFMutableDictionary alloc] init]; @@ -316,23 +317,23 @@ { OFStream *ret; void *pool = objc_autoreleasePoolPush(); OFZIPArchiveEntry *entry = [_pathToEntryMap objectForKey: path]; OFZIPArchive_LocalFileHeader *localFileHeader; - uint64_t offset; + uint64_t offset64; if (entry == nil) { errno = ENOENT; @throw [OFOpenFileFailedException exceptionWithPath: path mode: @"rb"]; } - offset = [entry OF_localFileHeaderOffset]; - if ((off_t)offset != offset) + offset64 = [entry OF_localFileHeaderOffset]; + if ((of_offset_t)offset64 != offset64) @throw [OFOutOfRangeException exception]; - [_file seekToOffset: (off_t)offset + [_file seekToOffset: (of_offset_t)offset64 whence: SEEK_SET]; localFileHeader = [[[OFZIPArchive_LocalFileHeader alloc] initWithFile: _file] autorelease]; if (![localFileHeader matchesEntry: entry]) @@ -444,11 +445,11 @@ } @end @implementation OFZIPArchive_FileStream - initWithArchiveFile: (OFString*)path - offset: (off_t)offset + offset: (of_offset_t)offset localFileHeader: (OFZIPArchive_LocalFileHeader*)localFileHeader { self = [super init]; @try {