1
0
Fork 0
forked from len0rd/rockbox
foxbox/firmware/common/string.c
Daniel Stenberg 39fb8f0705 Jean-Philippe Bernardy: C versions of memset() and memcpy() for archs with
no asm optimized versions.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5550 a1c6a512-1295-4272-9138-f99709370657
2005-01-10 21:31:13 +00:00

19 lines
410 B
C

/* For archs that lack assembly optimized versions of those */
#include "string.h"
_PTR _EXFUN(memset,(_PTR, int, size_t));
_PTR memset(_PTR data, int val, size_t count)
{
for (int i=0; i < count; i++)
((char*)data)[i] = val;
return data;
}
_PTR memcpy(_PTR dst, const _PTR src, size_t count)
{
for (int i=0; i < count; i++)
((char*)dst)[i] = ((char*)src)[i];
return dst;
}