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