--- ray/src/hd/rhpict.c 2003/07/07 17:21:51 3.12 +++ ray/src/hd/rhpict.c 2003/10/22 02:06:34 3.16 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rhpict.c,v 3.12 2003/07/07 17:21:51 greg Exp $"; +static const char RCSid[] = "$Id: rhpict.c,v 3.16 2003/10/22 02:06:34 greg Exp $"; #endif /* * Radiance holodeck picture generator @@ -7,6 +7,7 @@ static const char RCSid[] = "$Id: rhpict.c,v 3.12 2003 #include +#include "platform.h" #include "rholo.h" #include "view.h" @@ -56,7 +57,7 @@ char *argv[]; pixaspect = atof(argv[++i]); else if (argv[i][2] == 'e') { expval = atof(argv[++i]); - if (argv[i][0] == '-' | argv[i][0] == '+') + if ((argv[i][0] == '-') | (argv[i][0] == '+')) expval = pow(2., expval); } else goto userr; @@ -212,9 +213,9 @@ int fn; fputs(VIEWSTR, stdout); fprintview(&myview, stdout); fputc('\n', stdout); - if (pa < 0.99 | pa > 1.01) + if ((pa < 0.99) | (pa > 1.01)) fputaspect(pa, stdout); - if (expval < 0.99 | expval > 1.01) + if ((expval < 0.99) | (expval > 1.01)) fputexpos(expval, stdout); fputformat(COLRFMT, stdout); fputc('\n', stdout); @@ -237,11 +238,12 @@ endpicture() /* finish and write out pixels */ /* compute final pixel values */ for (p = hres*vres; p--; ) { if (myweight[p] <= FTINY) { - if (lastr >= 0) + if (lastr >= 0) { if (p/hres == lastp/hres) copycolor(mypixel[p], mypixel[lastp]); else copycolor(mypixel[p], mypixel[lastrp]); + } nunrend++; continue; } @@ -283,7 +285,7 @@ initialize() /* initialize holodeck and buffers */ fd = dup(fileno(fp)); /* dup file descriptor */ fclose(fp); /* done with stdio */ for (n = 0; nextloc > 0L; n++) { /* initialize each section */ - lseek(fd, (off_t)nextloc, 0); + lseek(fd, (off_t)nextloc, SEEK_SET); read(fd, (char *)&nextloc, sizeof(nextloc)); hdinit(fd, NULL); } @@ -291,7 +293,7 @@ initialize() /* initialize holodeck and buffers */ mypixel = (COLOR *)bmalloc(xres*yres*sizeof(COLOR)); myweight = (float *)bmalloc(xres*yres*sizeof(float)); mydepth = (float *)bmalloc(xres*yres*sizeof(float)); - if (mypixel == NULL | myweight == NULL | mydepth == NULL) + if ((mypixel == NULL) | (myweight == NULL) | (mydepth == NULL)) error(SYSTEM, "out of memory in initialize"); }