--- ray/src/common/savestr.c 2003/02/25 02:47:22 2.6 +++ ray/src/common/savestr.c 2004/03/04 16:34:34 2.10 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: savestr.c,v 2.6 2003/02/25 02:47:22 greg Exp $"; +static const char RCSid[] = "$Id: savestr.c,v 2.10 2004/03/04 16:34:34 greg Exp $"; #endif /* * savestr.c - routines for efficient string storage. @@ -20,8 +20,15 @@ static const char RCSid[] = "$Id: savestr.c,v 2.6 2003 #include "copyright.h" +#include +#include + +#include "rtmisc.h" +#include "rterror.h" +#include "rtio.h" + #ifndef NHASH -#define NHASH 509 /* hash table size (prime!) */ +#define NHASH 2039 /* hash table size (prime!) */ #endif typedef struct s_head { @@ -33,10 +40,6 @@ static S_HEAD *stab[NHASH]; #define hash(s) (shash(s)%NHASH) -extern char *savestr(), *strcpy(), *malloc(); - -#define NULL 0 - #define string(sp) ((char *)((sp)+1)) #define salloc(str) (S_HEAD *)malloc(sizeof(S_HEAD)+1+strlen(str)) @@ -45,8 +48,7 @@ extern char *savestr(), *strcpy(), *malloc(); char * -savestr(str) /* save a string */ -char *str; +savestr(char *str) /* save a string */ { register int hval; register S_HEAD *sp; @@ -72,8 +74,7 @@ char *str; void -freestr(s) /* free a string */ -char *s; +freestr(char *s) /* free a string */ { int hval; register S_HEAD *spl, *sp; @@ -96,8 +97,7 @@ char *s; int -shash(s) -register char *s; +shash(register char *s) { register int h = 0;