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.5 by gwlarson, Thu Sep 3 14:22:23 1998 UTC vs.
Revision 2.9 by schorsch, Mon Jun 30 14:59:11 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1998 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Table lookup routines
6   */
7  
8 + #include "copyright.h"
9 +
10   #include <stdio.h>
11 + #include <stdlib.h>
12 + #include <string.h>
13 +
14   #include "lookup.h"
15  
16   #ifdef  NOSTRUCTASS
17 < #define  copystruct(d,s)        bcopy((char *)(s),(char *)(d),sizeof(*(d)))
17 > #define  copystruct(d,s)        memcpy((void *)(d),(void *)(s),sizeof(*(d)))
18   #else
19   #define  copystruct(d,s)        (*(d) = *(s))
20   #endif
21  
20 #define MEM_PTR         char *
22  
22 extern MEM_PTR  calloc();
23
24
23   int
24   lu_init(tbl, nel)               /* initialize tbl for at least nel elements */
25   register LUTAB  *tbl;
# Line 138 | Line 136 | tryagain:
136                                  copystruct(lu_find(tbl,le[ndx].key), &le[ndx]);
137                          else if (tbl->freek != NULL)
138                                  (*tbl->freek)(le[ndx].key);
139 <        free((MEM_PTR)le);
139 >        free((void *)le);
140          goto tryagain;                  /* should happen only once! */
141   }
142  
# Line 194 | Line 192 | register LUTAB *tbl;
192                          if (tp->data != NULL && tbl->freed != NULL)
193                                  (*tbl->freed)(tp->data);
194                  }
195 <        free((MEM_PTR)tbl->tabl);
195 >        free((void *)tbl->tabl);
196          tbl->tabl = NULL;
197          tbl->tsiz = 0;
198          tbl->ndel = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines