question about checksum.c

Zheng Yuan {ZYUAN1} zyuan1 at cig.mot.com
Tue Feb 20 21:12:51 CET 2001


Hi all

In the func ipsum_calc_block(u16 *x, unsigned len, u16 sum)

  ASSERT(!(len % 2));
  if (!len)
    return sum;
  len >>= 1;
  if ((unsigned long) x & 2)  /* Align to 32-bit boundary, use x's address */
    {
      sum = add16(sum, *x++);
      len--;
    }
  rest = len & 1;
  len >>= 1;
  tmp = 0;
  xx = (u32 *) x;

Why do we have two len >>= 1; i understand it will change the xx to move
32 bits one time. Isnt that the first one redundant?




More information about the Bird-users mailing list