BSD 4_3_Reno release
[unix-history] / usr / src / old / lib2648 / emptyrow.c
CommitLineData
051b1e55
DF
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
95f51977 8static char sccsid[] = "@(#)emptyrow.c 5.1 (Berkeley) 4/30/85";
051b1e55
DF
9#endif not lint
10
4baffcae
RC
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
20emptyrow(m, rows, cols, r)
21bitmat m;
22int 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}