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

Comparing ray/src/common/caldefn.c (file contents):
Revision 2.4 by greg, Mon Sep 21 12:01:44 1992 UTC vs.
Revision 2.5 by greg, Sat Nov 21 21:42:42 1992 UTC

# Line 34 | Line 34 | static char SCCSid[] = "$SunId$ LBL";
34   #define  NHASH          521             /* hash size (a prime!) */
35   #endif
36  
37 + #define  hash(s)        (shash(s)%NHASH)
38 +
39   #define  newnode()      (EPNODE *)ecalloc(1, sizeof(EPNODE))
40  
41   extern char  *ecalloc(), *emalloc(), *savestr(), *strcpy();
42  
41 static int  hash();
42
43   static double  dvalue();
44  
45   long  eclock = -1;                      /* value storage timer */
# Line 667 | Line 667 | EPNODE *d;
667          ep2 = ep2->sibling;                     /* else reuse old value */
668  
669      return(ep2->v.num);
670 }
671
672
673 static int
674 hash(s)                         /* hash a string */
675 register char  *s;
676 {
677    register int  rval = 0;
678
679    while (*s)
680        rval += *s++;
681    
682    return(rval % NHASH);
670   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines