Annotation of researchv10no/cmd/sum/sum5.c, revision 1.1

1.1     ! root        1: #define                BSIZE           512             /* system 5 */
        !             2: 
        !             3: int
        !             4: sum5(register long sum, char *buf, int n)
        !             5: {
        !             6:        register unsigned char *s, *send;
        !             7: 
        !             8:        if(buf == 0){
        !             9:                sum = ((sum>>16)+sum&0xFFFF)&0xFFFF;
        !            10:                printf("%05u%6ld", sum, (n + (BSIZE - 1)) / BSIZE);
        !            11:                return(0);
        !            12:        }
        !            13:        for(s = (unsigned char *)buf, send = s+n; s < send; s++)
        !            14:                sum += 0xffff & *s;
        !            15:        return(sum);
        !            16: }

unix.superglobalmegacorp.com

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