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.21 by schorsch, Thu Jun 26 00:58:10 2003 UTC vs.
Revision 2.26 by schorsch, Fri Jan 2 11:43:42 2004 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7  
8   #include "copyright.h"
9  
10 < #include  "standard.h"
10 > #include  <time.h>
11 >
12   #include  "platform.h"
13 + #include  "standard.h"
14   #include  "color.h"
15   #include  "resolu.h"
16   #include  "data.h"
# Line 31 | 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 76 | 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 136 | 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 185 | 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 232 | Line 237 | char  *pname;
237          fclose(fp);
238          i = hash(pname);
239          pp[0].next = dtab[i];           /* link into picture list */
240 <        copystruct(&pp[1], &pp[0]);
241 <        copystruct(&pp[2], &pp[0]);
240 >        pp[1] = pp[0];
241 >        pp[2] = pp[0];
242          pp[0].type = RED;               /* differentiate RGB records */
243          pp[1].type = GRN;
244          pp[2].type = BLU;
# Line 265 | 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