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

Comparing ray/src/util/rcollate.c (file contents):
Revision 2.3 by greg, Thu Sep 5 18:47:12 2013 UTC vs.
Revision 2.4 by greg, Fri Sep 6 21:34:39 2013 UTC

# Line 35 | Line 35 | typedef struct {
35          char    *rec[1];        /* record array (extends struct) */
36   } RECINDEX;
37  
38 + int             warnings = 1;   /* report warnings? */
39 +
40   /* free loaded file */
41   static void
42   free_load(MEMLOAD *mp)
# Line 383 | Line 385 | do_resize(FILE *fp)
385                          putc('\t', stdout);
386          } while (--records2go);                 /* expected EOD? */
387   done:
388 <        if (columns2go != no_columns)
388 >        if (warnings && columns2go != no_columns)
389                  fprintf(stderr, "Warning -- incomplete final row\n");
390 <        if (fget_word(word, fp) != NULL)
391 <                fprintf(stderr, "Warning -- data beyond expected EOF\n");
390 >        if (warnings && fget_word(word, fp) != NULL)
391 >                fprintf(stderr, "Warning -- characters beyond expected EOD\n");
392          return(1);
393   }
394  
# Line 469 | Line 471 | main(int argc, char *argv[])
471                                  record_width *= atoi(argv[i]+3);
472                          }
473                          break;
474 +                case 'w':                       /* warnings on/off */
475 +                        warnings = !warnings;
476 +                        break;
477                  default:
478                          goto userr;
479                  }
# Line 488 | Line 493 | main(int argc, char *argv[])
493                                                  /* check for no-op */
494          if (!transpose && (record_width < 0 ||
495                          (no_columns == ni_columns) & (no_rows == ni_rows))) {
496 <                fprintf(stderr, "%s: no-op -- copying input verbatim\n",
496 >                if (warnings)
497 >                        fprintf(stderr, "%s: no-op -- copying input verbatim\n",
498                                  argv[0]);
499                  if (!output_stream(stdin))
500                          return(1);
# Line 522 | Line 528 | main(int argc, char *argv[])
528          return(0);
529   userr:
530          fprintf(stderr,
531 < "Usage: %s [-h][-f[afdb][N]][-t][-ic in_col][-ir in_row][-oc out_col][-or out_row] [input.dat]\n",
531 > "Usage: %s [-h][-w][-f[afdb][N]][-t][-ic in_col][-ir in_row][-oc out_col][-or out_row] [input.dat]\n",
532                          argv[0]);
533          return(1);
534   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines