diff --git a/ChangeLog b/ChangeLog index 83a184295..d327d05d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-03-07 Richard Frith-Macdonald + + * Source/NSObject.m: ([methodSignatureForSelector:]) reliability + fix suggested by Manuel Guesdon + 2001-03-06 Adam Fedor * Source/libgnustep-base.def: Regenerate. diff --git a/Documentation/gsdoc/NSObject.gsdoc b/Documentation/gsdoc/NSObject.gsdoc index 0ea172728..e96ddc1ea 100644 --- a/Documentation/gsdoc/NSObject.gsdoc +++ b/Documentation/gsdoc/NSObject.gsdoc @@ -113,6 +113,9 @@ instanceMethodSignatureForSelector: aSelector + Returns a method signature object representing the + method implemented for instsances of this class which + corresponds to the supplied selector. @@ -293,6 +296,9 @@ methodSignatureForSelector: aSelector + Returns a method signature object representing the + method implemented in this object which corresponds to + the supplied selector. diff --git a/Source/NSObject.m b/Source/NSObject.m index 95df165a2..326233fce 100644 --- a/Source/NSObject.m +++ b/Source/NSObject.m @@ -754,26 +754,16 @@ static BOOL deallocNotifications = NO; - (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector { const char *types; + struct objc_method *mth; -#ifdef __FreeBSD__ - types = NULL; -#else - types = aSelector->sel_types; -#endif - - if (types == 0) + mth = (GSObjCIsInstance(self) + ? class_get_instance_method(GSObjCClass(self), aSelector) + : class_get_class_method(GSObjCClass(self), aSelector)); + if (mth == 0) { - struct objc_method *mth; - - mth = (GSObjCIsInstance(self) - ? class_get_instance_method(GSObjCClass(self), aSelector) - : class_get_class_method(GSObjCClass(self), aSelector)); - if (mth == 0) - { - return nil; - } - types = mth->method_types; + return nil; } + types = mth->method_types; return [NSMethodSignature signatureWithObjCTypes: types]; }