Improve reliability of methodSignatureForSelector.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9310 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2001-03-07 21:21:10 +00:00
parent a411cc4bb9
commit bc02628d69
3 changed files with 18 additions and 17 deletions

View file

@ -1,3 +1,8 @@
2001-03-07 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSObject.m: ([methodSignatureForSelector:]) reliability
fix suggested by Manuel Guesdon <ml@sbuilders.com>
2001-03-06 Adam Fedor <fedor@gnu.org>
* Source/libgnustep-base.def: Regenerate.

View file

@ -113,6 +113,9 @@
<sel>instanceMethodSignatureForSelector:</sel>
<arg type="SEL">aSelector</arg>
<desc>
Returns a method signature object representing the
method implemented for instsances of this class which
corresponds to the supplied selector.
</desc>
</method>
<method type="BOOL" factory="yes">
@ -293,6 +296,9 @@
<sel>methodSignatureForSelector:</sel>
<arg type="SEL">aSelector</arg>
<desc>
Returns a method signature object representing the
method implemented in this object which corresponds to
the supplied selector.
</desc>
</method>
<method type="id">

View file

@ -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];
}