repo.or.cz
/
mplayer
/
greg.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
missing dot
[mplayer/greg.git]
/
osdep
/
swab.c
blob
1b0f2f172bc1fcc615835a215e82d190340c4624
1
#include
"config.h"
2
3
#ifndef HAVE_SWAB
4
/* system has no swab. emulate via bswap */
5
#include
"bswap.h"
6
#include <unistd.h>
7
8
void
swab
(
const void
*
from
,
void
*
to
,
ssize_t n
) {
9
const int16_t
*
in
= (
int16_t
*)
from
;
10
int16_t
*
out
= (
int16_t
*)
to
;
11
int
i
;
12
n
/=
2
;
13
for
(
i
=
0
;
i
<
n
;
i
++) {
14
out
[
i
] =
bswap_16
(
in
[
i
]);
15
}
16
}
17
#endif