Lines Matching refs:sum
349 int c, sum, nl, len; local
363 sum = fchksum;
366 if (sum & 0x8000) {
367 sum <<= 1;
368 sum++;
370 sum <<= 1;
371 sum += c;
372 sum &= 0xffff;
418 sprintf(op, "\176\176%04x\r", sum);
422 fchksum = sum;
436 int sum, len, nl; local
456 sum = fchksum;
482 DEBUG(8, "\nchecksum: %04x\n", sum);
483 if (fchksum == sum)
518 if (sum & 0x8000) {
519 sum <<= 1;
520 sum++;
522 sum <<= 1;
523 sum += c & 0377;
524 sum &= 0xffff;
529 fchksum = sum;