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

Comparing ray/src/rt/data.c (file contents):
Revision 2.28 by schorsch, Sat Oct 23 18:55:52 2004 UTC vs.
Revision 2.31 by greg, Tue Jul 8 18:25:00 2014 UTC

# Line 20 | Line 20 | static const char      RCSid[] = "$Id$";
20                                  /* picture memory usage before warning */
21   #ifndef PSIZWARN
22   #ifdef SMLMEM
23 < #define PSIZWARN        1500000
23 > #define PSIZWARN        3000000
24   #else
25 < #define PSIZWARN        5000000
25 > #define PSIZWARN        10000000
26   #endif
27   #endif
28  
# Line 38 | Line 38 | static DATARRAY         *dtab[TABSIZ];         /* data array list */
38   static gethfunc headaspect;
39  
40  
41 < extern DATARRAY *
41 > DATARRAY *
42   getdata(                                /* get data array dname */
43          char  *dname
44   )
45   {
46          char  *dfname;
47          FILE  *fp;
48 <        int  asize;
49 <        register int  i, j;
50 <        register DATARRAY  *dp;
48 >        int  asize=0;
49 >        int  i, j;
50 >        DATARRAY  *dp;
51                                                  /* look for array in list */
52          for (dp = dtab[hash(dname)]; dp != NULL; dp = dp->next)
53                  if (!strcmp(dname, dp->name))
# Line 159 | Line 159 | headaspect(                    /* check string for aspect ratio */
159   }
160  
161  
162 < extern DATARRAY *
162 > DATARRAY *
163   getpict(                                /* get picture pname */
164          char  *pname
165   )
# Line 172 | Line 172 | getpict(                               /* get picture pname */
172          RESOLU  inpres;
173          RREAL  loc[2];
174          int  y;
175 <        register int  x, i;
176 <        register DATARRAY  *pp;
175 >        int  x, i;
176 >        DATARRAY  *pp;
177                                                  /* look for array in list */
178          for (pp = dtab[hash(pname)]; pp != NULL; pp = pp->next)
179                  if (!strcmp(pname, pp->name))
# Line 218 | Line 218 | getpict(                               /* get picture pname */
218          i = ns*sl*sizeof(COLR);
219   #if PSIZWARN
220          if (i > PSIZWARN) {                             /* memory warning */
221 <                sprintf(errmsg, "picture file \"%s\" using %d bytes of memory",
222 <                                pname, i);
221 >                sprintf(errmsg, "picture file \"%s\" using %.1f MB of memory",
222 >                                pname, i*(1.0/(1024*1024)));
223                  error(WARNING, errmsg);
224          }
225   #endif
# Line 258 | Line 258 | readerr:
258   }
259  
260  
261 < extern void
261 > void
262   freedata(                       /* release data array reference */
263          DATARRAY  *dta
264   )
265   {
266          DATARRAY  head;
267          int  hval, nents;
268 <        register DATARRAY  *dpl, *dp;
269 <        register int  i;
268 >        DATARRAY  *dpl, *dp;
269 >        int  i;
270  
271          if (dta == NULL) {                      /* free all if NULL */
272                  hval = 0; nents = TABSIZ;
# Line 295 | Line 295 | freedata(                      /* release data array reference */
295   }
296  
297  
298 < extern double
298 > double
299   datavalue(              /* interpolate data value at a point */
300 <        register DATARRAY  *dp,
300 >        DATARRAY  *dp,
301          double  *pt
302   )
303   {
304          DATARRAY  sd;
305          int  asize;
306          int  lower, upper;
307 <        register int  i;
307 >        int  i;
308          double  x, y0, y1;
309                                          /* set up dimensions for recursion */
310          if (dp->nd > 1) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines