aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
diff options
context:
space:
mode:
authorsg215889 <[email protected]>2009-07-13 14:31:05 -0700
committersg215889 <[email protected]>2009-07-13 14:31:05 -0700
commitc19b868e5fbdd123477e13c8da6bc37ece1103ff (patch)
tree3742c46569610b5bc4d350e19ca449ce285218ee /src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
parent35cad1e103bb30737b4feacf554219b795358eec (diff)
Add missing changes
Diffstat (limited to 'src/java/com/sun/gluegen/JavaMethodBindingEmitter.java')
-rw-r--r--src/java/com/sun/gluegen/JavaMethodBindingEmitter.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java b/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
index d7fa7c4..9fa232d 100644
--- a/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
+++ b/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
@@ -640,6 +640,8 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
writer.print("BufferFactory.getArray(" + getArgumentName(i) + ")");
} else if (type.isArrayOfCompoundTypeWrappers()) {
writer.print(getArgumentName(i) + COMPOUND_ARRAY_SUFFIX);
+ } else if(type.isNIOPointerBuffer()) {
+ writer.print(getArgumentName(i) + ".getBuffer()");
} else {
writer.print(getArgumentName(i));
}
@@ -755,11 +757,11 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
if (!returnType.isNIOByteBuffer()) {
// See whether we have to expand pointers to longs
if (getBinding().getCReturnType().pointerDepth() >= 2) {
- if (!returnType.isNIOLongBuffer()) {
+ if (!returnType.isNIOPointerBuffer()) {
throw new RuntimeException("While emitting glue code for " + getName() +
": can not legally make pointers opaque to anything but longs");
}
- writer.println(" return BufferFactory.asPointerBuffer(_res);");
+ writer.println(" return PointerBuffer.wrapNative2Java(_res, false);");
} else {
String returnTypeName = returnType.getName().substring("java.nio.".length());
writer.println(" return _res.as" + returnTypeName + "();");