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

Comparing ray/src/rt/ambient.c (file contents):
Revision 2.50 by schorsch, Thu Jun 5 19:29:34 2003 UTC vs.
Revision 2.53 by schorsch, Mon Jul 21 22:30:19 2003 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9  
10   #include "copyright.h"
11  
12 + #include <string.h>
13 +
14   #include  "platform.h"
15   #include  "ray.h"
16   #include  "otypes.h"
# Line 163 | Line 165 | setambient()                           /* initialize calculation */
165                                          (flen - pos)/AMBVALSIZ);
166                          error(WARNING, errmsg);
167                          fseek(ambfp, pos, 0);
168 + #ifndef _WIN32 /* XXX we need a replacement for that one */
169                          ftruncate(fileno(ambfp), (off_t)pos);
170 + #endif
171                  }
172          } else if ((ambfp = fopen(ambfile, "w+")) != NULL) {
173                  initambfile(1);                 /* else create new file */
# Line 525 | Line 529 | register AMBVAL  *aval;
529  
530          if ((av = newambval()) == NULL)
531                  error(SYSTEM, "out of memory in avstore");
532 <        copystruct(av, aval);
532 >        *av = *aval;
533          av->latick = ambclock;
534          av->next = NULL;
535          nambvals++;
# Line 560 | Line 564 | newambtree()                           /* allocate 8 ambient tree structs */
564          }
565          atp = atfreelist;
566          atfreelist = atp->kid;
567 <        bzero((char *)atp, 8*sizeof(AMBTREE));
567 >        memset((char *)atp, '\0', 8*sizeof(AMBTREE));
568          return(atp);
569   }
570  
# Line 737 | Line 741 | int    always;
741                  if (avlist2 != NULL)
742                          free((void *)avlist2);
743                  if (always) {           /* rebuild without sorting */
744 <                        copystruct(&oldatrunk, &atrunk);
744 >                        oldatrunk = atrunk;
745                          atrunk.alist = NULL;
746                          atrunk.kid = NULL;
747                          unloadatree(&oldatrunk, avinsert);
# Line 768 | Line 772 | int    always;
772                          if (avlist1[i].p == NULL)
773                                  continue;
774                          tap = avlist2[i];
775 <                        copystruct(&tav, tap);
775 >                        tav = *tap;
776                          for (j = i; (pnext = avlist1[j].p) != tap;
777                                          j = avlmemi(pnext)) {
778 <                                copystruct(avlist2[j], pnext);
778 >                                *(avlist2[j]) = *pnext;
779                                  avinsert(avlist2[j]);
780                                  avlist1[j].p = NULL;
781                          }
782 <                        copystruct(avlist2[j], &tav);
782 >                        *(avlist2[j]) = tav;
783                          avinsert(avlist2[j]);
784                          avlist1[j].p = NULL;
785                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines