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.15 by greg, Tue Jun 17 18:51:47 2014 UTC

# Line 457 | Line 457 | main(int argc, char *argv[])
457          s_meridian = DegToRad(s_meridian);
458                                          /* process each time step in tape */
459          while (scanf("%d %d %lf %lf %lf\n", &mo, &da, &hr, &dir, &dif) == 5) {
460 +                static int      step_alloc = 0;
461                  double          sda, sta;
462                                          /* make space for next time step */
463                  mtx_offset = 3*nskypatch*ntsteps++;
464 <                mtx_data = resize_dmatrix(mtx_data, ntsteps, nskypatch);
464 >                if (ntsteps > step_alloc) {
465 >                        step_alloc += step_alloc>>1 + 8;
466 >                        mtx_data = resize_dmatrix(mtx_data, step_alloc, nskypatch);
467 >                }
468                  if (dif <= 1e-4) {
469                          memset(mtx_data+mtx_offset, 0, sizeof(float)*3*nskypatch);
470                          continue;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines