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

Comparing ray/src/gen/gendaymtx.c (file contents):
Revision 2.14 by greg, Fri May 30 00:00:54 2014 UTC vs.
Revision 2.17 by greg, Sun Oct 26 17:35:53 2014 UTC

# Line 88 | Line 88 | static const char RCSid[] = "$Id$";
88   #include "rtmath.h"
89   #include "platform.h"
90   #include "color.h"
91 + #include "resolu.h"
92  
93   char *progname;                                                         /* Program name */
94   char errmsg[128];                                                       /* Error message buffer */
# Line 319 | Line 320 | main(int argc, char *argv[])
320          int     dir_is_horiz;           /* direct is meas. on horizontal? */
321          float   *mtx_data = NULL;       /* our matrix data */
322          int     ntsteps = 0;            /* number of rows in matrix */
323 +        int     step_alloc = 0;
324          int     last_monthly = 0;       /* month of last report */
325          int     mo, da;                 /* month (1-12) and day (1-31) */
326          double  hr;                     /* hour (local standard time) */
# Line 460 | Line 462 | main(int argc, char *argv[])
462                  double          sda, sta;
463                                          /* make space for next time step */
464                  mtx_offset = 3*nskypatch*ntsteps++;
465 <                mtx_data = resize_dmatrix(mtx_data, ntsteps, nskypatch);
465 >                if (ntsteps > step_alloc) {
466 >                        step_alloc += (step_alloc>>1) + ntsteps + 7;
467 >                        mtx_data = resize_dmatrix(mtx_data, step_alloc, nskypatch);
468 >                }
469                  if (dif <= 1e-4) {
470                          memset(mtx_data+mtx_offset, 0, sizeof(float)*3*nskypatch);
471                          continue;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines