Differences From Artifact [9cc455c13c]:
- File src/OFLHAArchiveEntry.m — part of check-in [c7f0229795] at 2020-01-02 01:51:34 on branch trunk — Update copyright (user: js, size: 18646) [annotate] [blame] [check-ins using] [more...]
To Artifact [61acef2124]:
- File
src/OFLHAArchiveEntry.m
— part of check-in
[25c985fec1]
at
2020-08-25 00:11:24
on branch trunk
— OFNumber: Remove (u)int{8,16,32,64} methods
Since C guarantees minimum sizes for char, short, int, long and long
long, these can be used instead. (user: js, size: 18690) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
123 124 125 126 127 128 129 | memcpy(&mode, (char *)extension.items + 1, 2); mode = OF_BSWAP16_IF_BE(mode); [entry->_mode release]; entry->_mode = nil; | | | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | memcpy(&mode, (char *)extension.items + 1, 2); mode = OF_BSWAP16_IF_BE(mode); [entry->_mode release]; entry->_mode = nil; entry->_mode = [[OFNumber alloc] initWithUnsignedShort: mode]; } static void parseGIDUIDExtension(OFLHAArchiveEntry *entry, OFData *extension, of_string_encoding_t encoding) { uint16_t UID, GID; |
︙ | ︙ | |||
147 148 149 150 151 152 153 | [entry->_GID release]; entry->_GID = nil; [entry->_UID release]; entry->_UID = nil; | | | | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | [entry->_GID release]; entry->_GID = nil; [entry->_UID release]; entry->_UID = nil; entry->_GID = [[OFNumber alloc] initWithUnsignedShort: GID]; entry->_UID = [[OFNumber alloc] initWithUnsignedShort: UID]; } static void parseGroupExtension(OFLHAArchiveEntry *entry, OFData *extension, of_string_encoding_t encoding) { [entry->_group release]; |
︙ | ︙ | |||
651 652 653 654 655 656 657 | if (_mode != nil) { tmp16 = OF_BSWAP16_IF_BE(5); [data addItems: &tmp16 count: sizeof(tmp16)]; [data addItem: "\x50"]; | | | | | 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 | if (_mode != nil) { tmp16 = OF_BSWAP16_IF_BE(5); [data addItems: &tmp16 count: sizeof(tmp16)]; [data addItem: "\x50"]; tmp16 = OF_BSWAP16_IF_BE(_mode.unsignedShortValue); [data addItems: &tmp16 count: sizeof(tmp16)]; } if (_UID != nil || _GID != nil) { if (_UID == nil || _GID == nil) @throw [OFInvalidArgumentException exception]; tmp16 = OF_BSWAP16_IF_BE(7); [data addItems: &tmp16 count: sizeof(tmp16)]; [data addItem: "\x51"]; tmp16 = OF_BSWAP16_IF_BE(_GID.unsignedShortValue); [data addItems: &tmp16 count: sizeof(tmp16)]; tmp16 = OF_BSWAP16_IF_BE(_UID.unsignedShortValue); [data addItems: &tmp16 count: sizeof(tmp16)]; } if (_group != nil) { size_t groupLength = [_group cStringLengthWithEncoding: encoding]; |
︙ | ︙ | |||
757 758 759 760 761 762 763 | objc_autoreleasePoolPop(pool); } - (OFString *)description { void *pool = objc_autoreleasePoolPush(); OFString *mode = (_mode == nil ? nil | | | 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 | objc_autoreleasePoolPop(pool); } - (OFString *)description { void *pool = objc_autoreleasePoolPush(); OFString *mode = (_mode == nil ? nil : [OFString stringWithFormat: @"%ho", _mode.unsignedShortValue]); OFString *extensions = [_extensions.description stringByReplacingOccurrencesOfString: @"\n" withString: @"\n\t"]; OFString *ret = [OFString stringWithFormat: @"<%@:\n" @"\tFile name = %@\n" @"\tCompression method = %@\n" |
︙ | ︙ |