Implement isEqual: for NSMethodSignature

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13599 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2002-05-06 14:42:14 +00:00
parent a5fa6397fa
commit ff202496f3
2 changed files with 40 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2002-05-06 Adam Fedor <fedor@gnu.org>
* Source/NSMethodSignature.m (-isEqual:): Implemented (from
znek@mulle-kybernetik.com).
2002-05-06 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSMapTable.m: Delete line teft over by accident ... could

View file

@ -126,6 +126,41 @@
[super dealloc];
}
- (BOOL)isEqual:(id)other
{
BOOL isEqual = YES;
if (other == nil)
{
return NO;
}
if (((NSMethodSignature *)other)->isa != isa)
{
return NO;
}
isEqual = ([self numberOfArguments] == [other numberOfArguments]
&& [self frameLength] == [other frameLength]
&& *[self methodReturnType] == *[other methodReturnType]
&& [self isOneway] == [other isOneway]);
if(isEqual == NO)
{
return NO;
}
else
{
int i, n;
n = [self numberOfArguments];
for(i = 0; i < n; i++)
{
if ( (*[self getArgumentTypeAtIndex:i]
== *[other getArgumentTypeAtIndex:i]) == NO)
{
return NO;
}
}
}
return isEqual;
}
@end
@implementation NSMethodSignature(GNU)