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.17 by greg, Fri Mar 4 02:48:14 2016 UTC vs.
Revision 3.19 by greg, Thu Apr 21 03:11:55 2022 UTC

# Line 37 | Line 37 | static PACKET * get_packets(int poll);
37   static void killpersist(void);
38  
39  
40 < extern int
40 > int
41   start_rtrace(void)                      /* start rtrace process */
42   {
43          static char     buf1[8];
# Line 99 | Line 99 | static int
99   bestout(void)                   /* get best process to process packet */
100   {
101          int     cnt;
102 <        register int    pn, i;
102 >        int     pn, i;
103  
104          pn = 0;                 /* find shortest queue */
105          for (i = 1; i < nprocs; i++)
# Line 113 | Line 113 | bestout(void)                  /* get best process to process packet
113                  if (pqlen[i] == pqlen[pn])
114                          cnt++;
115                                  /* break ties fairly */
116 <        if ((cnt = random() % cnt))
116 >        if ((cnt = irandom(cnt)))
117                  for (i = pn; i < nprocs; i++)
118                          if (pqlen[i] == pqlen[pn] && !cnt--)
119                                  return(i);
# Line 124 | Line 124 | bestout(void)                  /* get best process to process packet
124   static int
125   slots_avail(void)                       /* count packet slots available */
126   {
127 <        register int    nslots = 0;
128 <        register int    i;
127 >        int     nslots = 0;
128 >        int     i;
129  
130          for (i = nprocs; i--; )
131                  nslots += maxqlen - pqlen[i];
# Line 135 | Line 135 | slots_avail(void)                      /* count packet slots available */
135  
136   static void
137   queue_packet(                   /* queue up a beam packet */
138 <        register PACKET *p
138 >        PACKET  *p
139   )
140   {
141          int     pn, n;
# Line 152 | Line 152 | queue_packet(                  /* queue up a beam packet */
152          if (!pqlen[pn]++)       /* add it to the end of the queue */
153                  pqueue[pn] = p;
154          else {
155 <                register PACKET *rpl = pqueue[pn];
155 >                PACKET  *rpl = pqueue[pn];
156                  while (rpl->next != NULL)
157                          rpl = rpl->next;
158                  rpl->next = p;
# Line 168 | Line 168 | get_packets(           /* read packets from rtrace processes */
168          static struct timeval   tpoll;  /* zero timeval struct */
169          fd_set  readset, errset;
170          PACKET  *pldone = NULL, *plend;
171 <        register PACKET *p;
171 >        PACKET  *p;
172          int     n, nr;
173 <        register int    pn;
173 >        int     pn;
174          float   *bp;
175                                          /* prepare select call */
176          FD_ZERO(&readset); FD_ZERO(&errset); n = 0;
# Line 240 | Line 240 | eoferr:
240   }
241  
242  
243 < extern PACKET *
243 > PACKET *
244   do_packets(                     /* queue a packet list, return finished */
245 <        register PACKET *pl
245 >        PACKET  *pl
246   )
247   {
248 <        register PACKET *p;
248 >        PACKET  *p;
249                                          /* consistency check */
250          if (nprocs < 1)
251                  error(CONSISTENCY, "do_packets called with no active process");
# Line 258 | Line 258 | do_packets(                    /* queue a packet list, return finished
258   }
259  
260  
261 < extern PACKET *
261 > PACKET *
262   flush_queue(void)                       /* empty all rtrace queues */
263   {
264          PACKET  *rpdone = NULL;
265 <        register PACKET *rpl = NULL;
265 >        PACKET  *rpl = NULL;
266          float   *bp;
267 <        register PACKET *p;
267 >        PACKET  *p;
268          int     i, n, nr;
269  
270          for (i = 0; i < nprocs; i++)
# Line 317 | Line 317 | killpersist(void)                      /* kill persistent process */
317   }
318  
319  
320 < extern int
320 > int
321   end_rtrace(void)                        /* close rtrace process(es) */
322   {
323          int     status = 0, rv;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines