ObjFW  Diff

Differences From Artifact [f907dbb433]:

To Artifact [358230f36d]:


248
249
250
251
252
253
254

255
256
257
258
259

































260
261
262
263
264
265
266
	OFRect ret;
	[self getValue: &ret size: sizeof(ret)];
	return ret;
}

- (OFString *)description
{

	OFMutableString *ret =
	    [OFMutableString stringWithString: @"<OFValue: "];
	size_t size = OFSizeOfTypeEncoding(self.objCType);
	unsigned char *value;


































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

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







>
|
<
|


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
	OFRect ret;
	[self getValue: &ret size: sizeof(ret)];
	return ret;
}

- (OFString *)description
{
	const char *objCType = self.objCType;
	OFMutableString *ret;

	size_t size;
	unsigned char *value;

	if (strcmp(objCType, @encode(OFRange)) == 0 ||
	    strcmp(objCType, @encode(const OFRange)) == 0) {
		OFRange rangeValue;
		[self getValue: &rangeValue size: sizeof(rangeValue)];
		return [OFString stringWithFormat:
		    @"<OFValue: OFRange { %zd, %zd }>",
		    rangeValue.location, rangeValue.length];
	} else if (strcmp(objCType, @encode(OFPoint)) == 0 ||
	    strcmp(objCType, @encode(const OFPoint)) == 0) {
		OFPoint pointValue;
		[self getValue: &pointValue size: sizeof(pointValue)];
		return [OFString stringWithFormat:
		    @"<OFValue: OFPoint { %g, %g }>",
		    pointValue.x, pointValue.y];
	} else if (strcmp(objCType, @encode(OFSize)) == 0 ||
	    strcmp(objCType, @encode(const OFSize)) == 0) {
		OFSize sizeValue;
		[self getValue: &sizeValue size: sizeof(sizeValue)];
		return [OFString stringWithFormat:
		    @"<OFValue: OFSize { %g, %g }>",
		    sizeValue.width, sizeValue.height];
	} else if (strcmp(objCType, @encode(OFRect)) == 0 ||
	    strcmp(objCType, @encode(const OFRect)) == 0) {
		OFRect rectValue;
		[self getValue: &rectValue size: sizeof(rectValue)];
		return [OFString stringWithFormat:
		    @"<OFValue: OFRect { %g, %g, %g, %g }>",
		    rectValue.origin.x, rectValue.origin.y,
		    rectValue.size.width, rectValue.size.height];
	}

	ret = [OFMutableString stringWithString: @"<OFValue: "];
	size = OFSizeOfTypeEncoding(objCType);
	value = OFAllocMemory(1, size);
	@try {
		[self getValue: value size: size];

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