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/04/23 18:31:47 UTC

svn commit: r767964 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/ native/os/darwin/ native/os/hpux/ native/os/linux/ native/os/solaris/ native/os/win32/

Author: mturk
Date: Thu Apr 23 16:31:46 2009
New Revision: 767964

URL: http://svn.apache.org/viewvc?rev=767964&view=rev
Log:
Ace getDataModel native

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OS.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java
    commons/sandbox/runtime/trunk/src/main/native/os/darwin/os.c
    commons/sandbox/runtime/trunk/src/main/native/os/hpux/os.c
    commons/sandbox/runtime/trunk/src/main/native/os/linux/os.c
    commons/sandbox/runtime/trunk/src/main/native/os/solaris/os.c
    commons/sandbox/runtime/trunk/src/main/native/os/win32/os.c

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OS.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OS.java?rev=767964&r1=767963&r2=767964&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OS.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OS.java Thu Apr 23 16:31:46 2009
@@ -79,6 +79,9 @@
     /**
      * Data model (32 or 64 bit).
      */
-    public static native int getDataModel();
+    public static int getDataModel()
+    {
+        return Platform.DATA_MODEL;
+    }
 
 }

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java?rev=767964&r1=767963&r2=767964&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java Thu Apr 23 16:31:46 2009
@@ -42,7 +42,7 @@
     /**
      * Size in bytes of the storage needed to represent the Pointer.
      */
-    public static final int SIZEOF = OS.getDataModel() == 64 ? 8 : 4;
+    public static final int SIZEOF = Platform.SIZEOF_POINTER;
 
     /**
      * Address of the internal pointer.

Modified: commons/sandbox/runtime/trunk/src/main/native/os/darwin/os.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/darwin/os.c?rev=767964&r1=767963&r2=767964&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/darwin/os.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/darwin/os.c Thu Apr 23 16:31:46 2009
@@ -114,13 +114,3 @@
         return CSTR_TO_JSTRING(string);
 }
 
-ACR_JNI_EXPORT_DECLARE(jint, OS, getDataModel)(ACR_JNISTDARGS)
-{
-    UNREFERENCED_STDARGS;
-#if CC_SIZEOF_VOIDP == 8
-    return 64;
-#else
-    return 32;
-#endif
-}
-

Modified: commons/sandbox/runtime/trunk/src/main/native/os/hpux/os.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/hpux/os.c?rev=767964&r1=767963&r2=767964&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/hpux/os.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/hpux/os.c Thu Apr 23 16:31:46 2009
@@ -103,13 +103,3 @@
         return CSTR_TO_JSTRING(unknown);
 }
 
-ACR_JNI_EXPORT_DECLARE(jint, OS, getDataModel)(ACR_JNISTDARGS)
-{
-    UNREFERENCED_STDARGS;
-#if CC_SIZEOF_VOIDP == 8
-    return 64;
-#else
-    return 32;
-#endif
-}
-

Modified: commons/sandbox/runtime/trunk/src/main/native/os/linux/os.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/linux/os.c?rev=767964&r1=767963&r2=767964&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/linux/os.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/linux/os.c Thu Apr 23 16:31:46 2009
@@ -105,12 +105,3 @@
     return CSTR_TO_JSTRING(unknown);
 }
 
-ACR_JNI_EXPORT_DECLARE(jint, OS, getDataModel)(ACR_JNISTDARGS)
-{
-    UNREFERENCED_STDARGS;
-#if CC_SIZEOF_VOIDP == 8
-    return 64;
-#else
-    return 32;
-#endif
-}

Modified: commons/sandbox/runtime/trunk/src/main/native/os/solaris/os.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/solaris/os.c?rev=767964&r1=767963&r2=767964&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/solaris/os.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/solaris/os.c Thu Apr 23 16:31:46 2009
@@ -92,12 +92,3 @@
         return CSTR_TO_JSTRING(string);
 }
 
-ACR_JNI_EXPORT_DECLARE(jint, OS, getDataModel)(ACR_JNISTDARGS)
-{
-    UNREFERENCED_STDARGS;
-#if CC_SIZEOF_VOIDP == 8
-    return 64;
-#else
-    return 32;
-#endif
-}

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/os.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/os.c?rev=767964&r1=767963&r2=767964&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/os.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/os.c Thu Apr 23 16:31:46 2009
@@ -237,12 +237,3 @@
     return CSTR_TO_JSTRING(buf);
 }
 
-ACR_JNI_EXPORT_DECLARE(jint, OS, getDataModel)(ACR_JNISTDARGS)
-{
-    UNREFERENCED_STDARGS;
-#if CC_SIZEOF_VOIDP == 8
-    return 64;
-#else
-    return 32;
-#endif
-}