commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r820694 - /commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c
Date Thu, 01 Oct 2009 15:44:19 GMT
Author: mturk
Date: Thu Oct  1 15:44:18 2009
New Revision: 820694

URL: http://svn.apache.org/viewvc?rev=820694&view=rev
Log:
Renumber descriptor fields

Modified:
    commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c?rev=820694&r1=820693&r2=820694&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c Thu Oct  1 15:44:18
2009
@@ -51,6 +51,7 @@
     ACR_CLASS_PATH "Descriptor32"
 };
 
+
 J_DECLARE_M_ID(0000) = {
     NULL,
     "<init>",
@@ -61,44 +62,44 @@
 
 J_DECLARE_F_ID(0000) = {
     NULL,
-    "IHANDLE",
+    "ISVALID",
     "I"
 };
 
 J_DECLARE_F_ID(0001) = {
     NULL,
-    "PHANDLE",
-    IFIELD_PTR
+    "IHANDLE",
+    "I"
 };
 
 J_DECLARE_F_ID(0002) = {
     NULL,
-    "HANDLER",
+    "PHANDLE",
     IFIELD_PTR
 };
 
 J_DECLARE_F_ID(0003) = {
     NULL,
-    "IERRNUM",
-    "I"
+    "HANDLER",
+    IFIELD_PTR
 };
 
 J_DECLARE_F_ID(0004) = {
     NULL,
-    "IDFLAGS",
+    "IERRNUM",
     "I"
 };
 
 J_DECLARE_F_ID(0005) = {
     NULL,
-    "CONTEXT",
-    "Ljava/lang/Object;"
+    "IDFLAGS",
+    "I"
 };
 
 J_DECLARE_F_ID(0006) = {
     NULL,
-    "ISVALID",
-    "I"
+    "CONTEXT",
+    "Ljava/lang/Object;"
 };
 
 ACR_CLASS_LDEF(Descriptor)
@@ -147,7 +148,7 @@
     }
     nd = ACR_DescriptorCreate(_E, 0, -1, NULL, NULL);
     if (nd && _clazzn.i && J4MID(0000)) {
-        SET_IFIELD_I(0003, nd, ACR_EBADF);
+        SET_IFIELD_I(0004, nd, ACR_EBADF);
     }
     return nd;
 }
@@ -158,18 +159,18 @@
         acr_descriptor_cb_t cb;
         acr_descriptor_handler_fn_t *handler;
 
-        cb.di   = GET_IFIELD_I(0000, _O);
-        cb.dp   = GET_IFIELD_V(0001, _O, void *);
-        handler = GET_IFIELD_V(0002, _O, acr_descriptor_handler_fn_t *);
+        cb.di   = GET_IFIELD_I(0001, _O);
+        cb.dp   = GET_IFIELD_V(0002, _O, void *);
+        handler = GET_IFIELD_V(0003, _O, acr_descriptor_handler_fn_t *);
 
+        SET_IFIELD_I(0000, _O, 0);
         if (cb.dp) {
-            SET_IFIELD_P(0001, _O, NULL);
+            SET_IFIELD_P(0002, _O, NULL);
         }
-        SET_IFIELD_I(0006, _O, 0);
         if (handler) {
             int rc;
             cb.thiz = _O;
-            cb.data = GET_IFIELD_O(0005, _O);
+            cb.data = GET_IFIELD_O(0006, _O);
             if ((rc = (*handler)(_E, _O, ACR_DESC_CLOSE, &cb))) {
                 /* Throw IOException with errno message */
                 ACR_ThrowException(_E, THROW_FMARK, ACR_EX_EIO, rc);
@@ -186,19 +187,19 @@
         acr_descriptor_cb_t cb;
         acr_descriptor_handler_fn_t *handler;
 
-        cb.di   = GET_IFIELD_I(0000, _O);
-        cb.dp   = GET_IFIELD_V(0001, _O, void *);
-        handler = GET_IFIELD_V(0002, _O, acr_descriptor_handler_fn_t *);
+        cb.di   = GET_IFIELD_I(0001, _O);
+        cb.dp   = GET_IFIELD_V(0002, _O, void *);
+        handler = GET_IFIELD_V(0003, _O, acr_descriptor_handler_fn_t *);
 
         if (cb.di >= 0) {
-            SET_IFIELD_I(0000, _O, -1);
+            SET_IFIELD_I(0001, _O, -1);
         }
         if (cb.dp) {
-            SET_IFIELD_P(0001, _O, NULL);
+            SET_IFIELD_P(0002, _O, NULL);
         }
         if (handler) {
             cb.thiz = _O;
-            cb.data = GET_IFIELD_O(0005, _O);
+            cb.data = GET_IFIELD_O(0006, _O);
             (*handler)(_E, _O, ACR_DESC_FINALIZE, &cb);
         }
     }
@@ -210,14 +211,14 @@
         acr_descriptor_cb_t cb;
         acr_descriptor_handler_fn_t *handler;
 
-        cb.di   = GET_IFIELD_I(0000, _O);
-        cb.dp   = GET_IFIELD_V(0001, _O, void *);
-        handler = GET_IFIELD_V(0002, _O, acr_descriptor_handler_fn_t *);
+        cb.di   = GET_IFIELD_I(0001, _O);
+        cb.dp   = GET_IFIELD_V(0002, _O, void *);
+        handler = GET_IFIELD_V(0003, _O, acr_descriptor_handler_fn_t *);
 
         if (handler) {
             int rc;
             cb.thiz = _O;
-            cb.data = GET_IFIELD_O(0005, _O);
+            cb.data = GET_IFIELD_O(0006, _O);
             if ((rc = (*handler)(_E, _O, ACR_DESC_SYNC, &cb))) {
                 if (rc == ACR_EINVAL)
                     ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESYNC, 0);
@@ -237,14 +238,14 @@
         acr_descriptor_cb_t cb;
         acr_descriptor_handler_fn_t *handler;
 
-        cb.di   = GET_IFIELD_I(0000, _O);
-        cb.dp   = GET_IFIELD_V(0001, _O, void *);
-        handler = GET_IFIELD_V(0002, _O, acr_descriptor_handler_fn_t *);
+        cb.di   = GET_IFIELD_I(0001, _O);
+        cb.dp   = GET_IFIELD_V(0002, _O, void *);
+        handler = GET_IFIELD_V(0003, _O, acr_descriptor_handler_fn_t *);
 
         if (handler) {
             int rc;
             cb.thiz = _O;
-            cb.data = GET_IFIELD_O(0005, _O);
+            cb.data = GET_IFIELD_O(0006, _O);
             if ((rc = (*handler)(_E, _O, ACR_DESC_FLUSH, &cb))) {
                 if (rc == ACR_EINVAL)
                     ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESYNC, 0);
@@ -279,12 +280,13 @@
             /* Object locking failed */
             return ACR_ENOLOCK;
         }
-        SET_IFIELD_I(0000, dp, i);
-        SET_IFIELD_P(0001, dp, p);
-        SET_IFIELD_P(0002, dp, c);
-        SET_IFIELD_I(0003, dp, 0);
-        SET_IFIELD_I(0004, dp, f);
-        SET_IFIELD_O(0005, dp, NULL);
+        SET_IFIELD_I(0000, dp, 1);
+        SET_IFIELD_I(0001, dp, i);
+        SET_IFIELD_P(0002, dp, p);
+        SET_IFIELD_P(0003, dp, c);
+        SET_IFIELD_I(0004, dp, 0);
+        SET_IFIELD_I(0005, dp, f);
+        SET_IFIELD_O(0006, dp, NULL);
 
         (*_E)->MonitorExit(_E, dp);
         return ACR_SUCCESS;
@@ -304,24 +306,24 @@
             /* Object locking failed */
             return ACR_ENOLOCK;
         }
-        cb.di   = GET_IFIELD_I(0000, _O);
-        cb.dp   = GET_IFIELD_V(0001, _O, void *);
-        handler = GET_IFIELD_V(0002, _O, acr_descriptor_handler_fn_t *);
+        cb.di   = GET_IFIELD_I(0001, _O);
+        cb.dp   = GET_IFIELD_V(0002, _O, void *);
+        handler = GET_IFIELD_V(0003, _O, acr_descriptor_handler_fn_t *);
         if (cb.di >= 0) {
-            SET_IFIELD_I(0000, _O, -1);
+            SET_IFIELD_I(0001, _O, -1);
         }
         if (cb.dp) {
-            SET_IFIELD_P(0001, _O, NULL);
+            SET_IFIELD_P(0002, _O, NULL);
         }
         if (handler) {
-            SET_IFIELD_P(0002, _O, NULL);
+            SET_IFIELD_P(0003, _O, NULL);
         }
         (*_E)->MonitorExit(_E, _O);
 
         if (handler) {
             cb.thiz = _O;
-            cb.data = GET_IFIELD_O(0005, _O);
-            return (*handler)(_E, _O, ACR_DESC_CLOSE, &cb);
+            cb.data = GET_IFIELD_O(0006, _O);
+            return (*handler)(_E, _O, ACR_DESC_FINALIZE, &cb);
         }
         else {
             /* Already cleared */
@@ -339,12 +341,13 @@
             /* Object locking failed */
             return ACR_ENOLOCK;
         }
-        SET_IFIELD_I(0000, _O, -1);
-        SET_IFIELD_P(0001, _O, NULL);
+        SET_IFIELD_I(0000, _O, 0);
+        SET_IFIELD_I(0001, _O, -1);
         SET_IFIELD_P(0002, _O, NULL);
-        SET_IFIELD_I(0003, _O, 0);
+        SET_IFIELD_P(0003, _O, NULL);
         SET_IFIELD_I(0004, _O, 0);
-        SET_IFIELD_O(0005, _O, NULL);
+        SET_IFIELD_I(0005, _O, 0);
+        SET_IFIELD_O(0006, _O, NULL);
 
         (*_E)->MonitorExit(_E, _O);
         return ACR_SUCCESS;
@@ -356,7 +359,7 @@
 ACR_DECLARE(void *) ACR_DescriptorGetPtr(ACR_JNISTDARGS)
 {
     if (_clazzn.i && J4MID(0000)) {
-        return GET_IFIELD_V(0001, _O, void *);
+        return GET_IFIELD_V(0002, _O, void *);
     }
     else {
         ACR_SET_OS_ERROR(ACR_ECLASSNOTFOUND);
@@ -367,7 +370,7 @@
 ACR_DECLARE(int) ACR_DescriptorGetInt(ACR_JNISTDARGS)
 {
     if (_clazzn.i && J4MID(0000)) {
-        return GET_DFIELD_I(0000, _O, -1);
+        return GET_DFIELD_I(0001, _O, -1);
     }
     else {
         ACR_SET_OS_ERROR(ACR_ECLASSNOTFOUND);
@@ -378,7 +381,7 @@
 ACR_DECLARE(int) ACR_DescriptorGetErr(ACR_JNISTDARGS)
 {
     if (_clazzn.i && J4MID(0000)) {
-        return GET_IFIELD_I(0003, _O);
+        return GET_IFIELD_I(0004, _O);
     }
     else {
         ACR_SET_OS_ERROR(ACR_ECLASSNOTFOUND);
@@ -389,7 +392,7 @@
 ACR_DECLARE(int) ACR_DescriptorFlags(ACR_JNISTDARGS)
 {
     if (_clazzn.i && J4MID(0000)) {
-        return GET_IFIELD_I(0004, _O);
+        return GET_IFIELD_I(0005, _O);
     }
     else {
         ACR_SET_OS_ERROR(ACR_ECLASSNOTFOUND);
@@ -404,7 +407,7 @@
             /* Object locking failed */
             return ACR_ENOLOCK;
         }
-        SET_IFIELD_P(0001, _O, p);
+        SET_IFIELD_P(0002, _O, p);
         (*_E)->MonitorExit(_E, _O);
         return ACR_SUCCESS;
     }
@@ -420,7 +423,7 @@
             /* Object locking failed */
             return ACR_ENOLOCK;
         }
-        SET_IFIELD_I(0000, _O, i);
+        SET_IFIELD_I(0001, _O, i);
         (*_E)->MonitorExit(_E, _O);
         return ACR_SUCCESS;
     }
@@ -432,7 +435,7 @@
 ACR_DECLARE(int) ACR_DescriptorSetErr(ACR_JNISTDARGS, int e)
 {
     if (_clazzn.i && J4MID(0000)) {
-        SET_IFIELD_I(0003, _O, e);
+        SET_IFIELD_I(0004, _O, e);
         return ACR_SUCCESS;
     }
     else {
@@ -443,7 +446,7 @@
 ACR_DECLARE(int) ACR_DescriptorSetCtx(ACR_JNISTDARGS, jobject ctx)
 {
     if (_clazzn.i && J4MID(0000)) {
-        SET_IFIELD_O(0005, _O, ctx);
+        SET_IFIELD_O(0006, _O, ctx);
         return ACR_SUCCESS;
     }
     else {
@@ -454,7 +457,7 @@
 ACR_DECLARE(jobject) ACR_DescriptorGetCtx(ACR_JNISTDARGS)
 {
     if (_clazzn.i && J4MID(0000)) {
-        return GET_IFIELD_O(0005, _O);
+        return GET_IFIELD_O(0006, _O);
     }
     else {
         ACR_SET_OS_ERROR(ACR_ECLASSNOTFOUND);



Mime
View raw message