Changeset 352 for soft/giet_vm/giet_libs/stdlib.c
- Timestamp:
- Jun 29, 2014, 1:16:24 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/stdlib.c
r271 r352 37 37 // GCC requires this function. Taken from MutekH. 38 38 //////////////////////////////////////////////////////////////////////////////////////// 39 void * memcpy(void *_dst, const void * _src, unsigned int size) { 39 void * memcpy(void *_dst, const void * _src, unsigned int size) 40 { 40 41 unsigned int * dst = _dst; 41 42 const unsigned int * src = _src; 42 43 if (!((unsigned int) dst & 3) && !((unsigned int) src & 3) ) 43 while (size > 3) { 44 { 45 while (size > 3) 46 { 44 47 *dst++ = *src++; 45 48 size -= 4; 46 49 } 50 } 47 51 48 52 unsigned char *cdst = (unsigned char*)dst; 49 53 unsigned char *csrc = (unsigned char*)src; 50 54 51 while (size--) { 55 while (size--) 56 { 52 57 *cdst++ = *csrc++; 53 58 } … … 57 62 58 63 //////////////////////////////////////////////////////////////////////////////////////// 59 // mem pcy()64 // memset() 60 65 // GCC requires this function. Taken from MutekH. 61 66 //////////////////////////////////////////////////////////////////////////////////////// 62 inline void * memset(void * dst, int s, unsigned int count) { 67 inline void * memset(void * dst, int s, unsigned int count) 68 { 63 69 char * a = (char *) dst; 64 while (count--){ 70 while (count--) 71 { 65 72 *a++ = (char)s; 66 73 }
Note: See TracChangeset
for help on using the changeset viewer.