source:
trunk/sys/dietlibc/swab.c
@
189
Last change on this file since 189 was 1, checked in by , 8 years ago | |
---|---|
File size: 212 bytes |
Line | |
---|---|
1 | #include <unistd.h> |
2 | |
3 | void swab(const void *src, void *dest, ssize_t nbytes) |
4 | { |
5 | ssize_t i; |
6 | const char *s=src; |
7 | char *d=dest; |
8 | nbytes&=~1; |
9 | for (i=0; i<nbytes; i+=2) { |
10 | d[i]=s[i+1]; |
11 | d[i+1]=s[i]; |
12 | } |
13 | } |
Note: See TracBrowser
for help on using the repository browser.