Rev | Line | |
---|
[160] | 1 | |
---|
| 2 | //////////////////////////////////////////////////////////////////////////////////////// |
---|
| 3 | // mempcy() |
---|
| 4 | // GCC requires this function. Taken from MutekH. |
---|
| 5 | //////////////////////////////////////////////////////////////////////////////////////// |
---|
| 6 | void *memcpy(void *_dst, const void *_src, unsigned int size) |
---|
| 7 | { |
---|
| 8 | unsigned int *dst = _dst; |
---|
| 9 | const unsigned int *src = _src; |
---|
| 10 | if ( ! ((unsigned int)dst & 3) && ! ((unsigned int)src & 3) ) |
---|
| 11 | while (size > 3) { |
---|
| 12 | *dst++ = *src++; |
---|
| 13 | size -= 4; |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | unsigned char *cdst = (unsigned char*)dst; |
---|
| 17 | unsigned char *csrc = (unsigned char*)src; |
---|
| 18 | |
---|
| 19 | while (size--) { |
---|
| 20 | *cdst++ = *csrc++; |
---|
| 21 | } |
---|
| 22 | return _dst; |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | //////////////////////////////////////////////////////////////////////////////////////// |
---|
| 26 | // mempcy() |
---|
| 27 | // GCC requires this function. Taken from MutekH. |
---|
| 28 | //////////////////////////////////////////////////////////////////////////////////////// |
---|
| 29 | inline void * memset(void *dst, int s, unsigned int count) |
---|
| 30 | { |
---|
| 31 | char *a = (char *) dst; |
---|
| 32 | while (count--) |
---|
| 33 | *a++ = (char)s; |
---|
| 34 | return dst; |
---|
| 35 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.