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

Comparing ray/src/util/eplus_adduvf.c (file contents):
Revision 2.13 by greg, Thu Feb 27 20:39:04 2014 UTC vs.
Revision 2.17 by greg, Fri Apr 4 17:56:45 2014 UTC

# Line 176 | Line 176 | add_subsurf(IDF_OBJECT *param)
176   static IDF_FIELD *
177   get_vlist(IDF_OBJECT *param, const char *zname)
178   {
179 <        const int       itm_len = sizeof(IDF_FIELD)+6;
180 <        static char     fld_buf[4*itm_len];
181 <        static char     *next_fbp = fld_buf;
182 <        int             i;
183 <        IDF_FIELD       *res;
179 > #define itm_len         (sizeof(IDF_FIELD)+6)
180 >        static char             fld_buf[4*itm_len];
181 >        static char             *next_fbp = fld_buf;
182 >        int                     i;
183 >        IDF_FIELD               *res;
184                                                  /* check if subsurface */
185          if (!strcmp(param->pname, SUBSURF_PNAME)) {
186                  if (zname != NULL) {
# Line 219 | Line 219 | get_vlist(IDF_OBJECT *param, const char *zname)
219                  sprintf(res->val, "%d", i/3);
220          }
221          return(res);
222 + #undef itm_len
223   }
224  
225   /* Get/allocate surface polygon */
# Line 323 | Line 324 | static double
324   rad_subsurface(IDF_OBJECT *param, FILE *ofp)
325   {
326          const char      *sname = idf_getfield(param,NAME_FLD)->val;
327 <        SURFACE         *surf = get_surface(idf_getfield(param,SS_VERT_FLD));
327 >        SURFACE         *surf = get_surface(get_vlist(param, NULL));
328          double          area;
329          int             i;
330  
# Line 361 | Line 362 | start_rcontrib(SUBPROC *pd, ZONE *zp)
362          IDF_FIELD       *fptr;
363          int             i, j, n;
364                                                  /* start oconv command */
365 <        sprintf(cbuf, "oconv - > '%s'", temp_octree);
365 >        sprintf(cbuf, "oconv - > \"%s\"", temp_octree);
366          if ((ofp = popen(cbuf, "w")) == NULL) {
367                  fputs(progname, stderr);
368                  fputs(": cannot open oconv process\n", stderr);
# Line 391 | Line 392 | start_rcontrib(SUBPROC *pd, ZONE *zp)
392                                                  /* now subsurfaces */
393          if (zp->ntotal > zp->nsurf) {
394                  if (zp->area_redu != NULL)
395 <                        memset(zp->area_redu, 0, sizeof(float)*zp->nsurf);
396 <                else if ((zp->area_redu = (float *)calloc(zp->nsurf,
395 >                        memset(zp->area_redu, 0, sizeof(float)*zp->ntotal);
396 >                else if ((zp->area_redu = (float *)calloc(zp->ntotal,
397                                                  sizeof(float))) == NULL)
398                          return(0);
399          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines