projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
4.3BSD beta release manual page
[unix-history]
/
usr
/
src
/
lib
/
libc
/
string
/
swab.c
/* swab.c 4.2 83/06/27 */
/*
* Swab bytes
* Jeffrey Mogul, Stanford
*/
swab
(
from
,
to
,
n
)
register
char
*
from
, *
to
;
register
int
n
;
{
register
unsigned long
temp
;
n
>>=
1
;
n
++;
#define STEP temp = *from++,*to++ = *from++,*to++ = temp
/* round to multiple of 8 */
while
((--
n
) &
07
)
STEP
;
n
>>=
3
;
while
(--
n
>=
0
) {
STEP
;
STEP
;
STEP
;
STEP
;
STEP
;
STEP
;
STEP
;
STEP
;
}
}