From 93af6f22ccdf050cafe80ab4c2d29f9924064f1c Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sun, 1 Jan 2006 23:13:49 +0000 Subject: Fixed build problems on X11 platforms after last checkin git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@507 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/gluegen/CMethodBindingEmitter.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/classes/com') diff --git a/src/classes/com/sun/gluegen/CMethodBindingEmitter.java b/src/classes/com/sun/gluegen/CMethodBindingEmitter.java index 550d8d739..4208dfff1 100644 --- a/src/classes/com/sun/gluegen/CMethodBindingEmitter.java +++ b/src/classes/com/sun/gluegen/CMethodBindingEmitter.java @@ -1033,14 +1033,15 @@ public class CMethodBindingEmitter extends FunctionEmitter writer.println(" " + arrayRes + " = (*env)->NewObjectArray(env, " + arrayResLength + ", (*env)->FindClass(env, \"java/nio/ByteBuffer\"), NULL);"); writer.println(" for (" + arrayIdx + " = 0; " + arrayIdx + " < " + arrayResLength + "; " + arrayIdx + "++) {"); Type retType = binding.getCSymbol().getReturnType(); - Type baseType; + Type pointerType; if (retType.isPointer()) { - baseType = retType.asPointer().getTargetType().asPointer().getTargetType(); + pointerType = retType.asPointer().getTargetType(); } else { - baseType = retType.asArray().getElementType().asPointer().getTargetType(); + pointerType = retType.asArray().getElementType(); } + Type baseType = pointerType.asPointer().getTargetType(); writer.println(" (*env)->SetObjectArrayElement(env, " + arrayRes + ", " + arrayIdx + - ", (*env)->NewDirectByteBuffer(env, _res[" + arrayIdx + "], sizeof(" + baseType.getName() + ")));"); + ", (*env)->NewDirectByteBuffer(env, _res[" + arrayIdx + "], sizeof(" + pointerType.getName() + ")));"); writer.println(" }"); writer.println(" return " + arrayRes + ";"); } else if (javaReturnType.isArray()) { -- cgit v1.2.3