|
|
1.1 ! root 1: #if defined(LIBC_SCCS) && !defined(lint) ! 2: static char sccsid[] = "@(#)swab.c 5.3 (Berkeley) 3/9/86"; ! 3: #endif LIBC_SCCS and not lint ! 4: ! 5: /* ! 6: * Swab bytes ! 7: * Jeffrey Mogul, Stanford ! 8: */ ! 9: ! 10: swab(from, to, n) ! 11: register char *from, *to; ! 12: register int n; ! 13: { ! 14: register unsigned long temp; ! 15: ! 16: n >>= 1; n++; ! 17: #define STEP temp = *from++,*to++ = *from++,*to++ = temp ! 18: /* round to multiple of 8 */ ! 19: while ((--n) & 07) ! 20: STEP; ! 21: n >>= 3; ! 22: while (--n >= 0) { ! 23: STEP; STEP; STEP; STEP; ! 24: STEP; STEP; STEP; STEP; ! 25: } ! 26: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.