|
|
1.1 root 1: /* swab.c 4.2 83/06/27 */
2:
3: /*
4: * Swab bytes
5: * Jeffrey Mogul, Stanford
6: */
7:
8: swab(from, to, n)
9: register char *from, *to;
10: register int n;
11: {
12: register unsigned long temp;
13:
14: n >>= 1; n++;
15: #define STEP temp = *from++,*to++ = *from++,*to++ = temp
16: /* round to multiple of 8 */
17: while ((--n) & 07)
18: STEP;
19: n >>= 3;
20: while (--n >= 0) {
21: STEP; STEP; STEP; STEP;
22: STEP; STEP; STEP; STEP;
23: }
24: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.