annotate osdep/swab.c @ 16593:1c13fb2ba5a9

Allow specifying a custom (ppm) texture for texture unit 3
author reimar
date Sun, 25 Sep 2005 16:31:58 +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