From e388426759e02e15ccc93b9df2e5c0400590d057 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 6 Oct 2011 02:05:22 +0200 Subject: Enhance ReleasePrimitiveArrayCritical: Use mode-flag JNI_ABORT if array is const, ie no write-back We shall consider the C header declaration as being correct and no modification shall happen on const arrays. Tested w/ unit tests and JOGL +++ Cleanup JavaType: final immutable fields, proper CVoidPointer name --- .../gluegen/test/junit/generation/BaseClass.java | 43 +++++++++++++++++++++- .../jogamp/gluegen/test/junit/generation/test1.c | 15 ++++++-- .../jogamp/gluegen/test/junit/generation/test1.h | 7 +++- 3 files changed, 58 insertions(+), 7 deletions(-) (limited to 'src/junit/com') 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 e73aca6..f2a85fe 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java @@ -268,7 +268,7 @@ public class BaseClass { result = binding.arrayTestFooNioOnly(context, lb1); Assert.assertTrue("Wrong result: "+result, 1+8000==result); - // LongBuffer arrayTestFoo2 ( LongBuffer ) + // LongBuffer arrayTestFoo2 ( LongBuffer ) - don't write-back array-arg { lb2.rewind(); LongBuffer lb3 = newLongBuffer(Bindingtest1.ARRAY_SIZE, direct); @@ -290,11 +290,12 @@ public class BaseClass { Assert.assertTrue("Wrong result: "+lbR.remaining(), Bindingtest1.ARRAY_SIZE == lbR.remaining()); int j=0; for(j=0; j %d\n", i, (int)array[i], (int)result[i]); + } +} + +MYAPI foo * * MYAPIENTRY arrayTestFoo3ArrayToPtrPtr(const foo * array) { int j; foo * * result = calloc(ARRAY_SIZE, sizeof(foo *)); for(j=0; j