aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/jogamp/gluegen/CMethodBindingEmitter.java')
-rw-r--r--src/java/com/jogamp/gluegen/CMethodBindingEmitter.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
index 16adbe9..1987668 100644
--- a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
+++ b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
@@ -459,6 +459,7 @@ public class CMethodBindingEmitter extends FunctionEmitter {
writer.print(" ");
// Note we respect const/volatile in the function return type.
// However, we cannot have it 'const' for our local variable.
+ // See cast in emitBodyCallCFunction(..)!
writer.print(binding.getCSymbol().getReturnType().getCName(false));
writer.println(" _res;");
if (javaReturnType.isNIOByteBufferArray() ||
@@ -978,7 +979,12 @@ public class CMethodBindingEmitter extends FunctionEmitter {
final Type cReturnType = binding.getCReturnType();
if (!cReturnType.isVoid()) {
- writer.print("_res = ");
+ // Note we respect const/volatile in the function return type.
+ // However, we cannot have it 'const' for our local variable.
+ // See return type in emitBodyVariableDeclarations(..)!
+ writer.print("_res = (");
+ writer.print(cReturnType.getCName(false));
+ writer.print(") ");
}
if ( isCStructFunctionPointer && binding.hasContainingType() ) {
// Call through function pointer