public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cd0573a
)
libc: add new swab.c file
author
Alan Cox
<alan@etchedpixels.co.uk>
Wed, 21 Oct 2015 20:53:41 +0000
(21:53 +0100)
committer
Alan Cox
<alan@etchedpixels.co.uk>
Wed, 21 Oct 2015 20:53:41 +0000
(21:53 +0100)
Library/libs/swab.c
[new file with mode: 0644]
patch
|
blob
diff --git a/Library/libs/swab.c
b/Library/libs/swab.c
new file mode 100644
(file)
index 0000000..
17f7235
--- /dev/null
+++ b/
Library/libs/swab.c
@@ -0,0
+1,13
@@
+#include <unistd.h>
+
+void swab(const void *from, void *to, ssize_t n)
+{
+ const uint8_t *f = from;
+ uint8_t *t = to;
+ n >>= 1;
+ while(n--) {
+ *t++ = f[1];
+ *t++ = *f;
+ f += 2;
+ }
+}