Root/
Source at commit 728 created 13 years 4 months ago. By meklort, Updated Symbols.dylib generation. Module linked list rework beginning. USB Legacy off patch still needs fixing. Added a new tool to generate the symbols.dylib. It's a fairly correct dylib file, however nm complains about it (it still works fine though). Updated Symbols.dylib file is smaller (~13%) that the old method and is a bit cleaner. dylib generation needs a bit of cleaning up though) | |
---|---|
1 | /*␊ |
2 | * memswap()␊ |
3 | *␊ |
4 | * Swaps the contents of two nonoverlapping memory areas.␊ |
5 | * This really could be done faster...␊ |
6 | */␊ |
7 | ␊ |
8 | #include <string.h>␊ |
9 | ␊ |
10 | void memswap(void *m1, void *m2, size_t n)␊ |
11 | {␊ |
12 | ␉char *p = m1;␊ |
13 | ␉char *q = m2;␊ |
14 | ␉char tmp;␊ |
15 | ␊ |
16 | ␉while (n--) {␊ |
17 | ␉␉tmp = *p;␊ |
18 | ␉␉*p = *q;␊ |
19 | ␉␉*q = tmp;␊ |
20 | ␊ |
21 | ␉␉p++;␊ |
22 | ␉␉q++;␊ |
23 | ␉}␊ |
24 | }␊ |
25 |