summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/java/com/jogamp/gluegen/CMethodBindingEmitter.java14
-rw-r--r--src/java/com/jogamp/gluegen/cgram/types/PointerType.java8
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java10
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/generation/test1.c18
4 files changed, 25 insertions, 25 deletions
diff --git a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
index 39141f2..d18ea3d 100644
--- a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
+++ b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java
@@ -929,10 +929,10 @@ public class CMethodBindingEmitter extends FunctionEmitter {
// if this is a pointer to an unsigned type, add unsigned to the name to avoid compiler warnings
if(cArgType.isPointer()) {
- Type typeLast = ((PointerType)cArgType).getLastTargetType();
- if(typeLast.isInt() && (((IntType)typeLast).isPrimitiveUnsigned())) {
- writer.print("unsigned ");
- }
+ Type typeLast = ((PointerType)cArgType).getLastTargetType();
+ if(typeLast.isInt() && (((IntType)typeLast).isPrimitiveUnsigned())) {
+ writer.print("unsigned ");
+ }
}
writer.print(cArgType.getName());
@@ -1058,11 +1058,11 @@ public class CMethodBindingEmitter extends FunctionEmitter {
writer.println(" " + arrayRes + " = (*env)->NewObjectArray(env, " + arrayResLength + ", (*env)->FindClass(env, \"java/nio/ByteBuffer\"), NULL);");
writer.println(" for (" + arrayIdx + " = 0; " + arrayIdx + " < " + arrayResLength + "; " + arrayIdx + "++) {");
Type retType = binding.getCSymbol().getReturnType();
- Type pointerType;
+ Type pointerType;
if (retType.isPointer()) {
- pointerType = retType.asPointer().getTargetType();
+ pointerType = retType.asPointer().getTargetType();
} else {
- pointerType = retType.asArray().getElementType();
+ pointerType = retType.asArray().getElementType();
}
writer.println(" (*env)->SetObjectArrayElement(env, " + arrayRes + ", " + arrayIdx +
", (*env)->NewDirectByteBuffer(env, _res[" + arrayIdx + "], sizeof(" + pointerType.getName() + ")));");
diff --git a/src/java/com/jogamp/gluegen/cgram/types/PointerType.java b/src/java/com/jogamp/gluegen/cgram/types/PointerType.java
index f4811c7..af33f41 100644
--- a/src/java/com/jogamp/gluegen/cgram/types/PointerType.java
+++ b/src/java/com/jogamp/gluegen/cgram/types/PointerType.java
@@ -121,10 +121,10 @@ public class PointerType extends Type implements Cloneable {
}
public Type getLastTargetType() {
- if(targetType.isPointer())
- return ((PointerType)targetType).getLastTargetType();
- else
- return targetType;
+ if(targetType.isPointer())
+ return ((PointerType)targetType).getLastTargetType();
+ else
+ return targetType;
}
@Override
diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java b/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java
index f0db24b..a97430a 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java
+++ b/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java
@@ -560,10 +560,10 @@ public class BaseClass extends JunitTracer {
Assert.assertTrue("Wrong result: "+i, 0==i);
{
- // one 0xff in each byte array
+ // one 0xff in each byte array
// the referenced buffer must be direct, non direct is not supported
- ByteBuffer bbB = Buffers.newDirectByteBuffer(new byte [] {(byte)0xaa, (byte)0xff, (byte)0xba, (byte)0xbe});
- bbB.rewind();
+ ByteBuffer bbB = Buffers.newDirectByteBuffer(new byte [] {(byte)0xaa, (byte)0xff, (byte)0xba, (byte)0xbe});
+ bbB.rewind();
PointerBuffer pbB = newPointerBuffer(Bindingtest1.ARRAY_SIZE, direct);
PointerBuffer pbL = newPointerBuffer(Bindingtest1.ARRAY_SIZE, direct);
for(int j=0; j<Bindingtest1.ARRAY_SIZE; j++) {
@@ -579,8 +579,8 @@ public class BaseClass extends JunitTracer {
long temp = pbL.get();
Assert.assertTrue("Wrong result: "+temp, temp==bbB.capacity());
pbL.rewind();
- i = binding.binaryArrayRead(pbL, pbB, Bindingtest1.ARRAY_SIZE);
- Assert.assertTrue("Wrong result: "+i, Bindingtest1.ARRAY_SIZE==i);
+ i = binding.binaryArrayRead(pbL, pbB, Bindingtest1.ARRAY_SIZE);
+ Assert.assertTrue("Wrong result: "+i, Bindingtest1.ARRAY_SIZE==i);
}
IntBuffer ib = newIntBuffer(3, direct);
diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c
index c1fe41e..fda37f7 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c
+++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c
@@ -237,15 +237,15 @@ MYAPI int MYAPIENTRY stringArrayRead(const char * * strings, int num) {
}
MYAPI int MYAPIENTRY binaryArrayRead(const size_t * lengths, const unsigned char * * binaries, int num) {
- int i, j, n=0;
- for(i=0; i<num; i++) {
- for(j=0; j<lengths[i]; j++) {
- if(0xff==binaries[i][j]) {
- ++n;
- }
- }
- }
- return n;
+ int i, j, n=0;
+ for(i=0; i<num; i++) {
+ for(j=0; j<lengths[i]; j++) {
+ if(0xff==binaries[i][j]) {
+ ++n;
+ }
+ }
+ }
+ return n;
}
MYAPI int MYAPIENTRY intArrayRead(const int * ints, int num) {