home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V7 / usr / src / libc / gen / swab.c < prev    next >
Encoding:
Text File  |  1979-01-10  |  233 b   |  17 lines

  1. /*
  2.  * Swap bytes in 16-bit [half-]words
  3.  * for going between the 11 and the interdata
  4.  */
  5.  
  6. swab(pf, pt, n)
  7. register short *pf, *pt;
  8. register n;
  9. {
  10.  
  11.     n /= 2;
  12.     while (--n >= 0) {
  13.         *pt++ = (*pf << 8) + ((*pf >> 8) & 0377);
  14.         pf++;
  15.     }
  16. }
  17.