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.23 by schorsch, Mon Jul 21 22:30:19 2003 UTC vs.
Revision 2.26 by schorsch, Fri Jan 2 11:43:42 2004 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9  
10   #include  <time.h>
11  
12 #include  "standard.h"
12   #include  "platform.h"
13 + #include  "standard.h"
14   #include  "color.h"
15   #include  "resolu.h"
16   #include  "data.h"
# Line 33 | Line 33 | static const char      RCSid[] = "$Id$";
33  
34   static DATARRAY  *dtab[TABSIZ];         /* data array list */
35  
36 + static gethfunc headaspect;
37  
38 +
39   DATARRAY *
40   getdata(dname)                          /* get data array dname */
41   char  *dname;
# Line 78 | Line 80 | char  *dname;
80                                                          /* get dimensions */
81          if (fgetval(fp, 'i', (char *)&asize) <= 0)
82                  goto scanerr;
83 <        if (asize <= 0 | asize > MAXDDIM) {
83 >        if ((asize <= 0) | (asize > MAXDDIM)) {
84                  sprintf(errmsg, "bad number of dimensions for \"%s\"", dname);
85                  error(USER, errmsg);
86          }
# Line 138 | Line 140 | scanerr:
140  
141  
142   static int
143 < headaspect(s, iap)                      /* check string for aspect ratio */
144 < char  *s;
145 < double  *iap;
143 > headaspect(                     /* check string for aspect ratio */
144 >        char  *s,
145 >        void  *iap
146 > )
147   {
148          char    fmt[32];
149  
150          if (isaspect(s))
151 <                *iap *= aspectval(s);
151 >                *(double*)iap *= aspectval(s);
152          else if (formatval(fmt, s) && !globmatch(PICFMT, fmt))
153 <                *iap = 0.0;
153 >                *(double*)iap = 0.0;
154          return(0);
155   }
156  
# Line 187 | Line 190 | char  *pname;
190          SET_FILE_BINARY(fp);
191                                                  /* get dimensions */
192          inpaspect = 1.0;
193 <        getheader(fp, headaspect, (char *)&inpaspect);
193 >        getheader(fp, headaspect, &inpaspect);
194          if (inpaspect <= FTINY || !fgetsresolu(&inpres, fp))
195                  goto readerr;
196          pp[0].nd = 2;
# Line 267 | Line 270 | DATARRAY  *dta;
270                  head.next = dtab[hval];
271                  dpl = &head;
272                  while ((dp = dpl->next) != NULL)
273 <                        if ((dta == NULL | dta == dp)) {
273 >                        if ((dta == NULL) | (dta == dp)) {
274                                  dpl->next = dp->next;
275                                  if (dp->type == DATATY)
276                                          free((void *)dp->arr.d);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines