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.25 by greg, Wed Oct 22 02:06:35 2003 UTC vs.
Revision 2.27 by schorsch, Tue Mar 30 16:13:01 2004 UTC

# Line 13 | Line 13 | static const char      RCSid[] = "$Id$";
13   #include  "standard.h"
14   #include  "color.h"
15   #include  "resolu.h"
16 + #include  "view.h"
17   #include  "data.h"
18  
19                                  /* picture memory usage before warning */
# Line 33 | Line 34 | static const char      RCSid[] = "$Id$";
34  
35   static DATARRAY  *dtab[TABSIZ];         /* data array list */
36  
37 + static gethfunc headaspect;
38  
39 < DATARRAY *
40 < getdata(dname)                          /* get data array dname */
41 < char  *dname;
39 >
40 > extern DATARRAY *
41 > getdata(                                /* get data array dname */
42 >        char  *dname
43 > )
44   {
45          char  *dfname;
46          FILE  *fp;
# Line 134 | Line 138 | scanerr:
138          sprintf(errmsg, "%s in data file \"%s\"",
139                          feof(fp) ? "unexpected EOF" : "bad format", dfname);
140          error(USER, errmsg);
141 +        return NULL; /* pro forma return */
142   }
143  
144  
145   static int
146 < headaspect(s, iap)                      /* check string for aspect ratio */
147 < char  *s;
148 < double  *iap;
146 > headaspect(                     /* check string for aspect ratio */
147 >        char  *s,
148 >        void  *iap
149 > )
150   {
151          char    fmt[32];
152  
153          if (isaspect(s))
154 <                *iap *= aspectval(s);
154 >                *(double*)iap *= aspectval(s);
155          else if (formatval(fmt, s) && !globmatch(PICFMT, fmt))
156 <                *iap = 0.0;
156 >                *(double*)iap = 0.0;
157          return(0);
158   }
159  
160  
161 < DATARRAY *
162 < getpict(pname)                          /* get picture pname */
163 < char  *pname;
161 > extern DATARRAY *
162 > getpict(                                /* get picture pname */
163 >        char  *pname
164 > )
165   {
166          double  inpaspect;
167          char  *pfname;
# Line 187 | Line 194 | char  *pname;
194          SET_FILE_BINARY(fp);
195                                                  /* get dimensions */
196          inpaspect = 1.0;
197 <        getheader(fp, headaspect, (char *)&inpaspect);
197 >        getheader(fp, headaspect, &inpaspect);
198          if (inpaspect <= FTINY || !fgetsresolu(&inpres, fp))
199                  goto readerr;
200          pp[0].nd = 2;
# Line 246 | Line 253 | memerr:
253   readerr:
254          sprintf(errmsg, "bad picture file \"%s\"", pfname);
255          error(USER, errmsg);
256 +        return NULL; /* pro forma return */
257   }
258  
259  
260 < void
261 < freedata(dta)                   /* release data array reference */
262 < DATARRAY  *dta;
260 > extern void
261 > freedata(                       /* release data array reference */
262 >        DATARRAY  *dta
263 > )
264   {
265          DATARRAY  head;
266          int  hval, nents;
# Line 285 | Line 294 | DATARRAY  *dta;
294   }
295  
296  
297 < double
298 < datavalue(dp, pt)               /* interpolate data value at a point */
299 < register DATARRAY  *dp;
300 < double  *pt;
297 > extern double
298 > datavalue(              /* interpolate data value at a point */
299 >        register DATARRAY  *dp,
300 >        double  *pt
301 > )
302   {
303          DATARRAY  sd;
304          int  asize;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines