* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)setmat.c 5.1 (Berkeley) %G%";
* setmat: set the value in m[r, c] to nval.
setmat(m
, rows
, cols
, r
, c
, nval
)
int rows
, cols
, r
, c
, nval
;
register int offset
, thisbit
;
if (r
<0 || c
<0 || r
>=rows
|| c
>=cols
) {
fprintf(trace
, "setmat range error: (%d, %d) <- %d in a (%d, %d) matrix %x\n", r
, c
, nval
, rows
, cols
, m
);
offset
= r
*((cols
+7)>>3) + (c
>>3);