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

Comparing ray/src/util/rad.c (file contents):
Revision 2.35 by greg, Tue Nov 23 09:26:38 1993 UTC vs.
Revision 2.37 by greg, Sat Jan 1 09:16:50 1994 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1993 Regents of the University of California */
1 > /* Copyright (c) 1994 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 114 | Line 114 | time_t oct0date;               /* date of pre-mkillum octree */
114   char    *oct1name;              /* name of post-mkillum octree */
115   time_t  oct1date;               /* date of post-mkillum octree (>= matdate) */
116  
117 + int     nowarn = 0;             /* no warnings */
118   int     explicate = 0;          /* explicate variables */
119   int     silent = 0;             /* do work silently */
120   int     noaction = 0;           /* don't do anything */
# Line 158 | Line 159 | char   *argv[];
159                  case 'v':
160                          viewselect = argv[++i];
161                          break;
162 +                case 'w':
163 +                        nowarn++;
164 +                        break;
165                  default:
166                          goto userr;
167                  }
# Line 273 | Line 277 | register char  *ass;
277          for (n = strlen(ass); n > 0; n--)
278                  if (!isspace(ass[n-1]))
279                          break;
280 <        if (!n) {
280 >        if (!n && !nowarn) {
281                  fprintf(stderr, "%s: warning - missing value for variable '%s'\n",
282                                  progname, varname);
283                  return;
# Line 359 | Line 363 | register VARIABLE      *vp;
363   {
364          if (vp->nass < 2)
365                  return;
366 <        fprintf(stderr, "%s: warning - multiple assignment of variable '%s'\n",
366 >        if (!nowarn)
367 >                fprintf(stderr,
368 >                "%s: warning - multiple assignment of variable '%s'\n",
369                          progname, vp->name);
370          do
371                  vp->value += strlen(vp->value)+1;
# Line 641 | Line 647 | setdefaults()                  /* set default values for unassigned v
647  
648   printvals()                     /* print variable values */
649   {
650 <        register int    i, j;
650 >        int     i, j, clipline;
651 >        register char   *cp;
652 >        register int    k;
653  
654 <        for (i = 0; i < NVARS; i++)
655 <                for (j = 0; j < vdef(i); j++)
656 <                        printf("%s= %s\n", vnam(i), nvalue(vv+i, j));
654 >        for (i = 0; i < NVARS; i++)             /* print each variable */
655 >            for (j = 0; j < vdef(i); j++) {     /* print each assignment */
656 >                fputs(vnam(i), stdout);
657 >                fputs("= ", stdout);
658 >                k = clipline = ( vv[i].fixval == catvalues ? 64 : 320 )
659 >                                - strlen(vnam(i)) ;
660 >                cp = nvalue(vv+i, j);
661 >                while (*cp) {
662 >                    putchar(*cp++);
663 >                    if (--k <= 0) {             /* line too long */
664 >                        while (*cp && !isspace(*cp))
665 >                            putchar(*cp++);     /* finish this word */
666 >                        if (*cp) {              /* start new line */
667 >                            putchar('\n');
668 >                            fputs(vnam(i), stdout);
669 >                            putchar('=');
670 >                            k = clipline;
671 >                        }
672 >                    }
673 >                }
674 >                putchar('\n');
675 >            }
676          fflush(stdout);
677   }
678  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines