ObjFW  Diff

Differences From Artifact [477a94e0e9]:

To Artifact [b63548e22a]:


42
43
44
45
46
47
48
49

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

80
81
82

83
84
85
86
87
88
89
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

79
80
81

82
83
84
85
86
87
88
89







-
+














-
+














-
+


-
+







}

- (void)setFileName: (OFString *)fileName
{
	void *pool = objc_autoreleasePoolPush();
	OFString *old;

	if ([fileName UTF8StringLength] > UINT16_MAX)
	if (fileName.UTF8StringLength > UINT16_MAX)
		@throw [OFOutOfRangeException exception];

	old = _fileName;
	_fileName = [fileName copy];
	[old release];

	objc_autoreleasePoolPop(pool);
}

- (void)setFileComment: (OFString *)fileComment
{
	void *pool = objc_autoreleasePoolPush();
	OFString *old;

	if ([fileComment UTF8StringLength] > UINT16_MAX)
	if (fileComment.UTF8StringLength > UINT16_MAX)
		@throw [OFOutOfRangeException exception];

	old = _fileComment;
	_fileComment = [fileComment copy];
	[old release];

	objc_autoreleasePoolPop(pool);
}

- (void)setExtraField: (OFData *)extraField
{
	void *pool = objc_autoreleasePoolPush();
	OFData *old;

	if ([extraField itemSize] != 1)
	if (extraField.itemSize != 1)
		@throw [OFInvalidArgumentException exception];

	if ([extraField count] > UINT16_MAX)
	if (extraField.count > UINT16_MAX)
		@throw [OFOutOfRangeException exception];

	old = _extraField;
	_extraField = [extraField copy];
	[old release];

	objc_autoreleasePoolPop(pool);
99
100
101
102
103
104
105
106
107
108
109
110





111
112
113
114
115
116
117
99
100
101
102
103
104
105





106
107
108
109
110
111
112
113
114
115
116
117







-
-
-
-
-
+
+
+
+
+







	_minVersionNeeded = minVersionNeeded;
}

- (void)setModificationDate: (OFDate *)date
{
	void *pool = objc_autoreleasePoolPush();

	_lastModifiedFileDate = ((([date localYear] - 1980) & 0xFF) << 9) |
	    (([date localMonthOfYear] & 0x0F) << 5) |
	    ([date localDayOfMonth] & 0x1F);
	_lastModifiedFileTime = (([date localHour] & 0x1F) << 11) |
	    (([date localMinute] & 0x3F) << 5) | (([date second] >> 1) & 0x0F);
	_lastModifiedFileDate = (((date.localYear - 1980) & 0xFF) << 9) |
	    ((date.localMonthOfYear & 0x0F) << 5) |
	    (date.localDayOfMonth & 0x1F);
	_lastModifiedFileTime = ((date.localHour & 0x1F) << 11) |
	    ((date.localMinute & 0x3F) << 5) | ((date.second >> 1) & 0x0F);

	objc_autoreleasePoolPop(pool);
}

- (void)setCompressionMethod: (uint16_t)compressionMethod
{
	_compressionMethod = compressionMethod;