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

Comparing ray/src/util/rtcontrib.c (file contents):
Revision 1.23 by greg, Thu Jun 16 19:37:26 2005 UTC vs.
Revision 1.27 by greg, Tue Sep 20 17:05:11 2005 UTC

# Line 173 | Line 173 | main(int argc, char *argv[])
173          char    *binval = NULL;
174          char    fmt[8];
175          int     i, j;
176 +                                /* need at least one argument */
177 +        if (argc < 2) {
178 +                fprintf(stderr,
179 + "Usage: %s [-n nprocs][-r][-e expr][-f source][-o ospec][-b binv] {-m mod | -M file} [rtrace options] octree\n",
180 +                        argv[0]);
181 +                exit(1);
182 +        }
183                                  /* global program name */
184          gargv = argv;
185                                  /* initialize calcomp routines */
# Line 315 | Line 322 | main(int argc, char *argv[])
322                  error(USER, "missing octree argument");
323          rtargv[rtargc++] = octree = argv[i];
324          rtargv[rtargc] = NULL;
325 <                                /* start rtrace & compute contributions */
325 >                                /* start rtrace */
326          init(nprocs);
327          if (recover)            /* perform recovery if requested */
328                  recover_output(stdin);
329 <        trace_contribs(stdin);
329 >        trace_contribs(stdin);  /* compute contributions */
330          quit(0);
331   }
332  
333 + #ifndef SIGALRM
334 + #define SIGALRM SIGTERM
335 + #endif
336   /* kill persistent rtrace process */
337   static void
338   killpersist(void)
339   {
340          FILE    *fp = fopen(persistfn, "r");
341 <        int     pid;
341 >        RT_PID  pid;
342  
343          if (fp == NULL)
344                  return;
# Line 706 | Line 716 | add_contrib(const char *modn)
716          bn = (int)(evalue(mp->binv) + .5);
717          if (bn <= 0)
718                  bn = 0;
719 <        else if (bn > mp->nbins) {      /* new bin */
719 >        else if (bn >= mp->nbins) {     /* new bin */
720                  mp = (MODCONT *)realloc(mp, sizeof(MODCONT) +
721                                                  bn*sizeof(DCOLOR));
722                  if (mp == NULL)
# Line 1090 | Line 1100 | recover_output(FILE *fin)
1100          if (lastout < 0) {
1101                  error(WARNING, "no output files to recover");
1102                  return;
1103 +        }
1104 +        if (raysleft && lastout >= raysleft) {
1105 +                error(WARNING, "output appears to be complete");
1106 +                /* XXX should read & discard input? */
1107 +                quit(0);
1108          }
1109                                                  /* seek on all files */
1110          nvals = lastout * outvsiz;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines