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

Comparing ray/src/cv/mgflib/lookup.c (file contents):
Revision 1.7 by gwlarson, Fri Sep 4 09:05:09 1998 UTC vs.
Revision 1.9 by schorsch, Sun Jul 27 22:12:02 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1994 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Table lookup routines
6   */
7  
8   #include <stdio.h>
9 + #include <stdlib.h>
10   #include "lookup.h"
11  
12   #ifndef MEM_PTR
13   #define MEM_PTR         void *
14   #endif
15  
18 extern MEM_PTR  calloc();
16  
20
17   int
18   lu_init(tbl, nel)               /* initialize tbl for at least nel elements */
19   register LUTAB  *tbl;
# Line 129 | Line 125 | tryagain:
125           * recursive call to lu_find().
126           */
127          while (ndx--)
128 <                if (le[ndx].key != NULL)
128 >                if (le[ndx].key != NULL) {
129                          if (le[ndx].data != NULL)
130                                  *lu_find(tbl, le[ndx].key) = le[ndx];
131                          else if (tbl->freek != NULL)
132                                  (*tbl->freek)(le[ndx].key);
133 +                }
134          free((MEM_PTR)le);
135          goto tryagain;                  /* should happen only once! */
136   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines