diff options
author | Sven Gothel <[email protected]> | 2015-03-07 09:21:24 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-07 09:21:24 +0100 |
commit | d75bd393a5850252d7d7012e68af3850178ca8c9 (patch) | |
tree | d812ab6f1fc360d5b3ecc9c4155808bc6afae3b2 /src/java/com/jogamp/gluegen/CMethodBindingEmitter.java | |
parent | b86c042c864db0d8061b999fadc87dd9f3b45824 (diff) |
Bug 1134 - Fix IntType: Add getCName(..) for proper C-type code; Fix its newCVVariant(..), don't pass given cv-attr as typedef
Add getCName(..) for proper C-type code
- Add 'unsigned ' if not typedef and is unsigned.
- Allows removal of special case in CMethodBindingEmitter
- Fixes ProcAddressCMethodBindingEmitter typedef emission
and removes clang warnings, caused by this (many).
Fix its newCVVariant(..), don't pass given cv-attr as typedef
- Proper delegation of 'const', regression of prev. commits
Diffstat (limited to 'src/java/com/jogamp/gluegen/CMethodBindingEmitter.java')
-rw-r--r-- | src/java/com/jogamp/gluegen/CMethodBindingEmitter.java | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java index 85c6d7e..10a9648 100644 --- a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java +++ b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java @@ -928,20 +928,9 @@ public class CMethodBindingEmitter extends FunctionEmitter { javaArgType.isArray() || javaArgType.isArrayOfCompoundTypeWrappers() || ( javaArgType.isNIOBuffer() && forIndirectBufferAndArrayImplementation ) ); - if (isBaseTypeConst(cArgType)) { - writer.print("const "); - } - - // if this is a pointer to an unsigned type, add unsigned to the name to avoid compiler warnings - if(cArgType.isPointer()) { - final Type baseType = cArgType.getBaseElementType(); - if(baseType.isInt() && (((IntType)baseType).isPrimitiveUnsigned())) { - writer.print("unsigned "); - } - } - - writer.print(cArgType.getCName()); + writer.print(cArgType.getCName(true)); writer.print(") "); + if (cArgType.isPointer() && javaArgType.isPrimitive()) { writer.print("(intptr_t) "); } @@ -1105,7 +1094,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { } } else if (javaReturnType.isString()) { writer.println(" if (NULL == _res) return NULL;"); - writer.println(" return (*env)->NewStringUTF(env, _res);"); + writer.println(" return (*env)->NewStringUTF(env, (const char *)_res);"); } else if (javaReturnType.isArrayOfCompoundTypeWrappers() || (javaReturnType.isArray() && javaReturnType.isNIOByteBufferArray())) { writer.println(" if (NULL == _res) return NULL;"); |