mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Simplification of some invocation code.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30531 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b326d69195
commit
775dd86b02
1 changed files with 2 additions and 14 deletions
|
@ -534,15 +534,11 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
|
||||||
SEL selector;
|
SEL selector;
|
||||||
GSFFIInvocation *invocation;
|
GSFFIInvocation *invocation;
|
||||||
NSMethodSignature *sig;
|
NSMethodSignature *sig;
|
||||||
GSMethod fwdInvMethod;
|
|
||||||
|
|
||||||
obj = *(id *)args[0];
|
obj = *(id *)args[0];
|
||||||
selector = *(SEL *)args[1];
|
selector = *(SEL *)args[1];
|
||||||
|
|
||||||
fwdInvMethod = gs_method_for_receiver_and_selector
|
if (!class_respondsToSelector(obj->class_pointer, @selector(forwardInvocation:)))
|
||||||
(obj, @selector (forwardInvocation:));
|
|
||||||
|
|
||||||
if (!fwdInvMethod)
|
|
||||||
{
|
{
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: @"GSFFIInvocation: Class '%s'(%s) does not respond"
|
format: @"GSFFIInvocation: Class '%s'(%s) does not respond"
|
||||||
|
@ -625,15 +621,7 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
|
||||||
[invocation setTarget: obj];
|
[invocation setTarget: obj];
|
||||||
[invocation setSelector: selector];
|
[invocation setSelector: selector];
|
||||||
|
|
||||||
/*
|
[obj forwardInvocation: invocation];
|
||||||
* Now do it.
|
|
||||||
* The next line is equivalent to
|
|
||||||
*
|
|
||||||
* [obj forwardInvocation: invocation];
|
|
||||||
*
|
|
||||||
* but we have already the GSMethod for forwardInvocation
|
|
||||||
* so the line below is somewhat faster. */
|
|
||||||
fwdInvMethod->method_imp (obj, fwdInvMethod->method_name, invocation);
|
|
||||||
|
|
||||||
/* If we are returning a value, we must copy it from the invocation
|
/* If we are returning a value, we must copy it from the invocation
|
||||||
* to the memory indicated by 'retp'.
|
* to the memory indicated by 'retp'.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue