From e4f978fef8c2805413190f356f9101f6cd3a56cc Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Sun, 13 Feb 2011 13:57:31 +0100 Subject: fixed compiler redundant-casts warnings due to language level changes in gluegen-rt. --- src/com/jogamp/opencl/CLBuffer.java | 3 ++- src/com/jogamp/opencl/CLCommandQueue.java | 6 +++--- src/com/jogamp/opencl/CLContext.java | 2 +- src/com/jogamp/opencl/CLDevice.java | 2 +- src/com/jogamp/opencl/CLEventList.java | 1 + src/com/jogamp/opencl/CLProgram.java | 2 +- src/com/jogamp/opencl/gl/CLGLContext.java | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/com/jogamp/opencl/CLBuffer.java b/src/com/jogamp/opencl/CLBuffer.java index d1cb5670..fed7db11 100644 --- a/src/com/jogamp/opencl/CLBuffer.java +++ b/src/com/jogamp/opencl/CLBuffer.java @@ -102,7 +102,7 @@ public class CLBuffer extends CLMemory { B slice = null; if(buffer != null) { - slice = (B)Buffers.slice(buffer, offset, size); + slice = Buffers.slice(buffer, offset, size); int elemSize = Buffers.sizeOfBufferElem(buffer); offset *= elemSize; size *= elemSize; @@ -141,6 +141,7 @@ public class CLBuffer extends CLMemory { /** * Returns the list of subbuffers. */ + @SuppressWarnings("unchecked") public List> getSubBuffers() { if(childs == null) { return Collections.EMPTY_LIST; diff --git a/src/com/jogamp/opencl/CLCommandQueue.java b/src/com/jogamp/opencl/CLCommandQueue.java index a9955797..15fd1480 100644 --- a/src/com/jogamp/opencl/CLCommandQueue.java +++ b/src/com/jogamp/opencl/CLCommandQueue.java @@ -1693,7 +1693,7 @@ public class CLCommandQueue extends CLObject implements CLResource { } private static PointerBuffer copy2NIO(PointerBuffer buffer, long a) { - return (PointerBuffer) buffer.put(2, a).position(2); + return buffer.put(2, a).position(2); } // private static PointerBuffer copy2NIO(PointerBuffer buffer, long a, long b) { @@ -1705,11 +1705,11 @@ public class CLCommandQueue extends CLObject implements CLResource { // } private static PointerBuffer copy2NIO(PointerBuffer buffer, long a, long b) { - return (PointerBuffer) ((PointerBuffer)buffer.position(1)).put(a).put(b).position(1); + return buffer.position(1).put(a).put(b).position(1); } private static PointerBuffer copy2NIO(PointerBuffer buffer, long a, long b, long c) { - return (PointerBuffer) ((PointerBuffer)buffer.rewind()).put(a).put(b).put(c).rewind(); + return buffer.rewind().put(a).put(b).put(c).rewind(); } private static String toStr(PointerBuffer buffer) { diff --git a/src/com/jogamp/opencl/CLContext.java b/src/com/jogamp/opencl/CLContext.java index 240f6d00..a5f4e52e 100644 --- a/src/com/jogamp/opencl/CLContext.java +++ b/src/com/jogamp/opencl/CLContext.java @@ -236,7 +236,7 @@ public class CLContext extends CLObject implements CLResource { throw new RuntimeException("no OpenCL installation found"); } - return (PointerBuffer)PointerBuffer.allocateDirect(3).put(CL.CL_CONTEXT_PLATFORM) + return PointerBuffer.allocateDirect(3).put(CL.CL_CONTEXT_PLATFORM) .put(platform.ID).put(0) // 0 terminated array .rewind(); } diff --git a/src/com/jogamp/opencl/CLDevice.java b/src/com/jogamp/opencl/CLDevice.java index 8d45a116..fd1d93f3 100644 --- a/src/com/jogamp/opencl/CLDevice.java +++ b/src/com/jogamp/opencl/CLDevice.java @@ -354,7 +354,7 @@ public final class CLDevice extends CLObject { } /** - * Returns the maximal allocatable memory on this device. + * Returns the largest allocatable size of a {@link CLBuffer} on this device. */ @CLProperty("CL_DEVICE_MAX_MEM_ALLOC_SIZE") public long getMaxMemAllocSize() { diff --git a/src/com/jogamp/opencl/CLEventList.java b/src/com/jogamp/opencl/CLEventList.java index c20a1f82..03a6f838 100644 --- a/src/com/jogamp/opencl/CLEventList.java +++ b/src/com/jogamp/opencl/CLEventList.java @@ -82,6 +82,7 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable