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

Comparing ray/src/gen/xform.c (file contents):
Revision 2.49 by greg, Tue Feb 2 18:02:32 2016 UTC vs.
Revision 2.54 by greg, Sat Jun 7 05:09:45 2025 UTC

# Line 12 | Line 12 | static const char RCSid[] = "$Id$";
12   #include  <ctype.h>
13  
14   #include  "platform.h"
15 #include  "paths.h"
15   #include  "rtio.h"
16   #include  "rtmath.h"
17   #include  "object.h"
18   #include  "otypes.h"
19  
21 #ifdef getc_unlocked            /* avoid horrendous overhead of flockfile */
22 #undef getc
23 #define getc    getc_unlocked
24 #endif
25
20   int  xac;                               /* global xform argument count */
21   char  **xav;                            /* global xform argument pointer */
22   int  xfa;                               /* start of xf arguments */
# Line 214 | Line 208 | doargf(                        /* take argument list from file */
208                  }
209                  n = 0;                  /* count number of lines in file */
210                  while (fgetline(argbuf,sizeof(argbuf),argfp) != NULL)
211 <                        n += argbuf[0] && argbuf[0] != '#';
211 >                        n += (argbuf[0] != '\0') & (argbuf[0] != '#');
212                  if (!n) {
213                          fprintf(stderr, "%s: empty argument file \"%s\"\n",
214                                          av[0], av[fi+1]);
215                          exit(1);
216                  }
223                nrept *= n;
217                  rewind(argfp);
218          }
219 +        nrept *= n;
220          err = 0; k = 0;                 /* read each arg list and call main */
221          while (fgetline(argbuf,sizeof(argbuf),argfp) != NULL) {
222 <                if (!argbuf[0] || argbuf[0] == '#')
222 >                if (!argbuf[0] | (argbuf[0] == '#')) {
223 >                        printf("%s\n", argbuf);
224                          continue;
225 +                }
226                  avp = newav+2;
227                  avp[0] = av[0];
228                  for (i = 1; i < fi; i++)
# Line 397 | Line 393 | xfcomm(                        /* transform a command */
393                          exit(1);
394                  }
395                  xform(buf, pin);
396 <                pclose(pin);
396 >                if (pclose(pin) != 0)
397 >                        fprintf(stderr, "%s: (%s): warning - bad status from \"%s\"\n",
398 >                                        progname, fname, buf);
399          } else {
400                  printf("\n%s", buf);
401                  if (xac > 1) {
# Line 557 | Line 555 | m_glow(                        /* transform arguments for proximity light *
555  
556          if (readfargs(&fa, fin) != 1)
557                  return(-1);
558 <        if (fa.nsargs != 0  || fa.nfargs != 4)
558 >        if ((fa.nsargs != 0) | (fa.nfargs != 4))
559                  return(-1);
560          printf("0\n0\n4");
561          printf(" %18.12g %18.12g %18.12g",
# Line 578 | Line 576 | m_spot(                        /* transform arguments for spotlight */
576  
577          if (readfargs(&fa, fin) != 1)
578                  return(-1);
579 <        if (fa.nsargs != 0  || fa.nfargs != 7)
579 >        if ((fa.nsargs != 0) | ( fa.nfargs != 7))
580                  return(-1);
581          printf("0\n0\n7");
582          printf(" %18.12g %18.12g %18.12g %18.12g\n",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines