X-Git-Url: https://pd.if.org/git/?p=zpackage;a=blobdiff_plain;f=lib%2Fjsw%2Fjsw_atree.c;h=82c24ca81aa1bef809df5b3bfca26d83a29c269b;hp=ff52bcbc0c8933b54072f5ac059eb1585e4320a7;hb=219c3e5d0c097282ac2546ebc0f1c31c9e60fa43;hpb=090abacfef5458a521c154ba735f5b84cea3724d diff --git a/lib/jsw/jsw_atree.c b/lib/jsw/jsw_atree.c index ff52bcb..82c24ca 100644 --- a/lib/jsw/jsw_atree.c +++ b/lib/jsw/jsw_atree.c @@ -16,6 +16,8 @@ #include "jsw.h" #include +#include +#include #ifndef HEIGHT_LIMIT #define HEIGHT_LIMIT 64 /* Tallest allowable tree */ @@ -134,12 +136,12 @@ void jsw_adelete ( jsw_atree_t *tree ) free ( tree ); } -void *jsw_afind ( jsw_atree_t *tree, void *data ) -{ +void *jsw_afind ( jsw_atree_t *tree, void *data) { jsw_anode_t *it = tree->root; + int cmp = 0; while ( it != tree->nil ) { - int cmp = tree->cmp ( it->data, data ); + cmp = tree->cmp(it->data, data); if ( cmp == 0 ) break;