summaryrefslogtreecommitdiff
path: root/sys/src/cmd/venti
diff options
context:
space:
mode:
authorspew <devnull@localhost>2016-12-22 16:47:41 -0600
committerspew <devnull@localhost>2016-12-22 16:47:41 -0600
commit0885ed1e8098c7f1cd54ff528d1b5b56d670e756 (patch)
treecdfa84e209da747006bfcb43404f1251ac78e0fb /sys/src/cmd/venti
parent3bf89ed825835b574c3d1c7f640918e65aac488d (diff)
alv(2): new avl implementation
Diffstat (limited to 'sys/src/cmd/venti')
-rw-r--r--sys/src/cmd/venti/copy.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/src/cmd/venti/copy.c b/sys/src/cmd/venti/copy.c
index db07dcb9d..436ce418a 100644
--- a/sys/src/cmd/venti/copy.c
+++ b/sys/src/cmd/venti/copy.c
@@ -19,7 +19,7 @@ uchar zeroscore[VtScoreSize]; /* all zeros */
typedef struct ScoreTree ScoreTree;
struct ScoreTree
{
- Avl avl;
+ Avl;
uchar score[VtScoreSize];
int type;
};
@@ -51,21 +51,20 @@ havevisited(uchar score[VtScoreSize], int type)
return 0;
memmove(a.score, score, VtScoreSize);
a.type = type;
- return lookupavl(scoretree, &a.avl) != nil;
+ return avllookup(scoretree, &a) != nil;
}
static void
markvisited(uchar score[VtScoreSize], int type)
{
ScoreTree *a;
- Avl *old;
if(scoretree == nil)
return;
a = binalloc(&scorebin, sizeof *a, 1);
memmove(a->score, score, VtScoreSize);
a->type = type;
- insertavl(scoretree, &a->avl, &old);
+ avlinsert(scoretree, a);
}
void
@@ -196,7 +195,7 @@ main(int argc, char *argv[])
ignoreerrors = 1;
break;
case 'm':
- scoretree = mkavltree(scoretreecmp);
+ scoretree = avlcreate(scoretreecmp);
break;
case 'r':
if(ignoreerrors)