Fixed warning from __objc_get_forward_imp not returning a value

From-SVN: r54707
This commit is contained in:
Nicola Pero 2002-06-17 17:41:11 +00:00
parent 97272202aa
commit bd8d449d1d
1 changed files with 30 additions and 26 deletions

View File

@ -78,33 +78,37 @@ static Method_t search_for_method_in_hierarchy (Class class, SEL sel);
Method_t search_for_method_in_list(MethodList_t list, SEL op); Method_t search_for_method_in_list(MethodList_t list, SEL op);
id nil_method(id, SEL, ...); id nil_method(id, SEL, ...);
/* Given a selector, return the proper forwarding implementation. */ /* Given a selector, return the proper forwarding implementation. */
__inline__ __inline__
IMP IMP
__objc_get_forward_imp (SEL sel) __objc_get_forward_imp (SEL sel)
{ {
if (__objc_msg_forward) /* If a custom forwarding hook was registered, try getting a forwarding
{ * function from it. */
IMP result; if (__objc_msg_forward)
if ((result = __objc_msg_forward (sel))) {
return result; IMP result;
} if ((result = __objc_msg_forward (sel)) != NULL)
else return result;
{ }
const char *t = sel->sel_types;
if (t && (*t == '[' || *t == '(' || *t == '{') /* In all other cases, use the default forwarding functions built using
#ifdef OBJC_MAX_STRUCT_BY_VALUE * __builtin_apply and friends. */
&& objc_sizeof_type(t) > OBJC_MAX_STRUCT_BY_VALUE {
#endif const char *t = sel->sel_types;
)
return (IMP)__objc_block_forward; if (t && (*t == '[' || *t == '(' || *t == '{')
else if (t && (*t == 'f' || *t == 'd')) #ifdef OBJC_MAX_STRUCT_BY_VALUE
return (IMP)__objc_double_forward; && objc_sizeof_type(t) > OBJC_MAX_STRUCT_BY_VALUE
else #endif
return (IMP)__objc_word_forward; )
} return (IMP)__objc_block_forward;
} else if (t && (*t == 'f' || *t == 'd'))
return (IMP)__objc_double_forward;
else
return (IMP)__objc_word_forward;
}
}
/* Given a class and selector, return the selector's implementation. */ /* Given a class and selector, return the selector's implementation. */
__inline__ __inline__