ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/savestr.c
(Generate patch)

Comparing ray/src/common/savestr.c (file contents):
Revision 2.6 by greg, Tue Feb 25 02:47:22 2003 UTC vs.
Revision 2.10 by greg, Thu Mar 4 16:34:34 2004 UTC

# Line 20 | Line 20 | static const char      RCSid[] = "$Id$";
20  
21   #include "copyright.h"
22  
23 + #include <string.h>
24 + #include <stdlib.h>
25 +
26 + #include "rtmisc.h"
27 + #include "rterror.h"
28 + #include "rtio.h"
29 +
30   #ifndef  NHASH
31 < #define  NHASH          509             /* hash table size (prime!) */
31 > #define  NHASH          2039            /* hash table size (prime!) */
32   #endif
33  
34   typedef struct s_head {
# Line 33 | Line 40 | static S_HEAD  *stab[NHASH];
40  
41   #define  hash(s)        (shash(s)%NHASH)
42  
36 extern char  *savestr(), *strcpy(), *malloc();
37
38 #define  NULL           0
39
43   #define  string(sp)     ((char *)((sp)+1))
44  
45   #define  salloc(str)    (S_HEAD *)malloc(sizeof(S_HEAD)+1+strlen(str))
# Line 45 | Line 48 | extern char  *savestr(), *strcpy(), *malloc();
48  
49  
50   char *
51 < savestr(str)                            /* save a string */
49 < char  *str;
51 > savestr(char *str)                              /* save a string */
52   {
53          register int  hval;
54          register S_HEAD  *sp;
# Line 72 | Line 74 | char  *str;
74  
75  
76   void
77 < freestr(s)                              /* free a string */
76 < char  *s;
77 > freestr(char *s)                                /* free a string */
78   {
79          int  hval;
80          register S_HEAD  *spl, *sp;
# Line 96 | Line 97 | char  *s;
97  
98  
99   int
100 < shash(s)
100 < register char  *s;
100 > shash(register char  *s)
101   {
102          register int  h = 0;
103  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines