Fix Java multi-argument typemaps (char *STRING, size_t LENGTH)
Now they can be applied to a wider range of types. Closes #385.
This commit is contained in:
parent
b4c441f62e
commit
6c1630b152
4 changed files with 30 additions and 0 deletions
|
|
@ -17,11 +17,15 @@ public class director_binary_string_runme {
|
|||
Callback callback = new DirectorBinaryStringCallback();
|
||||
caller.setCallback(callback);
|
||||
int sum = caller.call();
|
||||
int sumData = caller.callWriteData();
|
||||
caller.delCallback();
|
||||
|
||||
if (sum != 9*2*8 + 13*3*5)
|
||||
throw new RuntimeException("Unexpected sum: " + sum);
|
||||
|
||||
if (sumData != 9*2*8)
|
||||
throw new RuntimeException("Unexpected sum: " + sum);
|
||||
|
||||
new Callback().run(null, null);
|
||||
callback = new DirectorBinaryStringCallback();
|
||||
caller.setCallback(callback);
|
||||
|
|
@ -45,5 +49,13 @@ class DirectorBinaryStringCallback extends Callback {
|
|||
for (int i = 0; i < dataBufferBB.length; i++)
|
||||
dataBufferBB[i] = (byte)(dataBufferBB[i] * 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeData(byte[] dataBufferAA)
|
||||
{
|
||||
if (dataBufferAA != null)
|
||||
for (int i = 0; i < dataBufferAA.length; i++)
|
||||
dataBufferAA[i] = (byte)(dataBufferAA[i] * 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue