Changeset 228 for soft/giet_vm/libs/utils.c
- Timestamp:
- Feb 12, 2013, 6:33:31 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/libs/utils.c
r201 r228 4 4 // GCC requires this function. Taken from MutekH. 5 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) ) 6 void * memcpy(void *_dst, const void * _src, unsigned int size) { 7 unsigned int * dst = _dst; 8 const unsigned int * src = _src; 9 if (!((unsigned int) dst & 3) && ! ((unsigned int) src & 3) ) { 11 10 while (size > 3) { 12 11 *dst++ = *src++; 13 12 size -= 4; 14 13 } 14 } 15 15 16 unsigned char * cdst = (unsigned char*)dst;17 unsigned char * csrc = (unsigned char*)src;16 unsigned char * cdst = (unsigned char *) dst; 17 unsigned char * csrc = (unsigned char *) src; 18 18 19 19 while (size--) { … … 23 23 } 24 24 25 25 26 //////////////////////////////////////////////////////////////////////////////////////// 26 27 // memset() 27 28 // GCC requires this function. Taken from MutekH. 28 29 //////////////////////////////////////////////////////////////////////////////////////// 29 void * memset(void * dst, int s, unsigned int count)30 { 31 char *a = (char *) dst; 32 while (count--) 33 *a++ = (char)s; 34 30 void * memset(void * dst, int s, unsigned int count) { 31 char * a = (char *) dst; 32 while (count--) { 33 *a++ = (char) s; 34 } 35 return dst; 35 36 } 37 38 39 // Local Variables: 40 // tab-width: 4 41 // c-basic-offset: 4 42 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 43 // indent-tabs-mode: nil 44 // End: 45 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 46
Note: See TracChangeset
for help on using the changeset viewer.