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

Comparing src/gen/mkillum.c (file contents):
Revision 2.42 by greg, Thu Sep 15 22:34:41 2016 UTC vs.
Revision 2.48 by greg, Tue Jun 3 21:31:51 2025 UTC

# Line 10 | Line 10 | static const char RCSid[] = "$Id$";
10  
11   #include  "paths.h"             /* win_popen() */
12   #include  "mkillum.h"
13 + #include  "func.h"
14  
15                                  /* default parameters */
16   #define  SAMPDENS       48              /* points per projected steradian */
# Line 64 | Line 65 | main(          /* compute illum distributions using rtrace */
65          int     i;
66                                  /* set global arguments */
67          gargv = argv;
68 <        progname = gargv[0];
68 >        gargv[0] = fixargv0(argv[0]);
69                                  /* set up rendering defaults */
70          dstrsrc = 0.5;
71          directrelay = 3;
72          ambounce = 2;
73 +                                /* initialize calcomp routines */
74 +        initfunc();
75                                  /* get options from command line */
76          for (i = 1; i < argc; i++) {
77                  while ((rval = expandarg(&argc, &argv, i)) > 0)
# Line 148 | Line 151 | init(char *octnm, int np)              /* start rendering process(
151  
152   void
153   eputs(                          /* put string to stderr */
154 <        char  *s
154 >        const char  *s
155   )
156   {
157          static int  midline = 0;
# Line 164 | Line 167 | eputs(                         /* put string to stderr */
167  
168  
169   void
170 < wputs(s)                        /* print warning if enabled */
168 < char  *s;
170 > wputs(const char *s)                    /* print warning if enabled */
171   {
172          if (warnings)
173                  eputs(s);
# Line 173 | Line 175 | char  *s;
175  
176  
177   void
178 < quit(ec)                        /* make sure exit is called */
177 < int     ec;
178 > quit(int ec)                    /* make sure exit is called */
179   {
180          if (ray_pnprocs > 0)    /* close children if any */
181 <                ray_pclose(0);          
181 >                ray_pclose(0);
182 >        else if (ray_pnprocs < 0)
183 >                _exit(ec);      /* avoid flush() in child */
184          exit(ec);
185   }
186  
# Line 207 | Line 210 | filter(                /* process stream */
210                                  error(SYSTEM, errmsg);
211                          }
212                          filter(pfp, buf);
213 <                        pclose(pfp);
213 >                        if (pclose(pfp) != 0) {
214 >                                sprintf(errmsg, "bad status from \"%s\"", buf);
215 >                                error(WARNING, errmsg);
216 >                        }
217                  } else {                                /* object */
218                          ungetc(c, infp);
219                          xobject(infp, name);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines