xref: /original-bsd/old/lib2648/emptyrow.c (revision a9c19d04)
1 /*
2  * Copyright (c) 1980 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  */
6 
7 #ifndef lint
8 static char sccsid[] = "@(#)emptyrow.c	5.1 (Berkeley) 04/30/85";
9 #endif not lint
10 
11 /*
12  * emptyrow: returns true if row r of m is all zeros.
13  *
14  * Note that we assume the garbage at the end of the
15  * row is all zeros.
16  */
17 
18 #include "bit.h"
19 
20 emptyrow(m, rows, cols, r)
21 bitmat m;
22 int rows, cols, r;
23 {
24 	char *top, *bot;
25 
26 	bot = &m[r*((cols+7)>>3)];
27 	top = bot + ((cols-1) >> 3);
28 	while (bot <= top)
29 		if (*bot++)
30 			return(0);
31 	return (1);
32 }
33