annotate osdep/swab.c @ 14938:25df9508f9a8

Mark modified files as such to comply more closely with GPL ¡ø2a.
author diego
date Fri, 11 Mar 2005 02:40:28 +0000
parents c0bde085511c
children 08cac43f1e38
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13612
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
1 #include "../config.h"
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
2
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
3 #ifndef HAVE_SWAB
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
4 /* system has no swab. emulate via bswap */
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
5 #include "../bswap.h"
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
6 #include <unistd.h>
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
7
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
8 void swab(const void *from, void *to, ssize_t n) {
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
9 const int16_t *in = (int16_t*)from;
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
10 int16_t *out = (int16_t*)to;
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
11 int i;
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
12 n /= 2;
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
13 for (i = 0 ; i < n; i++) {
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
14 out[i] = bswap_16(in[i]);
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
15 }
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
16 }
c0bde085511c Zeta OS support, mostly working.
reimar
parents:
diff changeset
17 #endif