diff options
author | Sven Gothel <[email protected]> | 2010-04-01 01:15:31 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-04-01 01:15:31 +0200 |
commit | f96bcce55789d2101d594c433aea95806d4eb05c (patch) | |
tree | 50ef20f645529096c2ddcee93e21e52273e5cfde /src/java/com/jogamp/common | |
parent | fdb14c0c37a9e434b302b7d7dd3c6dbc52c02bb5 (diff) |
Fix 32bit masking / tests
Diffstat (limited to 'src/java/com/jogamp/common')
-rw-r--r-- | src/java/com/jogamp/common/nio/PointerBuffer.java | 3 | ||||
-rwxr-xr-x | src/java/com/jogamp/common/nio/PointerBufferME_CDC_FP.java | 2 | ||||
-rwxr-xr-x | src/java/com/jogamp/common/nio/PointerBufferSE.java | 2 |
3 files changed, 4 insertions, 3 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); } |