commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r767948 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/ java/org/apache/commons/runtime/io/ native/shared/
Date Thu, 23 Apr 2009 16:02:26 GMT
Author: mturk
Date: Thu Apr 23 16:02:25 2009
New Revision: 767948

URL: http://svn.apache.org/viewvc?rev=767948&view=rev
Log:
Save one arg in native call

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Platform.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer32.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer64.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java
    commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Platform.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Platform.java?rev=767948&r1=767947&r2=767948&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Platform.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Platform.java Thu
Apr 23 16:02:25 2009
@@ -18,11 +18,12 @@
 
 /**
  * Running Platform version info.
+ * Package private
  *
  * @since Runtime 1.0
  *
  */
-public final class Platform {
+class Platform {
 
     private Platform()
     {

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer32.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer32.java?rev=767948&r1=767947&r2=767948&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer32.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer32.java
Thu Apr 23 16:02:25 2009
@@ -59,24 +59,24 @@
         return new Integer(POINTER);
     }
 
-    private static native int  peek0(int addr, int index);
+    private static native int  peek0(int addr);
 
     public int peek(int index)
         throws IndexOutOfBoundsException
     {
         if (index < 0 || index >= PLENGTH)
             throw new IndexOutOfBoundsException();
-        return peek0(POINTER, index);
+        return peek0(POINTER + index);
     }
 
-    private static native void  poke0(int addr, int index, int b);
+    private static native void  poke0(int addr, int b);
 
     public void poke(int index, int value)
         throws IndexOutOfBoundsException
     {
         if (index < 0 || index >= PLENGTH)
             throw new IndexOutOfBoundsException();
-        poke0(POINTER, index, value);
+        poke0(POINTER + index, value);
     }
 
     public String toString()

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer64.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer64.java?rev=767948&r1=767947&r2=767948&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer64.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer64.java
Thu Apr 23 16:02:25 2009
@@ -59,24 +59,24 @@
         return new Long(POINTER);
     }
 
-    private static native int  peek0(long addr, int index);
+    private static native int  peek0(long addr);
 
     public int peek(int index)
         throws IndexOutOfBoundsException
     {
         if (index < 0 || index >= PLENGTH)
             throw new IndexOutOfBoundsException();
-        return peek0(POINTER, index);
+        return peek0(POINTER + index);
     }
 
-    private static native void  poke0(long addr, int index, int b);
+    private static native void  poke0(long addr, int b);
 
     public void poke(int index, int value)
         throws IndexOutOfBoundsException
     {
         if (index < 0 || index >= PLENGTH)
             throw new IndexOutOfBoundsException();
-        poke0(POINTER, index, value);
+        poke0(POINTER + index, value);
     }
 
     public String toString()

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java?rev=767948&r1=767947&r2=767948&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java Thu
Apr 23 16:02:25 2009
@@ -375,4 +375,8 @@
         return new File(getTargetPath());
     }
 
+    public long fileId()
+    {
+        return 0L;
+    }
 }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c?rev=767948&r1=767947&r2=767948&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c Thu Apr 23 16:02:25 2009
@@ -149,20 +149,20 @@
     }
 }
 
-ACR_PTR_EXPORT_DECLARE(jint, peek0)(ACR_JNISTDARGS, jniptr a, jint i)
+ACR_PTR_EXPORT_DECLARE(jint, peek0)(ACR_JNISTDARGS, jniptr a)
 {
     char *b = (char *)((acr_ptr_t)a);
     UNREFERENCED_STDARGS;
 
-    return b[i];
+    return *b;
 }
 
-ACR_PTR_EXPORT_DECLARE(void, poke0)(ACR_JNISTDARGS, jniptr a, jint i, jint v)
+ACR_PTR_EXPORT_DECLARE(void, poke0)(ACR_JNISTDARGS, jniptr a, jint v)
 {
     char *b = (char *)((acr_ptr_t)a);
     UNREFERENCED_STDARGS;
 
-    b[i] = v;
+    *b = v;
 }
 
 ACR_DECLARE(jobject) ACR_PointerCreate(JNIEnv *_E, void *p, size_t len,



Mime
View raw message