commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r787198 - /commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AbstractStructure.java
Date Mon, 22 Jun 2009 11:06:32 GMT
Author: mturk
Date: Mon Jun 22 11:06:31 2009
New Revision: 787198

URL: http://svn.apache.org/viewvc?rev=787198&view=rev
Log:
Calculate alignment for small structs

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AbstractStructure.java

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AbstractStructure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AbstractStructure.java?rev=787198&r1=787197&r2=787198&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AbstractStructure.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AbstractStructure.java
Mon Jun 22 11:06:31 2009
@@ -262,7 +262,19 @@
          throws InvalidStructureElementException
    {
         init();
-        return align;
+        int a = 0;
+        if (count > 0) {
+            if (count > 1) {
+                for (int i = 0; i < count; i++)
+                    if (esizes[i] > align)
+                        return align;
+                    else
+                        a = Math.max(a, esizes[i]);
+            }
+            else
+                a = esizes[0];
+        }
+        return a;
     }
 
     /**



Mime
View raw message