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

Comparing ray/src/common/lookup.c (file contents):
Revision 2.14 by greg, Tue May 25 06:30:46 2004 UTC vs.
Revision 2.16 by schorsch, Wed Jun 7 17:52:03 2006 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7  
8   #include <stdio.h>
9   #include <stdlib.h>
10 + #include <string.h>
11  
12   #include "lookup.h"
13  
# Line 48 | Line 49 | lu_init(               /* initialize tbl for at least nel elements
49  
50   extern unsigned long
51   lu_shash(                       /* hash a nul-terminated string */
52 <        void    *s
52 >        const void      *s
53   )
54   {
55          static unsigned char shuffle[256] = {
# Line 79 | Line 80 | lu_shash(                      /* hash a nul-terminated string */
80          };
81          register int    i = 0;
82          register unsigned long  h = 0;
83 <        register unsigned char *t = (unsigned char *)s;
83 >        register unsigned const char *t = (unsigned const char *)s;
84  
85          while (*t)
86                  h ^= (unsigned long)shuffle[*t++] << ((i+=11) & 0xf);
# Line 91 | Line 92 | lu_shash(                      /* hash a nul-terminated string */
92   extern LUENT *
93   lu_find(                /* find a table entry */
94          register LUTAB  *tbl,
95 <        char    *key
95 >        const char      *key
96   )
97   {
98          unsigned long   hval;
# Line 147 | Line 148 | tryagain:
148   extern void
149   lu_delete(              /* delete a table entry */
150          register LUTAB  *tbl,
151 <        char    *key
151 >        const char      *key
152   )
153   {
154          register LUENT  *le;
# Line 165 | Line 166 | lu_delete(             /* delete a table entry */
166  
167   extern int
168   lu_doall(               /* loop through all valid table entries */
169 <        register LUTAB  *tbl,
170 <        //int   (*f)(LUENT *)
169 >        register const LUTAB    *tbl,
170 >        //int   (*f)(const LUENT *)
171          lut_doallf_t *f,
172          void *p
173   )
174   {
175          int     rval = 0;
176 <        register LUENT  *tp;
176 >        register const LUENT    *tp;
177  
178          for (tp = tbl->tabl + tbl->tsiz; tp-- > tbl->tabl; )
179                  if (tp->data != NULL) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines