diff options
author | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-17 17:41:11 +0000 |
---|---|---|
committer | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-17 17:41:11 +0000 |
commit | 59a5ff3a7febb51c9ac25059b9a6ade0806b2293 (patch) | |
tree | 5355c7b610dceb99f7e865ce21a3ab21276bcdab /libobjc | |
parent | 8544660a62ac218249c989cc70c8d9e07b61723b (diff) | |
download | gcc-59a5ff3a7febb51c9ac25059b9a6ade0806b2293.tar.gz |
Fixed warning from __objc_get_forward_imp not returning a value
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54707 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc')
-rw-r--r-- | libobjc/sendmsg.c | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/libobjc/sendmsg.c b/libobjc/sendmsg.c index b447884b3d1..eafecd7efa6 100644 --- a/libobjc/sendmsg.c +++ b/libobjc/sendmsg.c @@ -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); id nil_method(id, SEL, ...); -/* Given a selector, return the proper forwarding implementation. */ -__inline__ -IMP -__objc_get_forward_imp (SEL sel) -{ - if (__objc_msg_forward) - { - IMP result; - if ((result = __objc_msg_forward (sel))) - return result; - } - else - { - const char *t = sel->sel_types; - - if (t && (*t == '[' || *t == '(' || *t == '{') -#ifdef OBJC_MAX_STRUCT_BY_VALUE - && objc_sizeof_type(t) > OBJC_MAX_STRUCT_BY_VALUE -#endif - ) - 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 selector, return the proper forwarding implementation. */ +__inline__ +IMP +__objc_get_forward_imp (SEL sel) +{ + /* If a custom forwarding hook was registered, try getting a forwarding + * function from it. */ + if (__objc_msg_forward) + { + IMP result; + if ((result = __objc_msg_forward (sel)) != NULL) + return result; + } + + /* In all other cases, use the default forwarding functions built using + * __builtin_apply and friends. */ + { + const char *t = sel->sel_types; + + if (t && (*t == '[' || *t == '(' || *t == '{') +#ifdef OBJC_MAX_STRUCT_BY_VALUE + && objc_sizeof_type(t) > OBJC_MAX_STRUCT_BY_VALUE +#endif + ) + 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. */ __inline__ |