|
|
|
|
@ -52,6 +52,8 @@ inline static BOOL isSelRegistered(SEL sel)
|
|
|
|
|
return NO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TYPE_DEPENDENT_DISPATCH
|
|
|
|
|
/**
|
|
|
|
|
* Skip anything in a type encoding that is irrelevant to the comparison
|
|
|
|
|
* between selectors, including type qualifiers and argframe info.
|
|
|
|
|
@ -66,7 +68,7 @@ static const char *skip_irrelevant_type_info(const char *t)
|
|
|
|
|
return skip_irrelevant_type_info(t+1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef TYPE_DEPENDENT_DISPATCH
|
|
|
|
|
static BOOL selector_types_equal(const char *t1, const char *t2)
|
|
|
|
|
@ -100,6 +102,17 @@ static BOOL selector_types_equivalent(const char *t1, const char *t2)
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Compare whether two selectors are identical.
|
|
|
|
|
*/
|
|
|
|
|
static int selector_identical(const void *k,
|
|
|
|
|
const SEL value)
|
|
|
|
|
{
|
|
|
|
|
SEL key = (SEL)k;
|
|
|
|
|
return string_compare(sel_getName(key), sel_getName(value)) &&
|
|
|
|
|
string_compare(sel_getType_np(key), sel_getType_np(value));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Compare selectors based on whether they are treated as equivalent for the
|
|
|
|
|
* purpose of dispatch.
|
|
|
|
|
@ -108,22 +121,13 @@ static int selector_equal(const void *k,
|
|
|
|
|
const SEL value)
|
|
|
|
|
{
|
|
|
|
|
#ifdef TYPE_DEPENDENT_DISPATCH
|
|
|
|
|
return selector_identical(key, value);
|
|
|
|
|
return selector_identical(k, value);
|
|
|
|
|
#else
|
|
|
|
|
SEL key = (SEL)k;
|
|
|
|
|
return string_compare(sel_getName(key), sel_getName(value));
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Compare whether two selectors are identical.
|
|
|
|
|
*/
|
|
|
|
|
static int selector_identical(const void *k,
|
|
|
|
|
const SEL value)
|
|
|
|
|
{
|
|
|
|
|
SEL key = (SEL)k;
|
|
|
|
|
return string_compare(sel_getName(key), sel_getName(value)) &&
|
|
|
|
|
string_compare(sel_getType_np(key), sel_getType_np(value));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Hash a selector.
|
|
|
|
|
*/
|
|
|
|
|
|