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

Comparing src/util/rfluxmtx.c (file contents):
Revision 2.60 by greg, Tue Jun 3 21:31:51 2025 UTC vs.
Revision 2.61 by greg, Fri Oct 17 17:24:47 2025 UTC

# Line 22 | Line 22 | static const char RCSid[] = "$Id$";
22   #define MAXRCARG        10000
23   #endif
24  
25 < int             verbose = 0;            /* verbose mode (< 0 no warnings) */
25 > #define         NOWARN          1
26 > #define         VERBO           2
27  
28 + int             verbose = 0;            /* verbose/warning mode */
29 +
30   char            *rcarg[MAXRCARG+1] = {"rcontrib", "-fo+"};
31   int             nrcargs = 2;
32  
# Line 42 | Line 45 | char           *kquarterfn = "klems_quarter.cal";
45   char            *ciefn = "cieskyscan.cal";
46  
47                                          /* string indicating parameters */
48 < const char      PARAMSTART[] = "@rfluxmtx";
48 > #define PARAMSTART      "@rfluxmtx"
49  
50                                  /* surface type IDs */
51   #define ST_NONE         0
# Line 139 | Line 142 | oconv_command(int ac, char *av[])
142          
143          if (ac-- <= 0)
144                  return(NULL);
145 <        if (verbose < 0) {      /* turn off warnings */
145 >        if (verbose & NOWARN) { /* warnings off? */
146                  strcpy(cp, "-w ");
147                  cp += 3;
148          }
# Line 190 | Line 193 | popen_arglist(char *av[], char *mode)
193                  fputs(": command line too long in popen_arglist()\n", stderr);
194                  return(NULL);
195          }
196 <        if (verbose > 0)
196 >        if (verbose & VERBO)
197                  fprintf(stderr, "%s: opening pipe %s: %s\n",
198                                  progname, (*mode=='w') ? "to" : "from", cmd);
199          return(popen(cmd, mode));
# Line 209 | Line 212 | my_exec(char *av[])
212                  fputs(": command line too long in my_exec()\n", stderr);
213                  return(1);
214          }
215 <        if (verbose > 0)
215 >        if (verbose & VERBO)
216                  fprintf(stderr, "%s: running: %s\n", progname, cmd);
217          return(system(cmd));
218   }
# Line 228 | Line 231 | popen_arglist(char *av[], char *mode)
231                  fprintf(stderr, "%s: only one i/o pipe at a time!\n", progname);
232                  return(NULL);
233          }
234 <        if (verbose > 0) {
234 >        if (verbose & VERBO) {
235                  char    cmd[4096];
236                  if (!convert_commandline(cmd, sizeof(cmd), av))
237                          strcpy(cmd, "COMMAND TOO LONG TO SHOW");
# Line 273 | Line 276 | my_exec(char *av[])
276                  fprintf(stderr, "%s: cannot locate %s\n", progname, av[0]);
277                  return(1);
278          }
279 <        if (verbose > 0) {
279 >        if (verbose & VERBO) {
280                  char    cmd[4096];
281                  if (!convert_commandline(cmd, sizeof(cmd), av))
282                          strcpy(cmd, "COMMAND TOO LONG TO SHOW");
# Line 909 | Line 912 | prepare_sampler(void)
912                  return(-1);
913          }
914                                          /* misplaced output file spec. */
915 <        if ((curparams.outfn != NULL) & (verbose >= 0))
915 >        if ((curparams.outfn != NULL) & !(verbose & NOWARN))
916                  fprintf(stderr, "%s: warning - ignoring output file in sender ('%s')\n",
917                                  progname, curparams.outfn);
918                                          /* check/set basis hemisphere */
# Line 1065 | Line 1068 | add_surface(int st, const char *oname, FILE *fp)
1068                  snew->area *= PI*snew->area;
1069                  break;
1070          }
1071 <        if ((snew->area <= FTINY*FTINY) & (verbose >= 0)) {
1071 >        if ((snew->area <= FTINY*FTINY) & !(verbose & NOWARN)) {
1072                  fprintf(stderr, "%s: warning - zero area for surface '%s'\n",
1073                                  progname, oname);
1074                  free(snew);
# Line 1255 | Line 1258 | main(int argc, char *argv[])
1258                  na = 1;
1259                  switch (argv[a][1]) {   /* !! Keep consistent !! */
1260                  case 'v':               /* verbose mode */
1261 <                        verbose = 1;
1261 >                        verbose ^= VERBO;
1262                          na = 0;
1263                          continue;
1264                  case 'f':               /* special case for -fo, -ff, etc. */
# Line 1307 | Line 1310 | main(int argc, char *argv[])
1310                          na = 0;
1311                          continue;
1312                  case 'w':               /* options without arguments */
1313 <                        if (!argv[a][2] || strchr("+1tTyY", argv[a][2]) == NULL)
1314 <                                verbose = -1;
1313 >                        if (!argv[a][2])
1314 >                                verbose ^= NOWARN;
1315 >                        else if (strchr("+1tTyY", argv[a][2]) != NULL)
1316 >                                verbose &= ~NOWARN;
1317 >                        else
1318 >                                verbose |= NOWARN;
1319                          break;
1320                  case 'V':
1321                  case 'u':
# Line 1428 | Line 1435 | main(int argc, char *argv[])
1435   #ifdef getc_unlocked
1436          flockfile(rcfp);
1437   #endif
1438 <        if (verbose > 0) {
1438 >        if (verbose & VERBO) {
1439                  fprintf(stderr, "%s: sampling %d directions", progname, nsbins);
1440                  if (curparams.nsurfs > 1)
1441                          fprintf(stderr, " (%d elements)\n", curparams.nsurfs);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines