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

Comparing ray/src/hd/rhcopy.c (file contents):
Revision 3.18 by schorsch, Mon Jul 21 22:30:18 2003 UTC vs.
Revision 3.21 by greg, Wed Oct 22 02:06:34 2003 UTC

# Line 5 | Line 5 | static const char      RCSid[] = "$Id$";
5   * Copy data into a holodeck file
6   */
7  
8 + #include "platform.h"
9   #include "holo.h"
10   #include "view.h"
11  
# Line 91 | Line 92 | int    *hf;
92          if (!strncmp(s, "OBSTRUCTIONS=", 13)) {
93                  s += 13;
94                  while (*s == ' ') s++;
95 <                if (*s == 't' | *s == 'T')
95 >                if ((*s == 't') | (*s == 'T'))
96                          *hf |= H_OBST;
97 <                else if (*s == 'f' | *s == 'F')
97 >                else if ((*s == 'f') | (*s == 'F'))
98                          *hf |= H_OBSF;
99                  else
100                          error(WARNING, "bad OBSTRUCTIONS value in holodeck");
# Line 128 | Line 129 | int    append;
129          nextloc = ftell(fp);                    /* get stdio position */
130          fclose(fp);                             /* done with stdio */
131          for (n = 0; nextloc > 0L; n++) {        /* initialize each section */
132 <                lseek(fd, (off_t)nextloc, 0);
132 >                lseek(fd, (off_t)nextloc, SEEK_SET);
133                  read(fd, (char *)&nextloc, sizeof(nextloc));
134                  hdinit(fd, NULL)->priv = hflags&H_OBST ? &obstr :
135                                  hflags&H_OBSF ? &unobstr : (char *)NULL;
# Line 333 | Line 334 | char   *pcf, *zbf;
334                  error(WARNING, errmsg);
335          }
336                                  /* figure out what to do about exposure */
337 <        if (phd.expos < 0.99 | phd.expos > 1.01) {
337 >        if ((phd.expos < 0.99) | (phd.expos > 1.01)) {
338                  emult = -log(phd.expos)/log(2.);
339                  eshft = emult >= 0. ? emult+.5 : emult-.5;
340                  emult -= (double)eshft;
341 <                if (emult <= 0.01 & emult >= -0.01)
341 >                if ((emult <= 0.01) & (emult >= -0.01))
342                          emult = -1.;
343                  else {
344                          emult = 1./phd.expos;
# Line 350 | Line 351 | char   *pcf, *zbf;
351                                  /* allocate buffers */
352          cscn = (COLR *)malloc(scanlen(&prs)*sizeof(COLR));
353          zscn = (float *)malloc(scanlen(&prs)*sizeof(float));
354 <        if (cscn == NULL | zscn == NULL)
354 >        if ((cscn == NULL) | (zscn == NULL))
355                  error(SYSTEM, "out of memory in addpicz");
356                                  /* read and process each scanline */
357          for (j = 0; j < numscans(&prs); j++) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines