--- ray/src/util/rmatrix.h 2017/08/28 15:59:46 2.8 +++ ray/src/util/rmatrix.h 2019/09/03 23:43:07 2.11 @@ -1,4 +1,4 @@ -/* RCSid $Id: rmatrix.h,v 2.8 2017/08/28 15:59:46 greg Exp $ */ +/* RCSid $Id: rmatrix.h,v 2.11 2019/09/03 23:43:07 greg Exp $ */ /* * Header file for general matrix routines. */ @@ -14,13 +14,15 @@ extern "C" { /* General plane-ordered component matrix */ typedef struct { - int nrows, ncols, ncomp; - int dtype; + int nrows, ncols; + short ncomp; + uby8 dtype; + uby8 swapin; char *info; double mtx[1]; /* extends struct */ } RMATRIX; -#define rmx_lval(rm,r,c,i) (rm)->mtx[(i)+(rm)->ncomp*((c)+(rm)->ncols*(r))] +#define rmx_lval(rm,r,c,i) (rm)->mtx[(i)+(rm)->ncomp*((c)+(size_t)(rm)->ncols*(r))] /* Allocate a nr x nc matrix with n components */ extern RMATRIX *rmx_alloc(int nr, int nc, int n);