ObjFW  Diff

Differences From Artifact [1c056221ee]:

To Artifact [0c9f7f6c34]:


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
213
214
215
216
217
218
219
220
221
222
223
		otherValue = of_alloc(1, size);
	} @catch (id e) {
		free(value);
		@throw e;
	}

	@try {
		[self getValue: value
			  size: size];
		[object getValue: otherValue
			    size: size];

		ret = (memcmp(value, otherValue, size) == 0);
	} @finally {
		free(value);
		free(otherValue);
	}

	return ret;
}

- (unsigned long)hash
{
	size_t size = of_sizeof_type_encoding(self.objCType);
	unsigned char *value;
	uint32_t hash;

	value = of_alloc(1, size);
	@try {
		[self getValue: value
			  size: size];

		OF_HASH_INIT(hash);

		for (size_t i = 0; i < size; i++)
			OF_HASH_ADD(hash, value[i]);

		OF_HASH_FINALIZE(hash);







|
<
|
<
<

















|
<







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

213
214
215
216
217
218
219
		otherValue = of_alloc(1, size);
	} @catch (id e) {
		free(value);
		@throw e;
	}

	@try {
		[self getValue: value size: size];

		[object getValue: otherValue size: size];


		ret = (memcmp(value, otherValue, size) == 0);
	} @finally {
		free(value);
		free(otherValue);
	}

	return ret;
}

- (unsigned long)hash
{
	size_t size = of_sizeof_type_encoding(self.objCType);
	unsigned char *value;
	uint32_t hash;

	value = of_alloc(1, size);
	@try {
		[self getValue: value size: size];


		OF_HASH_INIT(hash);

		for (size_t i = 0; i < size; i++)
			OF_HASH_ADD(hash, value[i]);

		OF_HASH_FINALIZE(hash);
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
}

- (const char *)objCType
{
	OF_UNRECOGNIZED_SELECTOR
}

- (void)getValue: (void *)value
	    size: (size_t)size
{
	OF_UNRECOGNIZED_SELECTOR
}

- (void *)pointerValue
{
	void *ret;

	[self getValue: &ret
		  size: sizeof(ret)];

	return ret;
}

- (id)nonretainedObjectValue
{
	id ret;

	[self getValue: &ret
		  size: sizeof(ret)];

	return ret;
}

- (of_range_t)rangeValue
{
	of_range_t ret;

	[self getValue: &ret
		  size: sizeof(ret)];

	return ret;
}

- (of_point_t)pointValue
{
	of_point_t ret;

	[self getValue: &ret
		  size: sizeof(ret)];

	return ret;
}

- (of_dimension_t)dimensionValue
{
	of_dimension_t ret;

	[self getValue: &ret
		  size: sizeof(ret)];

	return ret;
}

- (of_rectangle_t)rectangleValue
{
	of_rectangle_t ret;

	[self getValue: &ret
		  size: sizeof(ret)];

	return ret;
}

- (OFString *)description
{
	OFMutableString *ret =
	    [OFMutableString stringWithString: @"<OFValue: "];
	size_t size = of_sizeof_type_encoding(self.objCType);
	unsigned char *value;

	value = of_alloc(1, size);
	@try {
		[self getValue: value
			  size: size];

		for (size_t i = 0; i < size; i++) {
			if (i > 0)
				[ret appendString: @" "];

			[ret appendFormat: @"%02x", value[i]];
		}







|
<







<
|
<
<






<
|
<
<






<
|
<
<






<
|
<
<






<
|
<
<






<
|
<
<












|
<







230
231
232
233
234
235
236
237

238
239
240
241
242
243
244

245


246
247
248
249
250
251

252


253
254
255
256
257
258

259


260
261
262
263
264
265

266


267
268
269
270
271
272

273


274
275
276
277
278
279

280


281
282
283
284
285
286
287
288
289
290
291
292
293

294
295
296
297
298
299
300
}

- (const char *)objCType
{
	OF_UNRECOGNIZED_SELECTOR
}

- (void)getValue: (void *)value size: (size_t)size

{
	OF_UNRECOGNIZED_SELECTOR
}

- (void *)pointerValue
{
	void *ret;

	[self getValue: &ret size: sizeof(ret)];


	return ret;
}

- (id)nonretainedObjectValue
{
	id ret;

	[self getValue: &ret size: sizeof(ret)];


	return ret;
}

- (of_range_t)rangeValue
{
	of_range_t ret;

	[self getValue: &ret size: sizeof(ret)];


	return ret;
}

- (of_point_t)pointValue
{
	of_point_t ret;

	[self getValue: &ret size: sizeof(ret)];


	return ret;
}

- (of_dimension_t)dimensionValue
{
	of_dimension_t ret;

	[self getValue: &ret size: sizeof(ret)];


	return ret;
}

- (of_rectangle_t)rectangleValue
{
	of_rectangle_t ret;

	[self getValue: &ret size: sizeof(ret)];


	return ret;
}

- (OFString *)description
{
	OFMutableString *ret =
	    [OFMutableString stringWithString: @"<OFValue: "];
	size_t size = of_sizeof_type_encoding(self.objCType);
	unsigned char *value;

	value = of_alloc(1, size);
	@try {
		[self getValue: value size: size];


		for (size_t i = 0; i < size; i++) {
			if (i > 0)
				[ret appendString: @" "];

			[ret appendFormat: @"%02x", value[i]];
		}