summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-04-01 02:57:02 +0200
committerMichael Bien <[email protected]>2010-04-01 02:57:02 +0200
commit82ac66ba1e7494b0a76a2063f0d56d3b785c6c31 (patch)
tree6f2300de71579c1c44931ded562bb355894b866a
parent11e70dff96d23708188bf1c8d7c3ffea3c110d43 (diff)
parentf96bcce55789d2101d594c433aea95806d4eb05c (diff)
Merge branch 'master' of github.com:mbien/gluegen
-rw-r--r--src/java/com/jogamp/common/nio/PointerBuffer.java3
-rwxr-xr-xsrc/java/com/jogamp/common/nio/PointerBufferME_CDC_FP.java2
-rwxr-xr-xsrc/java/com/jogamp/common/nio/PointerBufferSE.java2
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/generation/BaseTest1.java1
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/generation/test1-common.cfg1
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/runtime/TestPointerBufferEndian.java3
6 files changed, 6 insertions, 6 deletions
diff --git a/src/java/com/jogamp/common/nio/PointerBuffer.java b/src/java/com/jogamp/common/nio/PointerBuffer.java
index 26d2e7b..a9b1327 100644
--- a/src/java/com/jogamp/common/nio/PointerBuffer.java
+++ b/src/java/com/jogamp/common/nio/PointerBuffer.java
@@ -117,7 +117,8 @@ public abstract class PointerBuffer extends AbstractLongBuffer {
if(!bb.isDirect()) {
throw new RuntimeException("Buffer is not direct");
}
- long bbAddr = getDirectBufferAddressImpl(bb);
+ long mask = Platform.is32Bit() ? 0x00000000FFFFFFFFL : 0xFFFFFFFFFFFFFFFFL ;
+ long bbAddr = getDirectBufferAddressImpl(bb) & mask;
if(0==bbAddr) {
throw new RuntimeException("Couldn't determine native address of given Buffer: "+bb);
}
diff --git a/src/java/com/jogamp/common/nio/PointerBufferME_CDC_FP.java b/src/java/com/jogamp/common/nio/PointerBufferME_CDC_FP.java
index 6e2c7d9..5f84ffc 100755
--- a/src/java/com/jogamp/common/nio/PointerBufferME_CDC_FP.java
+++ b/src/java/com/jogamp/common/nio/PointerBufferME_CDC_FP.java
@@ -56,7 +56,7 @@ final class PointerBufferME_CDC_FP extends PointerBuffer {
throw new IndexOutOfBoundsException();
}
if (Platform.is32Bit()) {
- return pb.get(idx);
+ return (long) pb.get(idx) & 0x00000000FFFFFFFFL;
} else {
idx = idx << 1; // 8-byte to 4-byte offset
long lo = 0x00000000FFFFFFFFL & ((long) pb.get(idx));
diff --git a/src/java/com/jogamp/common/nio/PointerBufferSE.java b/src/java/com/jogamp/common/nio/PointerBufferSE.java
index 11dc629..04f9ca1 100755
--- a/src/java/com/jogamp/common/nio/PointerBufferSE.java
+++ b/src/java/com/jogamp/common/nio/PointerBufferSE.java
@@ -61,7 +61,7 @@ final class PointerBufferSE extends PointerBuffer {
throw new IndexOutOfBoundsException();
}
if (Platform.is32Bit()) {
- return ((IntBuffer) pb).get(idx);
+ return (long) ((IntBuffer) pb).get(idx) & 0x00000000FFFFFFFFL;
} else {
return ((LongBuffer) pb).get(idx);
}
diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/BaseTest1.java b/src/junit/com/jogamp/gluegen/test/junit/generation/BaseTest1.java
index b689e6d..5a5d17c 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/generation/BaseTest1.java
+++ b/src/junit/com/jogamp/gluegen/test/junit/generation/BaseTest1.java
@@ -307,6 +307,7 @@ public class BaseTest1 {
// System.out.println("lb3: "+lb3);
Assert.assertTrue("Wrong result: "+pb.capacity(), BindingTest1.ARRAY_SIZE == pb.capacity());
Assert.assertTrue("Wrong result: "+pb.remaining(), BindingTest1.ARRAY_SIZE == pb.remaining());
+ Assert.assertNotNull(pb.getReferencedBuffer(0));
Assert.assertTrue("Wrong result: "+pb.getReferencedBuffer(0)+" != "+lb2.getBuffer(), pb.getReferencedBuffer(0).equals(lb2.getBuffer()));
PointerBuffer pb2 = binding.arrayTestFoo3PtrPtr(pb);
diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/test1-common.cfg b/src/junit/com/jogamp/gluegen/test/junit/generation/test1-common.cfg
index 6ba4b78..30cdd96 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1-common.cfg
+++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1-common.cfg
@@ -28,7 +28,6 @@ CustomCCode #include "test1.h"
# Imports needed by all glue code
Import java.nio.*
Import java.util.*
-Import com.jogamp.common.util.*
Import com.jogamp.common.os.*
Import com.jogamp.common.nio.*
diff --git a/src/junit/com/jogamp/gluegen/test/junit/runtime/TestPointerBufferEndian.java b/src/junit/com/jogamp/gluegen/test/junit/runtime/TestPointerBufferEndian.java
index a57fd22..afe3405 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/runtime/TestPointerBufferEndian.java
+++ b/src/junit/com/jogamp/gluegen/test/junit/runtime/TestPointerBufferEndian.java
@@ -33,8 +33,7 @@ public class TestPointerBufferEndian {
int i=0;
while(ptr.hasRemaining()) {
- long mask = Platform.is32Bit() ? 0x00000000FFFFFFFFL : 0xFFFFFFFFFFFFFFFFL ;
- long v = ptr.get() & mask;
+ long v = ptr.get() ;
long t = Platform.is32Bit() ? values32Bit[i] : valuesSource[i];
Assert.assertTrue("Value["+i+"] shall be 0x"+Long.toHexString(t)+", is: 0x"+Long.toHexString(v), t == v);
i++;