|
|
1.1 root 1: /*
2: * miscellany
3: */
4:
5: #include "defs.h"
6:
7: /*
8: * swap bytes
9: */
10:
11: unsigned short
12: swab(s)
13: short s;
14: {
15: return (((s >> 8) & 0xff) | ((s & 0xff) << 8));
16: }
17:
18: /*
19: * swap bytes in a long
20: */
21:
22: long
23: swal(l)
24: long l;
25: {
26: return (swab((short)(l >> 16)) | (swab((short)l) << 16));
27: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.