Annotation of 43BSD/usr.lib/lib2648/emptyrow.c, revision 1.1

1.1     ! root        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) 4/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: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.