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.48 by greg, Wed Jul 9 23:14:58 2014 UTC vs.
Revision 2.51 by greg, Sun Dec 2 16:30:30 2018 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines