harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlyd...@apache.org
Subject svn commit: r330922 - /incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/classfile.c
Date Fri, 04 Nov 2005 21:40:24 GMT
Author: dlydick
Date: Fri Nov  4 13:40:16 2005
New Revision: 330922

URL: http://svn.apache.org/viewcvs?rev=330922&view=rev
Log:
Split out pointer autoincrement from GETRS2() macro invocations
so as to remove possible errors should that macro reference its
parameter more than once.  Currently the implementation will not
result in any functional changes, but this removes a hazard for
long term maintenance.

Modified:
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/classfile.c

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/classfile.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/classfile.c?rev=330922&r1=330921&r2=330922&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/classfile.c
(original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/classfile.c
Fri Nov  4 13:40:16 2005
@@ -434,6 +434,7 @@
     MAKE_PU2(pu2, pu4);
 
     pcfs->minor_version = GETRS2(pu2);
+    pu2++;                   /* calc offset to next field in file data*/
 
     /*!
      * @todo HARMONY-6-jvm-classfile.c-7
@@ -445,8 +446,6 @@
               "minor=%d",
               pcfs->minor_version);
 
-    pu2++;                   /* calc offset to next field in file data*/
-
 
     /*****************************************************************/
     /* Get major class file version                                  */
@@ -455,7 +454,8 @@
     /* Can optimize along the way-- pu2 already points here */
     /* MAKE_PU2(pu2, pu2); */
 
-    pcfs->major_version = GETRS2(pu2++);
+    pcfs->major_version = GETRS2(pu2);
+    pu2++;
 
     sysDbgMsg(DMLNORM,
               arch_function_name,
@@ -492,7 +492,8 @@
     /*****************************************************************/
     /* Get constant_pool_count                                       */
     /*****************************************************************/
-    pcfs->constant_pool_count = GETRS2(pu2++);
+    pcfs->constant_pool_count = GETRS2(pu2);
+    pu2++;
 
     sysDbgMsg(DMLNORM,
               arch_function_name,
@@ -870,7 +871,9 @@
     /* Point past the @c @b constant_pool[] area */
     MAKE_PU2(pu2, pcpbytes);
 
-    pcfs->access_flags = GETRS2(pu2++);
+    pcfs->access_flags = GETRS2(pu2);
+    pu2++;
+
     /*
      * Strip out all other @link #ACC_PUBLIC ACC_xxx@endlink bits, per
      * spec
@@ -896,7 +899,8 @@
     /*****************************************************************/
     /* Get this_class                                                */
     /*****************************************************************/
-    pcfs->this_class = GETRS2(pu2++);
+    pcfs->this_class = GETRS2(pu2);
+    pu2++;
 
     /*!
      * @todo HARMONY-6-jvm-classfile.c-11 Need to
@@ -912,7 +916,8 @@
     /*****************************************************************/
     /* Get super_class                                               */
     /*****************************************************************/
-    pcfs->super_class = GETRS2(pu2++);
+    pcfs->super_class = GETRS2(pu2);
+    pu2++;
 
     /*!
      * @todo HARMONY-6-jvm-classfile.c-12
@@ -925,7 +930,8 @@
     /*****************************************************************/
     /* Create interfaces index, then load up interfaces array        */
     /*****************************************************************/
-    pcfs->interfaces_count = GETRS2(pu2++);
+    pcfs->interfaces_count = GETRS2(pu2);
+    pu2++;
 
     sysDbgMsg(DMLNORM,
               arch_function_name,
@@ -961,7 +967,8 @@
         for (ifidx = 0; ifidx < pcfs->interfaces_count; ifidx++)
         {
             /* Retrieve next interface index from class file area */
-            jvm_interface_index cfifidx = GETRS2(pu2++);
+            jvm_interface_index cfifidx = GETRS2(pu2);
+            pu2++;
 
             /* Range check the index value */
             CPIDX_RANGE_CHECK(pcfs,
@@ -1013,7 +1020,8 @@
     /*****************************************************************/
     /* Get field_count                                               */
     /*****************************************************************/
-    pcfs->fields_count = GETRS2(pu2++);
+    pcfs->fields_count = GETRS2(pu2);
+    pu2++;
 
     /*!
      * @todo HARMONY-6-jvm-classfile.c-15
@@ -1155,7 +1163,8 @@
     /* Point past end of fields area */
     MAKE_PU2(pu2, pfbytes);
 
-    pcfs->methods_count =  GETRS2(pu2++);
+    pcfs->methods_count =  GETRS2(pu2);
+    pu2++;
 
     /*!
      * @todo HARMONY-6-jvm-classfile.c-16
@@ -1359,7 +1368,8 @@
     /* Point past end of methods area */
     MAKE_PU2(pu2, pmbytes);
 
-    pcfs->attributes_count = GETRS2(pu2++);
+    pcfs->attributes_count = GETRS2(pu2);
+    pu2++;
 
     /*!
      * @todo HARMONY-6-jvm-classfile.c-17



Mime
View raw message