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 */ \
}
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;
}
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;
}
* 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;
* 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);
* 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);
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);
edge borderEdgePtr = element.element_getCommonEdge(neighborElementPtr, currentElementPtr);
if (borderEdgePtr==null) {
- Thread.abort();
+ // Thread.abort();
}
borderListPtr.insert(borderEdgePtr); /* no duplicates */
if (!edgeMapPtr.contains(borderEdgePtr)) {