ObjFW  Diff

Differences From Artifact [bfafebb5dc]:

To Artifact [28a9f74124]:


116
117
118
119
120
121
122
123

124
125
126
127
128
129
130
131
132
133
134
135

136
137
138
139
140
141
142
116
117
118
119
120
121
122

123
124
125
126
127
128
129
130
131
132
133
134

135
136
137
138
139
140
141
142







-
+











-
+







		uint16_t length;

		ret = [OFMutableData dataWithCapacity: count + 4];

		prefix = 0xC8;
		[ret addItem: &prefix];

		length = OF_BSWAP16_IF_LE((uint16_t)count);
		length = OFToBigEndian16((uint16_t)count);
		[ret addItems: &length count: 2];

		[ret addItem: &_type];
	} else {
		uint32_t length;

		ret = [OFMutableData dataWithCapacity: count + 6];

		prefix = 0xC9;
		[ret addItem: &prefix];

		length = OF_BSWAP32_IF_LE((uint32_t)count);
		length = OFToBigEndian32((uint32_t)count);
		[ret addItems: &length count: 4];

		[ret addItem: &_type];
	}

	[ret addItems: _data.items count: _data.count];
	[ret makeImmutable];
166
167
168
169
170
171
172
173

174
175

176
177
178


179
180

181
182
183
184
185
186
187
188
189
166
167
168
169
170
171
172

173
174

175
176


177
178
179

180
181
182
183
184
185
186
187
188
189







-
+

-
+

-
-
+
+

-
+









		return false;

	return true;
}

- (unsigned long)hash
{
	uint32_t hash;
	unsigned long hash;

	OF_HASH_INIT(hash);
	OFHashInit(&hash);

	OF_HASH_ADD(hash, (uint8_t)_type);
	OF_HASH_ADD_HASH(hash, _data.hash);
	OFHashAdd(&hash, (uint8_t)_type);
	OFHashAddHash(&hash, _data.hash);

	OF_HASH_FINALIZE(hash);
	OFHashFinalize(&hash);

	return hash;
}

- (id)copy
{
	return [self retain];
}
@end