--- ray/src/common/lookup.c 1998/09/03 14:22:23 2.5 +++ ray/src/common/lookup.c 2003/06/30 14:59:11 2.9 @@ -1,27 +1,25 @@ -/* Copyright (c) 1998 Silicon Graphics, Inc. */ - #ifndef lint -static char SCCSid[] = "$SunId$ SGI"; +static const char RCSid[] = "$Id: lookup.c,v 2.9 2003/06/30 14:59:11 schorsch Exp $"; #endif - /* * Table lookup routines */ +#include "copyright.h" + #include +#include +#include + #include "lookup.h" #ifdef NOSTRUCTASS -#define copystruct(d,s) bcopy((char *)(s),(char *)(d),sizeof(*(d))) +#define copystruct(d,s) memcpy((void *)(d),(void *)(s),sizeof(*(d))) #else #define copystruct(d,s) (*(d) = *(s)) #endif -#define MEM_PTR char * -extern MEM_PTR calloc(); - - int lu_init(tbl, nel) /* initialize tbl for at least nel elements */ register LUTAB *tbl; @@ -138,7 +136,7 @@ tryagain: copystruct(lu_find(tbl,le[ndx].key), &le[ndx]); else if (tbl->freek != NULL) (*tbl->freek)(le[ndx].key); - free((MEM_PTR)le); + free((void *)le); goto tryagain; /* should happen only once! */ } @@ -194,7 +192,7 @@ register LUTAB *tbl; if (tp->data != NULL && tbl->freed != NULL) (*tbl->freed)(tp->data); } - free((MEM_PTR)tbl->tabl); + free((void *)tbl->tabl); tbl->tabl = NULL; tbl->tsiz = 0; tbl->ndel = 0;