From 9d26f595d02b048f82ceb082c48882196833296f Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sat, 12 May 2007 15:02:43 +0000 Subject: Corrected mismatch in logic deciding const-ness of pointer-to-pointer types uncovered by user Rogue git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@60 a78bb65f-1512-4460-ba86-f6dc96a7bf27 --- src/java/com/sun/gluegen/CMethodBindingEmitter.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/java/com/sun/gluegen/CMethodBindingEmitter.java b/src/java/com/sun/gluegen/CMethodBindingEmitter.java index 1ffd362..243e90f 100644 --- a/src/java/com/sun/gluegen/CMethodBindingEmitter.java +++ b/src/java/com/sun/gluegen/CMethodBindingEmitter.java @@ -606,11 +606,6 @@ public class CMethodBindingEmitter extends FunctionEmitter // FIXME: if the arg type is non-const, the sematics might be that // the function modifies the argument -- we don't yet support // this. - // - // Note: the check for "const" in the CVAttributes string isn't - // truly checking the constness of the target types at both - // pointer depths. However, it's a quick approximation, and quite - // often C code doesn't get the constness right anyhow. throw new RuntimeException( "Cannot copy data for ptr-to-ptr arg type \"" + cArgType + "\": support for non-const ptr-to-ptr types not implemented."); @@ -796,7 +791,7 @@ public class CMethodBindingEmitter extends FunctionEmitter Type cArgType = binding.getCArgumentType(i); String cArgTypeName = cArgType.getName(); - if (cArgType.toString().indexOf("const") == -1) { + if (!isConstPtrPtr(cArgType)) { // FIXME: handle any cleanup from treatment of non-const args, // assuming they were treated differently in // emitBodyVariablePreCallSetup() (see the similar section in that -- cgit v1.2.3