Lines Matching refs:sum
347 int c, sum, nl, len; local
361 sum = fchksum;
364 if (sum & 0x8000) {
365 sum <<= 1;
366 sum++;
368 sum <<= 1;
369 sum += c;
370 sum &= 0xffff;
416 sprintf(op, "\176\176%04x\r", sum);
420 fchksum = sum;
434 int sum, len, nl; local
454 sum = fchksum;
480 DEBUG(8, "\nchecksum: %04x\n", sum);
481 if (fchksum == sum)
516 if (sum & 0x8000) {
517 sum <<= 1;
518 sum++;
520 sum <<= 1;
521 sum += c & 0377;
522 sum &= 0xffff;
527 fchksum = sum;