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

Comparing ray/src/util/rfluxmtx.c (file contents):
Revision 2.14 by greg, Wed Aug 6 02:38:24 2014 UTC vs.
Revision 2.16 by greg, Tue Aug 26 07:41:29 2014 UTC

# Line 36 | Line 36 | static const char RCSid[] = "$Id$";
36  
37   char            *progname;              /* global argv[0] */
38  
39 < int             verbose = 0;            /* verbose mode? */
39 > int             verbose = 0;            /* verbose mode (< 0 no warnings) */
40  
41   char            *rcarg[MAXRCARG+1] = {"rcontrib", "-fo+"};
42   int             nrcargs = 2;
# Line 226 | Line 226 | popen_arglist(char *av[], char *mode)
226                  fputs(": command line too long in popen_arglist()\n", stderr);
227                  return(NULL);
228          }
229 <        if (verbose)
229 >        if (verbose > 0)
230                  fprintf(stderr, "%s: opening pipe %s: %s\n",
231                                  progname, (*mode=='w') ? "to" : "from", cmd);
232          return(popen(cmd, mode));
# Line 244 | Line 244 | my_exec(char *av[])
244                  fputs(": command line too long in my_exec()\n", stderr);
245                  return(1);
246          }
247 <        if (verbose)
247 >        if (verbose > 0)
248                  fprintf(stderr, "%s: running: %s\n", progname, cmd);
249          return(system(cmd));
250   }
# Line 259 | Line 259 | my_exec(char *av[])
259                  fprintf(stderr, "%s: cannot locate %s\n", progname, av[0]);
260                  return(1);
261          }
262 <        if (verbose) {
262 >        if (verbose > 0) {
263                  char    cmd[4096];
264                  if (!convert_commandline(cmd, sizeof(cmd), av))
265                          strcpy(cmd, "COMMAND TOO LONG TO SHOW");
# Line 319 | Line 319 | parse_params(PARAMS *p, char *pargs)
319          int     nparams = 0;
320          int     i;
321  
322 <        for ( ; ; )
322 >        for ( ; ; ) {
323                  switch (*cp++) {
324                  case 'h':
325                          if (*cp++ != '=')
# Line 342 | Line 342 | parse_params(PARAMS *p, char *pargs)
342                                  break;
343                          if (!get_direction(p->vup, cp))
344                                  break;
345 +                        while (*cp && !isspace(*cp++))
346 +                                ;
347                          ++nparams;
348                          continue;
349                  case 'o':
# Line 360 | Line 362 | parse_params(PARAMS *p, char *pargs)
362                  case ' ':
363                  case '\t':
364                  case '\r':
363                case '\n':
365                          continue;
366 +                case '\n':
367                  case '\0':
368                          return(nparams);
369                  default:
370                          break;
371                  }
372 <        fprintf(stderr, "%s: bad parameter string '%s'\n", progname, pargs);
372 >                break;
373 >        }
374 >        fprintf(stderr, "%s: bad parameter string: %s", progname, pargs);
375          exit(1);
376          return(-1);     /* pro forma return */
377   }
# Line 863 | Line 867 | prepare_sampler(void)
867                  fputs(": no sender surface!\n", stderr);
868                  return(-1);
869          }
870 <        if (curparams.outfn != NULL)    /* misplaced output file spec. */
870 >                                        /* misplaced output file spec. */
871 >        if ((curparams.outfn != NULL) & (verbose >= 0))
872                  fprintf(stderr, "%s: warning - ignoring output file in sender ('%s')\n",
873                                  progname, curparams.outfn);
874                                          /* check/set basis hemisphere */
# Line 1014 | Line 1019 | add_surface(int st, const char *oname, FILE *fp)
1019                  snew->area *= PI*snew->area;
1020                  break;
1021          }
1022 <        if (snew->area <= FTINY) {
1022 >        if ((snew->area <= FTINY) & (verbose >= 0)) {
1023                  fprintf(stderr, "%s: warning - zero area for surface '%s'\n",
1024                                  progname, oname);
1025                  free(snew);
# Line 1201 | Line 1206 | main(int argc, char *argv[])
1206                  na = 1;
1207                  switch (argv[a][1]) {   /* !! Keep consistent !! */
1208                  case 'v':               /* verbose mode */
1209 <                        verbose = !verbose;
1209 >                        verbose = 1;
1210                          na = 0;
1211                          continue;
1212                  case 'f':               /* special case for -fo, -ff, etc. */
# Line 1242 | Line 1247 | main(int argc, char *argv[])
1247                          iropt = argv[a];
1248                          na = 0;
1249                          continue;
1250 <                case 'V':               /* options without arguments */
1251 <                case 'w':
1250 >                case 'w':               /* options without arguments */
1251 >                        if (argv[a][2] != '+') verbose = -1;
1252 >                case 'V':
1253                  case 'u':
1254                  case 'h':
1255                  case 'r':

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines