more bug fixes
authorbdemsky <bdemsky>
Mon, 19 Oct 2009 06:56:29 +0000 (06:56 +0000)
committerbdemsky <bdemsky>
Mon, 19 Oct 2009 06:56:29 +0000 (06:56 +0000)
Robust/src/Benchmarks/SingleTM/Yada/avltree.java
Robust/src/Benchmarks/SingleTM/Yada/bytereader.java
Robust/src/Benchmarks/SingleTM/Yada/element.java
Robust/src/Benchmarks/SingleTM/Yada/mesh.java
Robust/src/Benchmarks/SingleTM/Yada/region.java

index cb69209c49c6b278d2187c7af416b0193f5b829c..47f43c2b8975a3576ab2423d65ca1191c69a0302 100644 (file)
   int bal = dir == 0 ? -1 : +1;          \
   if ( ni.balance == bal ) {               \
     root.balance = ni.balance = 0;        \
-    jsw_single ( root, 1-dir );             \
+    jsw_single ( root, (1-dir) );         \
   }                                        \
   else { /* n.balance == -bal */          \
     jsw_adjust_balance( root, dir, bal ); \
-    jsw_double( root, 1-dir );             \
+    jsw_double( root, (1-dir) );          \
   }                                        \
 } while (false)
 
     jsw_single ( root, dir );                  \
   }                                            \
   else if ( nr.balance == bal ) {              \
-    jsw_adjust_balance ( root, 1-dir, -bal );   \
+    jsw_adjust_balance ( root, (1-dir), -bal ); \
     jsw_double ( root, dir );                  \
   }                                            \
   else { /* n.balance == 0 */                 \
@@ -258,6 +258,11 @@ public class avltree {
   }
 
   int cmp(Object a, Object b) {
+    if (mode==0) {
+      return element.element_mapCompareEdge((edge)a, (edge)b);
+    } else if (mode==1) {
+      return element.element_mapCompare((edge)a, (edge)b);      
+    }
     return 0;
   }
 
index 0f49ba327a6c3a3ba81e45a7adde56c6897f7cda..0ef91b09859b9258bf229cb5767fdd9d3740f756 100644 (file)
@@ -57,7 +57,9 @@ public class bytereader {
     boolean searching=true;
     while(searching) {
       for(;pos<lastlocation;pos++) {
-       if (buffer[pos]!=' '&&buffer[pos]!='\n'&&buffer[pos]!='\t') {
+       if (buffer[pos]=='#') {
+         jumptonextline();
+       } else if (buffer[pos]!=' '&&buffer[pos]!='\n'&&buffer[pos]!='\t') {
          searching=false;
          break;
        }
index 9cba4e8b9cdba5c5bac7798c14dfee8b0c2c2899..0273981f6bc821e6eb502645a2daadfc16e68420 100644 (file)
@@ -260,7 +260,7 @@ public class element {
  * element_compare
  * =============================================================================
  */
-int element_compare (element aElementPtr, element bElementPtr) {
+static int element_compare (element aElementPtr, element bElementPtr) {
   int aNumCoordinate = aElementPtr.numCoordinate;
   int bNumCoordinate = bElementPtr.numCoordinate;
   coordinate aCoordinates[] = aElementPtr.coordinates;
@@ -304,7 +304,7 @@ int element_compare (element aElementPtr, element bElementPtr) {
  * For use in MAP_T
  * =============================================================================
  */
-  int element_mapCompare(Object aPtr, Object bPtr) {
+  static int element_mapCompare(Object aPtr, Object bPtr) {
     element aElementPtr = (element)(((edge)aPtr).firstPtr);
     element bElementPtr = (element)(((edge)bPtr).firstPtr);
     
@@ -402,7 +402,7 @@ int element_compare (element aElementPtr, element bElementPtr) {
   * For use in MAP_T
  * =============================================================================
  */
-  int element_mapCompareEdge (edge aPtr, edge bPtr) {
+  static int element_mapCompareEdge (edge aPtr, edge bPtr) {
     edge aEdgePtr = (edge)(aPtr.firstPtr);
     edge bEdgePtr = (edge)(bPtr.firstPtr);
     
index 07eb1508e9c7909060a5cdd4fa4c521d2af360df..3037c89fac77b8300dd29fa5d987b840c92f8579 100644 (file)
@@ -313,7 +313,6 @@ int mesh_read(String fileNamePrefix) {
       a=br.getInt();
       b=br.getInt();
       c=br.getInt();
-      br.jumptonextline();
       yada.Assert(a >= 0 && a < numCoordinate);
       yada.Assert(b >= 0 && b < numCoordinate);
       yada.Assert(c >= 0 && c < numCoordinate);
index c6795f404ba8f1b719bed7491ba38249ff24b375..c8947569dd3a3ebca273a3819faa27ff4042a29c 100644 (file)
@@ -239,7 +239,7 @@ public class region {
            edge borderEdgePtr = element.element_getCommonEdge(neighborElementPtr, currentElementPtr);
 
            if (borderEdgePtr==null) {
-             Thread.abort();
+             //              Thread.abort();
            }
            borderListPtr.insert(borderEdgePtr); /* no duplicates */
            if (!edgeMapPtr.contains(borderEdgePtr)) {