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

Comparing ray/src/hd/rholo2l.c (file contents):
Revision 3.20 by greg, Sat Dec 16 18:33:55 2023 UTC vs.
Revision 3.22 by greg, Wed Jan 22 17:41:10 2025 UTC

# Line 23 | Line 23 | int    nprocs = 0;                             /* running process count */
23  
24   static char     pfile[] = TEMPLATE;             /* persist file name */
25  
26 < static SUBPROC  rtpd[MAXPROC];          /* process descriptors */
26 > static SUBPROC  rtpd[MAXPROC];                  /* process descriptors */
27   static float    *rtbuf = NULL;                  /* allocated i/o buffer */
28 < static int      maxqlen = 0;                    /* maximum packets per queue */
28 > static int      maxqlen;                        /* maximum packets per queue */
29  
30   static PACKET   *pqueue[MAXPROC];               /* packet queues */
31   static int      pqlen[MAXPROC];                 /* packet queue lengths */
# Line 79 | Line 79 | start_rtrace(void)                     /* start rtrace process */
79                  psiz = open_process(&rtpd[nprocs], rtargv);
80                  if (psiz <= 0)
81                          error(SYSTEM, "cannot start rtrace process");
82 <                n = psiz/(RPACKSIZ*6*sizeof(float));
83 <                if (maxqlen == 0) {
82 >                n = psiz/(RPACKSIZ*6*sizeof(float)) + 1;
83 >                if (!maxqlen) {
84                          if (!(maxqlen = n))
85                                  error(INTERNAL,
86                                          "bad pipe buffer size assumption");
# Line 147 | Line 147 | queue_packet(                  /* queue up a beam packet */
147          packrays(rtbuf, p);
148          if ((n = p->nr) < RPACKSIZ)     /* add flush block? */
149                  memset((char *)(rtbuf+6*n++), '\0', 6*sizeof(float));
150 <        if (writebuf(rtpd[pn].w, (char *)rtbuf, 6*sizeof(float)*n) < 0)
150 >        if (writebuf(rtpd[pn].w, rtbuf, 6*sizeof(float)*n) < 0)
151                  error(SYSTEM, "write error in queue_packet");
152          p->next = NULL;
153          if (!pqlen[pn]++)       /* add it to the end of the queue */
# Line 282 | Line 282 | flush_queue(void)                      /* empty all rtrace queues */
282                                  if (rpl->nr < RPACKSIZ)
283                                          nr++;           /* add flush block */
284                          }
285 <                        n = readbuf(rtpd[i].r, (char *)rtbuf,
286 <                                        4*sizeof(float)*nr);
285 >                        n = readbuf(rtpd[i].r, rtbuf, 4*sizeof(float)*nr);
286                          if (n < 0)
287                                  error(SYSTEM, "read failure in flush_queue");
288                          bp = rtbuf;                     /* process packets */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines