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

Comparing ray/src/util/rttree_reduce.c (file contents):
Revision 2.12 by greg, Wed Aug 12 00:10:51 2015 UTC vs.
Revision 2.16 by greg, Thu Aug 18 00:52:48 2016 UTC

# Line 44 | Line 44 | double tthresh;                /* acceptance threshold (TBD) */
44   static void
45   new_kids(TNODE *pn)
46   {
47 <        pn->kid = (TNODE *)calloc(1<<ttrank, sizeof(TNODE));
47 >        pn->kid = (TNODE *)calloc((size_t)1<<ttrank, sizeof(TNODE));
48          if (pn->kid == NULL)
49                  error(SYSTEM, "out of memory in new_kids");
50   }
# Line 201 | Line 201 | read_float(float *rowp, int n)
201  
202          if ((rowp == NULL) | (n <= 0))
203                  return(0);
204 <        nread = fread(rowp, sizeof(float), n, stdin);
204 >        nread = getbinary(rowp, sizeof(float), n, stdin);
205          if (nread != n)
206                  error(USER, "unexpected EOF on float input");
207          return(nread);
# Line 227 | Line 227 | read_double(float *rowp, int n)
227                  if (rowbuf == NULL)
228                          error(SYSTEM, "out of memory in read_double");
229          }
230 <        nread = fread(rowbuf, sizeof(double), n, stdin);
230 >        nread = getbinary(rowbuf, sizeof(double), n, stdin);
231          if (nread != n)
232                  error(USER, "unexpected EOF on double input");
233          for (i = 0; i < nread; i++)
# Line 276 | Line 276 | load_data(void)
276                  error(COMMAND, "unsupported input format");
277                  break;
278          }
279 <        datarr = (float *)calloc(1<<(log2g*ttrank), sizeof(float));
279 >        datarr = (float *)calloc((size_t)1<<(log2g*ttrank), sizeof(float));
280          if (datarr == NULL)
281                  error(SYSTEM, "out of memory in load_data");
282          if (ttrank == 3) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines