xref: /original-bsd/old/lib2648/emptyrow.c (revision f82e54c4)
1 /*	emptyrow.c	4.1	83/03/09	*/
2 /*
3  * emptyrow: returns true if row r of m is all zeros.
4  *
5  * Note that we assume the garbage at the end of the
6  * row is all zeros.
7  */
8 
9 #include "bit.h"
10 
11 emptyrow(m, rows, cols, r)
12 bitmat m;
13 int rows, cols, r;
14 {
15 	char *top, *bot;
16 
17 	bot = &m[r*((cols+7)>>3)];
18 	top = bot + ((cols-1) >> 3);
19 	while (bot <= top)
20 		if (*bot++)
21 			return(0);
22 	return (1);
23 }
24