aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-03-09 03:10:33 +0100
committerSven Gothel <[email protected]>2015-03-09 03:10:33 +0100
commit414a0146660cadd35d5ae270f7f819717e9c7374 (patch)
tree757162c4185ee64df5878ace92f01243181b54db /src
parent9eb9403d774db0c55ea3cb2fc5bd04114b8b5feb (diff)
Bug 1134 - Fix CMethodBindingEmitter return type '_res' qualifiers
We cannot have the local variable holding the return type 'const' and assign a value to it later.
Diffstat (limited to 'src')
-rw-r--r--src/java/com/jogamp/gluegen/CMethodBindingEmitter.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
index fb617ef..16adbe9 100644
--- a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
+++ b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
@@ -457,8 +457,9 @@ public class CMethodBindingEmitter extends FunctionEmitter {
final JavaType javaReturnType = binding.getJavaReturnType();
if (!cReturnType.isVoid()) {
writer.print(" ");
- // Note we must respect const/volatile for return argument
- writer.print(binding.getCSymbol().getReturnType().getCName(true));
+ // Note we respect const/volatile in the function return type.
+ // However, we cannot have it 'const' for our local variable.
+ writer.print(binding.getCSymbol().getReturnType().getCName(false));
writer.println(" _res;");
if (javaReturnType.isNIOByteBufferArray() ||
javaReturnType.isArrayOfCompoundTypeWrappers()) {