Commit | Line | Data |
---|---|---|
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 | |
8 | static char sccsid[] = "@(#)emptyrow.c 5.1 (Berkeley) %G%"; | |
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 | ||
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 | } |