summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/CLBuffer.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:35:47 +0200
committerSven Gothel <[email protected]>2014-07-03 16:35:47 +0200
commita90ee128ce0550cd05f969d0283312c2f42b8254 (patch)
treedade644101970d8f69ea3845db310499f2b66a76 /src/com/jogamp/opencl/CLBuffer.java
parenta0e0c8a39d0ef41ff6b64d9b40d058f21b786e81 (diff)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
Diffstat (limited to 'src/com/jogamp/opencl/CLBuffer.java')
-rw-r--r--src/com/jogamp/opencl/CLBuffer.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/com/jogamp/opencl/CLBuffer.java b/src/com/jogamp/opencl/CLBuffer.java
index 56cbccda..21338b05 100644
--- a/src/com/jogamp/opencl/CLBuffer.java
+++ b/src/com/jogamp/opencl/CLBuffer.java
@@ -48,16 +48,16 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
private List<CLSubBuffer<B>> childs;
- protected CLBuffer(CLContext context, long size, long id, int flags) {
+ protected CLBuffer(final CLContext context, final long size, final long id, final int flags) {
this(context, null, size, id, flags);
}
- protected CLBuffer(CLContext context, B directBuffer, long size, long id, int flags) {
+ protected CLBuffer(final CLContext context, final B directBuffer, final long size, final long id, final int flags) {
super(context, directBuffer, size, id, flags);
}
@SuppressWarnings("rawtypes")
- static CLBuffer<?> create(CLContext context, int size, int flags) {
+ static CLBuffer<?> create(final CLContext context, final int size, final int flags) {
if(isHostPointerFlag(flags)) {
throw new IllegalArgumentException("no host pointer defined");
@@ -71,7 +71,7 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
return new CLBuffer(context, size, id, flags);
}
- static <B extends Buffer> CLBuffer<B> create(CLContext context, B directBuffer, int flags) {
+ static <B extends Buffer> CLBuffer<B> create(final CLContext context, final B directBuffer, final int flags) {
if(!directBuffer.isDirect())
throw new IllegalArgumentException("buffer is not direct");
@@ -81,10 +81,10 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
host_ptr = directBuffer;
}
- CLBufferBinding binding = context.getPlatform().getBufferBinding();
- int[] result = new int[1];
- int size = Buffers.sizeOfBufferElem(directBuffer) * directBuffer.capacity();
- long id = binding.clCreateBuffer(context.ID, flags, size, host_ptr, result, 0);
+ final CLBufferBinding binding = context.getPlatform().getBufferBinding();
+ final int[] result = new int[1];
+ final int size = Buffers.sizeOfBufferElem(directBuffer) * directBuffer.capacity();
+ final long id = binding.clCreateBuffer(context.ID, flags, size, host_ptr, result, 0);
CLException.checkForError(result[0], "can not create cl buffer");
return new CLBuffer<B>(context, directBuffer, size, id, flags);
@@ -99,12 +99,12 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
* @param offset The offset in buffer elements.
* @param size The size in buffer elements.
*/
- public CLSubBuffer<B> createSubBuffer(int offset, int size, Mem... flags) {
+ public CLSubBuffer<B> createSubBuffer(int offset, int size, final Mem... flags) {
final B slice;
if(buffer != null) {
slice = Buffers.slice(buffer, offset, size);
- int elemSize = Buffers.sizeOfBufferElem(buffer);
+ final int elemSize = Buffers.sizeOfBufferElem(buffer);
offset *= elemSize;
size *= elemSize;
} else {
@@ -139,7 +139,7 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
super.release();
}
- void onReleaseSubBuffer(CLSubBuffer<?> sub) {
+ void onReleaseSubBuffer(final CLSubBuffer<?> sub) {
childs.remove(sub);
}
@@ -163,7 +163,7 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
}
@Override
- public <T extends Buffer> CLBuffer<T> cloneWith(T directBuffer) {
+ public <T extends Buffer> CLBuffer<T> cloneWith(final T directBuffer) {
return new CLBuffer<T>(context, directBuffer, size, ID, FLAGS);
}