From 414a0146660cadd35d5ae270f7f819717e9c7374 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 9 Mar 2015 03:10:33 +0100 Subject: 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. --- src/java/com/jogamp/gluegen/CMethodBindingEmitter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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()) { -- cgit v1.2.3