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

Comparing ray/src/util/rmatrix.c (file contents):
Revision 2.41 by greg, Thu Mar 26 18:01:26 2020 UTC vs.
Revision 2.45 by greg, Fri Jan 15 02:46:28 2021 UTC

# Line 24 | Line 24 | rmx_alloc(int nr, int nc, int n)
24          if ((nr <= 0) | (nc <= 0) | (n <= 0))
25                  return(NULL);
26          dnew = (RMATRIX *)malloc(sizeof(RMATRIX)-sizeof(dnew->mtx) +
27 <                                        sizeof(dnew->mtx[0])*(n*nr*nc));
27 >                                        sizeof(dnew->mtx[0])*n*nr*nc);
28          if (!dnew)
29                  return(NULL);
30          dnew->nrows = nr; dnew->ncols = nc; dnew->ncomp = n;
# Line 163 | Line 163 | rmx_load_double(RMATRIX *rm, FILE *fp)
163   {
164          int     i;
165  
166 <        if (&rmx_lval(rm,0,0,0) - &rmx_lval(rm,1,0,0) !=
167 <                                sizeof(double)*rm->ncols*rm->ncomp) {
166 >        if ((char *)&rmx_lval(rm,1,0,0) - (char *)&rmx_lval(rm,0,0,0) !=
167 >                                        sizeof(double)*rm->ncols*rm->ncomp) {
168                  fputs("Code error in rmx_load_double()\n", stderr);
169                  exit(1);
170          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines