--- ray/src/util/dcglare.c 2021/06/24 18:08:07 2.4 +++ ray/src/util/dcglare.c 2025/03/05 02:59:58 2.8 @@ -1,3 +1,6 @@ +#ifndef lint +static const char RCSid[] = "$Id: dcglare.c,v 2.8 2025/03/05 02:59:58 greg Exp $"; +#endif /* * Compute time-step glare using imageless DGP calculation method. * @@ -83,7 +86,7 @@ sum_images(const char *fspec, const CMATRIX *cv, FILE pmat = cm_alloc(myYR, myXR); memset(pmat->cmem, 0, sizeof(COLOR)*myXR*myYR); /* finish header */ - fputformat((char *)cm_fmt_id[myDT], fout); + fputformat(cm_fmt_id[myDT], fout); fputc('\n', fout); fflush(fout); } else if ((dt != myDT) | (xr != myXR) | (yr != myYR)) { @@ -93,7 +96,7 @@ sum_images(const char *fspec, const CMATRIX *cv, FILE } /* flat file check */ if ((data_start = ftell(fp)) > 0 && fseek(fp, 0L, SEEK_END) == 0) { - flat_file = (ftell(fp) == data_start + sizeof(COLR)*xr*yr); + flat_file = (ftell(fp) >= data_start + sizeof(COLR)*xr*yr); if (fseek(fp, data_start, SEEK_SET) < 0) { sprintf(errmsg, "cannot seek on picture '%s'", fname); error(SYSTEM, errmsg); @@ -475,9 +478,9 @@ main(int argc, char *argv[]) fprintf(ofp, "FRAME=%d\n", i); fprintf(ofp, "NROWS=%d\n", rvec->nrows); fputs("NCOLS=1\nNCOMP=3\n", ofp); - if ((outfmt == 'f') | (outfmt == 'd')) + if ((outfmt == DTfloat) | (outfmt == DTdouble)) fputendian(ofp); - fputformat((char *)cm_fmt_id[outfmt], ofp); + fputformat(cm_fmt_id[outfmt], ofp); fputc('\n', ofp); } cm_write(rvec, outfmt, ofp); @@ -508,9 +511,9 @@ main(int argc, char *argv[]) fprintf(ofp, "NCOLS=%d\n", rmtx->ncols); fputs("NCOMP=3\n", ofp); #endif /* DC_GLARE */ - if ((outfmt == 'f') | (outfmt == 'd')) + if ((outfmt == DTfloat) | (outfmt == DTdouble)) fputendian(ofp); - fputformat((char *)cm_fmt_id[outfmt], ofp); + fputformat(cm_fmt_id[outfmt], ofp); fputc('\n', ofp); } #ifdef DC_GLARE