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

Comparing ray/src/util/cmatrix.c (file contents):
Revision 2.14 by greg, Tue Feb 2 18:02:32 2016 UTC vs.
Revision 2.15 by greg, Wed Feb 17 23:26:06 2016 UTC

# Line 148 | Line 148 | cm_getheader(int *dt, int *nr, int *nc, FILE *fp)
148   CMATRIX *
149   cm_load(const char *inspec, int nrows, int ncols, int dtype)
150   {
151 <        FILE    *fp = stdin;
152 <        CMATRIX *cm;
151 >        const int       ROWINC = 2048;
152 >        FILE            *fp = stdin;
153 >        CMATRIX         *cm;
154  
155          if (inspec == NULL)
156                  inspec = "<stdin>";
# Line 218 | Line 219 | cm_load(const char *inspec, int nrows, int ncols, int
219                  int     r, c;
220                  for (r = 0; r < maxrow; r++) {
221                      if (r >= cm->nrows)                 /* need more space? */
222 <                        cm = cm_resize(cm, 2*cm->nrows);
222 >                        cm = cm_resize(cm, cm->nrows+ROWINC);
223                      for (c = 0; c < ncols; c++) {
224                          COLORV  *cv = cm_lval(cm,r,c);
225                          if (fscanf(fp, COLSPEC, cv, cv+1, cv+2) != 3) {
# Line 249 | Line 250 | cm_load(const char *inspec, int nrows, int ncols, int
250                                  if (nrows <= 0) {       /* unknown length */
251                                          if (nread == cm->nrows*cm->ncols)
252                                                          /* need more space? */
253 <                                                cm = cm_resize(cm, 2*cm->nrows);
253 >                                                cm = cm_resize(cm, cm->nrows+ROWINC);
254                                          else if (nread && !(nread % cm->ncols))
255                                                          /* seem to be  done */
256                                                  cm = cm_resize(cm, nread/cm->ncols);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines