chiark / gitweb /
@@@ tweak
[xyla] / avl-splitjoin.c
index a66c4d04e33a3d86fdded872fb55df455a397126..151ef2eae9acf9e0c09188b911027889b1fbff6e 100644 (file)
@@ -435,7 +435,7 @@ int xyla_avl_split(struct xyla_bt_nodecls *cls,
       case XYLA_AVLBAL_LBIAS: lht = ht - 1; rht = ht - 2; break;
       case XYLA_AVLBAL_EVEN: lht = rht = ht - 1; break;
       case XYLA_AVLBAL_RBIAS: lht = ht - 2; rht = ht - 1; break;
-      default: XYLA__ASSERT(0);
+      default: XYLA__ASSERT(0); lht = rht = -1; break;
     }
 
     /* Clear the split node's links, so that it's a standalone singleton
@@ -538,7 +538,7 @@ int xyla_avl_split(struct xyla_bt_nodecls *cls,
        case XYLA_AVLBAL_LBIAS: subht = ht - 1; ht++; break;
        case XYLA_AVLBAL_EVEN: subht = ht; ht++; break;
        case XYLA_AVLBAL_RBIAS: subht = ht + 1; ht += 2; break;
-       default: XYLA__ASSERT(0);
+       default: XYLA__ASSERT(0); subht = -1; break;
       }
       xyla_avl_join(cls, &right, &rht,
                    &right, rht, &parent->bt, &sub, subht);
@@ -548,7 +548,7 @@ int xyla_avl_split(struct xyla_bt_nodecls *cls,
        case XYLA_AVLBAL_LBIAS: subht = ht + 1; ht += 2; break;
        case XYLA_AVLBAL_EVEN: subht = ht; ht++; break;
        case XYLA_AVLBAL_RBIAS: subht = ht - 1; ht++; break;
-       default: XYLA__ASSERT(0);
+       default: XYLA__ASSERT(0); subht = -1; break;
       }
       xyla_avl_join(cls, &left, &lht,
                    &sub, subht, &parent->bt, &left, lht);
@@ -639,7 +639,7 @@ int xyla_avl_splitroot(struct xyla_bt_node **left_out, int *lht_out,
        case XYLA_AVLBAL_LBIAS: lht = ht - 1; rht = ht - 2; break;
        case XYLA_AVLBAL_EVEN: lht = rht = ht - 1; break;
        case XYLA_AVLBAL_RBIAS: lht = ht - 2; rht = ht - 1; break;
-       default: XYLA__ASSERT(0);
+       default: XYLA__ASSERT(0); lht = rht = -1; break;
       }
       if (lht_out) *lht_out = lht;
       if (rht_out) *rht_out = rht;