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

Comparing ray/src/hd/holofile.c (file contents):
Revision 3.48 by greg, Fri Jun 20 00:25:49 2003 UTC vs.
Revision 3.51 by schorsch, Mon Jul 21 22:30:18 2003 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7   *      9/30/97 GWLarson
8   */
9  
10 + #include "copyright.h"
11 +
12 + #include <string.h>
13 +
14   #include "holo.h"
15  
16   #ifndef CACHESIZE
# Line 66 | Line 70 | HDGRID *hproto;
70          register HOLO   *hp;
71          int     n;
72                                  /* copy grid to temporary header */
73 <        bcopy((void *)hproto, (void *)&hdhead, sizeof(HDGRID));
73 >        memcpy((void *)&hdhead, (void *)hproto, sizeof(HDGRID));
74                                  /* compute grid vectors and sizes */
75          hdcompgrid(&hdhead);
76                                  /* allocate header with directory */
# Line 74 | Line 78 | HDGRID *hproto;
78          if ((hp = (HOLO *)malloc(n)) == NULL)
79                  return(NULL);
80                                  /* copy header information */
81 <        copystruct(hp, &hdhead);
81 >        *hp = hdhead;
82                                  /* allocate and clear beam list */
83          hp->bl = (BEAM **)malloc((nbeams(hp)+1)*sizeof(BEAM *)+sizeof(BEAM));
84          if (hp->bl == NULL) {
85                  free((void *)hp);
86                  return(NULL);
87          }
88 <        bzero((void *)hp->bl, (nbeams(hp)+1)*sizeof(BEAM *)+sizeof(BEAM));
88 >        memset((void *)hp->bl, '\0', (nbeams(hp)+1)*sizeof(BEAM *)+sizeof(BEAM));
89          hp->bl[0] = (BEAM *)(hp->bl+nbeams(hp)+1);      /* set blglob(hp) */
90          hp->fd = -1;
91          hp->dirty = 0;
92          hp->priv = NULL;
93                                  /* clear beam directory */
94 <        bzero((void *)hp->bi, (nbeams(hp)+1)*sizeof(BEAMI));
94 >        memset((void *)hp->bi, '\0', (nbeams(hp)+1)*sizeof(BEAMI));
95          return(hp);             /* all is well */
96   }
97  
# Line 123 | Line 127 | int    wr;
127          if (fd >= nhdfragls) {
128                  hdfragl = (struct fraglist *)hdrealloc((char *)hdfragl,
129                                  (fd+1)*sizeof(struct fraglist), "hdattach");
130 <                bzero((void *)(hdfragl+nhdfragls),
131 <                                (fd+1-nhdfragls)*sizeof(struct fraglist));
130 >                memset((void *)(hdfragl+nhdfragls),
131 >                                '\0', (fd+1-nhdfragls)*sizeof(struct fraglist));
132                  nhdfragls = fd+1;
133          }
134          hdfragl[fd].nlinks++;
# Line 257 | Line 261 | int    i;
261                          hp->dirseg[j].n = 1;
262                          break;
263                  }
264 <                copystruct(hp->dirseg+j, hp->dirseg+(j-1));
264 >                *(hp->dirseg+j) = *(hp->dirseg+(j-1));
265          }
266          do {                            /* check neighbors */
267                  mindist = nbeams(hp);           /* find closest */
# Line 279 | Line 283 | int    i;
283                                          hp->dirseg[minpos].n - hp->dirseg[j].s;
284                  hp->dirty--;
285                  while (++j < hp->dirty)         /* close the gap */
286 <                        copystruct(hp->dirseg+j, hp->dirseg+(j+1));
286 >                        *(hp->dirseg+j) = *(hp->dirseg+(j+1));
287          } while (mindist <= MINDIRSEL);
288   }
289  
# Line 429 | Line 433 | int    nr;                     /* number of new rays desired */
433                  hdfreefrag(hp, i);              /* relinquish old fragment */
434          p = hdbray(hp->bl[i]) + hp->bl[i]->nrm;
435          hp->bl[i]->nrm += nr;                   /* update in-core structure */
436 <        bzero((void *)p, nr*sizeof(RAYVAL));
436 >        memset((void *)p, '\0', nr*sizeof(RAYVAL));
437          blglob(hp)->tick = hp->bl[i]->tick = hdclock++; /* update LRU clock */
438          return(p);                              /* point to new rays */
439   }
# Line 487 | Line 491 | register HDBEAMI       *hb1, *hb2;
491   hdloadbeams(hb, n, bf)  /* load a list of beams in optimal order */
492   register HDBEAMI        *hb;    /* list gets sorted by hdfilord() */
493   int     n;                      /* list length */
494 < int     (*bf)();                /* callback function (optional) */
494 > void    (*bf)();                /* callback function (optional) */
495   {
496          unsigned        origcachesize, memuse;
497          int     bytesloaded, needbytes, bytes2free;
# Line 551 | Line 555 | int    i;
555                                  if (++k >= f->nfrags)
556                                          goto endloop;
557                          if (k > j)
558 <                                copystruct(f->fi+j, f->fi+k);
558 >                                *(f->fi+j) = *(f->fi+k);
559                  }
560          endloop:
561                  f->nfrags = j;
# Line 583 | Line 587 | int    i;
587                          f->fi[j].nrd = bi->nrd;
588                          break;
589                  }
590 <                copystruct(f->fi+j, f->fi+(j-1));
590 >                *(f->fi+j) = *(f->fi+(j-1));
591          }
592                                          /* coalesce adjacent fragments */
593                                                  /* successors never empty */
# Line 813 | Line 817 | register HOLO  *hp;                    /* section we're adding from */
817                                  hb[j].b = i;
818                                  break;
819                          }
820 <                        copystruct(hb+j, hb+(j-1));
820 >                        *(hb+j) = *(hb+(j-1));
821                  }
822          }
823          return(nents);                  /* return new list length */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines