diff options
author | Kenneth Russel <[email protected]> | 2003-07-15 06:35:12 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2003-07-15 06:35:12 +0000 |
commit | 68e29a425b63f1eca8e6879ebfb3324929b3dc2a (patch) | |
tree | f7b2af1c4ff4dab8e4c72dba2fd72223323d0bb6 /src | |
parent | 1ad0557911c2466a6943564528b31cc33f48851d (diff) |
Fixed issue 13: Readable names for function arguments
Applied patches submitted by [email protected].
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@32 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
3 files changed, 20 insertions, 3 deletions
diff --git a/src/net/java/games/gluegen/cgram/types/FunctionType.java b/src/net/java/games/gluegen/cgram/types/FunctionType.java index f864b4d2c..d84c49833 100644 --- a/src/net/java/games/gluegen/cgram/types/FunctionType.java +++ b/src/net/java/games/gluegen/cgram/types/FunctionType.java @@ -94,6 +94,11 @@ public class FunctionType extends Type { argumentNames.add(argumentName); } + public void setArgumentName(int i, String name) + { + argumentNames.set(i,name); + } + public String toString() { return toString(null); } diff --git a/src/net/java/games/gluegen/opengl/GLEmitter.java b/src/net/java/games/gluegen/opengl/GLEmitter.java index f6e26fd3b..5fb032124 100644 --- a/src/net/java/games/gluegen/opengl/GLEmitter.java +++ b/src/net/java/games/gluegen/opengl/GLEmitter.java @@ -224,6 +224,18 @@ public class GLEmitter extends JavaEmitter //System.err.println("WARNING (GL): *not* run-time linking: " + sym + // "(" + funcPointerTypedefName + " undefined)"); } + else + { + FunctionType typedef = typedefDictionary.get(funcPointerTypedefName).asPointer().getTargetType().asFunction(); + FunctionType fun = sym.getType(); + int numarg = typedef.getNumArguments(); + for ( int i =0; i < numarg; i++ ) + { + if ( fun.getArgumentName(i) == null ) + fun.setArgumentName(i,typedef.getArgumentName(i)); + } + } + return shouldWrap; } diff --git a/src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java b/src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java index c3b17f6cb..4fb50ea21 100644 --- a/src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java +++ b/src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java @@ -157,8 +157,8 @@ public class JavaGLPAWrapperEmitter extends JavaMethodBindingImplEmitter String procAddressVariable = GLEmitter.PROCADDRESS_VAR_PREFIX + wrappedBinding.getName(); - writer.println(" final long addr = " + getProcAddressTableExpr + "." + procAddressVariable + ";"); - writer.println(" if (addr == 0) {"); + writer.println(" final long __addr_ = " + getProcAddressTableExpr + "." + procAddressVariable + ";"); + writer.println(" if (__addr_ == 0) {"); writer.println(" throw new GLException(\"Method \\\"" + binding.getName() + "\\\" not available\");"); writer.println(" }"); } @@ -168,7 +168,7 @@ public class JavaGLPAWrapperEmitter extends JavaMethodBindingImplEmitter if (numEmitted > 0) { writer.print(", "); } - writer.print("addr"); + writer.print("__addr_"); return 1 + numEmitted; } |