Method signature fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/freeze-1_0_0@9481 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2001-03-23 17:52:54 +00:00
parent f79f14240d
commit d544c693b9
2 changed files with 22 additions and 2 deletions

View file

@ -36,8 +36,13 @@
+ (NSMethodSignature*) signatureWithObjCTypes: (const char*)t
{
NSMethodSignature *newMs = [[NSMethodSignature alloc] autorelease];
NSMethodSignature *newMs;
if (t == 0 || *t == '\0')
{
return nil;
}
newMs = AUTORELEASE([NSMethodSignature alloc]);
newMs->_methodTypes = mframe_build_signature(t, &newMs->_argFrameLength,
&newMs->_numArgs, 0);

View file

@ -756,14 +756,29 @@ static BOOL deallocNotifications = NO;
const char *types;
struct objc_method *mth;
if (aSelector == 0)
{
return nil;
}
mth = (GSObjCIsInstance(self)
? class_get_instance_method(GSObjCClass(self), aSelector)
: class_get_class_method(GSObjCClass(self), aSelector));
if (mth == 0)
{
types = 0;
}
else
{
types = mth->method_types;
}
if (types == 0)
{
types = aSelector->sel_types;
}
if (types == 0)
{
return nil;
}
types = mth->method_types;
return [NSMethodSignature signatureWithObjCTypes: types];
}