mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Correct FFI value setting
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13532 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
591ce7b3de
commit
3a327f1177
6 changed files with 51 additions and 28 deletions
|
@ -190,6 +190,7 @@ int con_data (id prx)
|
|||
printf("Many Arguments:\n");
|
||||
[prx manyArgs:1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12];
|
||||
|
||||
printf("Done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -268,6 +269,7 @@ con_messages (id prx)
|
|||
#endif
|
||||
printf(" ok\n");
|
||||
|
||||
printf("Done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -300,6 +302,7 @@ con_benchmark (id prx)
|
|||
}
|
||||
|
||||
printf(" Delay is %f\n", [d timeIntervalSinceNow]);
|
||||
printf("Done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@ typedef struct {
|
|||
- (small) loopSmallPtr: (small*)v;
|
||||
- (char*) loopString: (char*)v;
|
||||
|
||||
- (double) loopMulti: (float)f int: (float)v ch: (char)c;
|
||||
|
||||
- (char) retChar;
|
||||
- (double) retDouble;
|
||||
- (float) retFloat;
|
||||
|
@ -91,6 +93,11 @@ typedef struct {
|
|||
return v;
|
||||
}
|
||||
|
||||
- (double) loopMulti: (float)f int: (float)v ch: (char)c
|
||||
{
|
||||
return v+1.0;
|
||||
}
|
||||
|
||||
- (char) retChar
|
||||
{
|
||||
return (char)99;
|
||||
|
@ -357,6 +364,11 @@ printf("Calling proxy\n");
|
|||
d = [p loopDouble: 5.0];
|
||||
printf("forward: %.1f\n", d);
|
||||
|
||||
SETUP(loopMulti:int:ch:);
|
||||
printf("Expect: 6.0, ");
|
||||
f = [p loopMulti: 3.0 int: 5.0 ch: 'a'];
|
||||
printf("forward: %.1f\n", f);
|
||||
|
||||
SETUP(loopObject:);
|
||||
[inv setArgument: &p atIndex: 2];
|
||||
[inv invokeWithTarget: t];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue