--- ray/src/cv/mgflib/lookup.c 1998/09/04 09:05:09 1.7 +++ ray/src/cv/mgflib/lookup.c 2003/07/27 22:12:02 1.9 @@ -1,23 +1,19 @@ -/* Copyright (c) 1994 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: lookup.c,v 1.9 2003/07/27 22:12:02 schorsch Exp $"; #endif - /* * Table lookup routines */ #include +#include #include "lookup.h" #ifndef MEM_PTR #define MEM_PTR void * #endif -extern MEM_PTR calloc(); - int lu_init(tbl, nel) /* initialize tbl for at least nel elements */ register LUTAB *tbl; @@ -129,11 +125,12 @@ tryagain: * recursive call to lu_find(). */ while (ndx--) - if (le[ndx].key != NULL) + if (le[ndx].key != NULL) { if (le[ndx].data != NULL) *lu_find(tbl, le[ndx].key) = le[ndx]; else if (tbl->freek != NULL) (*tbl->freek)(le[ndx].key); + } free((MEM_PTR)le); goto tryagain; /* should happen only once! */ }