Annotation of researchv10no/cmd/asd++/checksum.c, revision 1.1.1.1

1.1       root        1: #include "decl.h"
                      2: 
                      3: checksum::
                      4: checksum()
                      5: {
                      6:        bufend = buf + cksize;
                      7:        bufptr = buf;
                      8:        char *p = buf;
                      9:        while (p < bufend)
                     10:                *p++ = '?';
                     11: }
                     12: 
                     13: void checksum::
                     14: combine (char* adr, int len)
                     15: {
                     16:        register char *p = bufptr, *q = adr;
                     17:        register int n = len;
                     18: 
                     19:        while (--n >= 0) {
                     20:                *p++ ^= *q++;
                     21:                if (p >= bufend)
                     22:                        p = buf;
                     23:        }
                     24: 
                     25:        bufptr = p;
                     26: }
                     27: 
                     28: int checksum::
                     29: operator== (checksum& c)
                     30: {
                     31:        register int n = cksize;
                     32: 
                     33:        while (--n >= 0) {
                     34:                if (buf[n] != c.buf[n])
                     35:                        return 0;
                     36:        }
                     37:        return 1;
                     38: }

unix.superglobalmegacorp.com

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