ObjFW  Check-in [77573bf01f]

Overview
Comment:Never throw in -[typeEncodingForSelector:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 77573bf01fea4cd9706db8cde904eee8a0b1d52657dbbc3d93b0b30302ddf557
User & Date: js on 2012-12-22 14:41:18
Other Links: manifest | tags
Context
2012-12-22
15:37
Add -[doesNotRecognizeSelector:]. check-in: 917ce5754c user: js tags: trunk
14:41
Never throw in -[typeEncodingForSelector:]. check-in: 77573bf01f user: js tags: trunk
2012-12-20
16:42
Remove dummy implementations for formal protocols. check-in: 89177dcd09 user: js tags: trunk
Changes

Modified src/OFObject.m from [5c04a02683] to [9c302a662d].

355
356
357
358
359
360
361
362
363
364

365
366
367
368
369
370
371
372
373
374


375
376
377
378

379
380
381
382
383
384
385
355
356
357
358
359
360
361



362




363
364

365


366
367


368

369
370
371
372
373
374
375
376







-
-
-
+
-
-
-
-


-

-
-
+
+
-
-

-
+







{
	return class_getMethodImplementation(self, selector);
}

+ (const char*)typeEncodingForInstanceSelector: (SEL)selector
{
#if defined(OF_OBJFW_RUNTIME)
	const char *ret;

	if ((ret = objc_get_type_encoding(self, selector)) == NULL)
	return objc_get_type_encoding(self, selector);
		@throw [OFNotImplementedException exceptionWithClass: self
							    selector: selector];

	return ret;
#else
	Method m;
	const char *ret;

	if ((m = class_getInstanceMethod(self, selector)) == NULL ||
	    (ret = method_getTypeEncoding(m)) == NULL)
	if ((m = class_getInstanceMethod(self, selector)) == NULL)
		return NULL;
		@throw [OFNotImplementedException exceptionWithClass: self
							    selector: selector];

	return ret;
	return method_getTypeEncoding(m);
#endif
}

+ (OFString*)description
{
	return [self className];
}
808
809
810
811
812
813
814
815
816
817

818
819
820
821
822
823
824
825
826
827
828
829

830
831
832

833
834

835
836
837
838
839
840
841
799
800
801
802
803
804
805



806






807
808

809
810

811



812
813

814
815
816
817
818
819
820
821







-
-
-
+
-
-
-
-
-
-


-


-
+
-
-
-
+

-
+








	objc_autoreleasePoolPop(pool);
}

- (const char*)typeEncodingForSelector: (SEL)selector
{
#if defined(OF_OBJFW_RUNTIME)
	const char *ret;

	if ((ret = objc_get_type_encoding(object_getClass(self),
	return objc_get_type_encoding(object_getClass(self), selector);
	    selector)) == NULL)
		@throw [OFNotImplementedException
		    exceptionWithClass: [self class]
			      selector: selector];

	return ret;
#else
	Method m;
	const char *ret;

	if ((m = class_getInstanceMethod(object_getClass(self),
	    selector)) == NULL || (ret = method_getTypeEncoding(m)) == NULL)
	    selector)) == NULL)
		@throw [OFNotImplementedException
		    exceptionWithClass: [self class]
			      selector: selector];
		return NULL;

	return ret;
	return method_getTypeEncoding(m);
#endif
}

- (BOOL)isEqual: (id)object
{
	/* Classes containing data should reimplement this! */
	return (self == object);