You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/12/07 07:40:07 UTC

svn commit: r887849 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/ConstPointer.java java/org/apache/commons/runtime/DirectBuffer.java native/test/testcase.c

Author: mturk
Date: Mon Dec  7 06:40:06 2009
New Revision: 887849

URL: http://svn.apache.org/viewvc?rev=887849&view=rev
Log:
Remaining of the 32/64 class fixes

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ConstPointer.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/DirectBuffer.java
    commons/sandbox/runtime/trunk/src/main/native/test/testcase.c

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ConstPointer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ConstPointer.java?rev=887849&r1=887848&r2=887849&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ConstPointer.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ConstPointer.java Mon Dec  7 06:40:06 2009
@@ -17,12 +17,30 @@
 package org.apache.commons.runtime;
 
 /**
- * Represents the {@code const} Pointer.
+ * Represents the Operating System C/C++ const pointer.
  *
  * @since Runtime 1.0
  */
-public interface ConstPointer extends Pointer
+@Const
+final class ConstPointer extends Pointer
 {
 
+    private ConstPointer()
+    {
+        // No instance
+        ISCONST = true;
+    }
+
+    /*
+     * Only created from JNI code.
+     */
+    private ConstPointer(long ptr, long clr, long len)
+    {
+        POINTER = ptr;
+        CLEANUP = clr;
+        PLENGTH = len;
+        ISCONST = true;
+    }
+
 }
 

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/DirectBuffer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/DirectBuffer.java?rev=887849&r1=887848&r2=887849&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/DirectBuffer.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/DirectBuffer.java Mon Dec  7 06:40:06 2009
@@ -16,15 +16,30 @@
 
 package org.apache.commons.runtime;
 
-/**
- * Represents the {@code Pointer} as buffer.
- *
+/** Represents the Operating System C/C++ pointer.
+ * <p>
+ * <b>Warning:</b><br/>Using this class improperly may crash the running JVM.
+ * </p>
  * @since Runtime 1.0
  */
-public interface DirectBuffer extends Pointer
+public final class DirectBuffer extends Pointer
 {
 
-
+    private DirectBuffer()
+    {
+        // No instance
+    }
+
+    /*
+     * Only created from JNI code.
+     */
+    private DirectBuffer(long ptr, long clr, long len)
+    {
+        POINTER = ptr;
+        CLEANUP = clr;
+        PLENGTH = len;
+        ISCONST = false;
+    }
 
 }
 

Modified: commons/sandbox/runtime/trunk/src/main/native/test/testcase.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/test/testcase.c?rev=887849&r1=887848&r2=887849&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/test/testcase.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/test/testcase.c Mon Dec  7 06:40:06 2009
@@ -237,11 +237,11 @@
     return a;
 }
 
-ACR_CLASS_LDEC(AbstractPointer);
+ACR_CLASS_LDEC(GenericPointer);
 
 ACR_JNI_EXPORT_DECLARE(jint, TestPrivate, test016)(ACR_JNISTDARGS, jint d)
 {
-    ACR_CLASS_LRUN(AbstractPointer);
+    ACR_CLASS_LRUN(GenericPointer);
     return 0;
 }