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

Comparing ray/src/hd/viewbeams.c (file contents):
Revision 3.1 by gwlarson, Thu Mar 4 10:30:04 1999 UTC vs.
Revision 3.6 by schorsch, Mon Jul 21 22:30:18 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1999 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Convert view to beam list.
6   */
7  
8 + #include <string.h>
9 +
10   #include "rholo.h"
11   #include "view.h"
12   #include "random.h"
# Line 40 | Line 39 | int    hd, bi, nr;
39                  }
40          i = blist.nb++;                         /* else add beam to list */
41          if (i % BALLOCBLK == 0) {
42 <                blist.bl = (PACKHEAD *)realloc((char *)blist.bl,
42 >                blist.bl = (PACKHEAD *)realloc((void *)blist.bl,
43                                  (i+BALLOCBLK)*sizeof(PACKHEAD));
44                  CHECK(blist.bl==NULL, SYSTEM, "out of memory in add2blist");
45          }
# Line 49 | Line 48 | int    hd, bi, nr;
48   }
49  
50  
51 < int2 *
51 > int16 *
52   viewbeams(vp, hr, vr, blp)              /* convert view into sections/beams */
53   VIEW    *vp;
54   int     hr, vr;
55   BEAMLIST        *blp;
56   {
57 <        static int2     sectlist[HDMAX+1];
58 <        int2    sectarr[MINRES+1][MINRES+1];
57 >        static int16    sectlist[HDMAX+1];
58 >        int16   sectarr[MINRES+1][MINRES+1];
59          double  d0, d1, mindist;
60          GCOORD  gc[2];
61          FVECT   rorg, rdir;
# Line 64 | Line 63 | BEAMLIST       *blp;
63          int     v;
64          register int    h, hd;
65                                                  /* clear section flags */
66 <        bzero((char *)sectlist, sizeof(sectlist));
66 >        memset((char *)sectlist, '\0', sizeof(sectlist));
67                                                  /* identify view sections */
68          for (v = 0; v <= MINRES; v++)
69                  for (h = 0; h <= MINRES; h++) {
# Line 141 | Line 140 | loopexit:
140                                                          /* add samples */
141                          add2blist(hd, hdbindex(hdlist[hd],gc), sampquant);
142                  }
143 <        copystruct(blp, &blist);                /* transfer beam list */
143 >        *blp = blist;           /* transfer beam list */
144          return(sectlist);                       /* all done! */
145   }
146  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines