From c19b868e5fbdd123477e13c8da6bc37ece1103ff Mon Sep 17 00:00:00 2001 From: sg215889 Date: Mon, 13 Jul 2009 14:31:05 -0700 Subject: Add missing changes --- src/java/com/sun/gluegen/JavaMethodBindingEmitter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/java/com/sun/gluegen/JavaMethodBindingEmitter.java') 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 + "();"); -- cgit v1.2.3