mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 12:02:02 +00:00
Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys.
This commit is contained in:
parent
b94e2d8ca0
commit
c2c66aff7d
24198 changed files with 0 additions and 37285 deletions
40
sdk/lib/crt/mem/memcpy.c
Normal file
40
sdk/lib/crt/mem/memcpy.c
Normal file
|
@ -0,0 +1,40 @@
|
|||
#include <string.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma function(memcpy)
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* NOTE: This code is a duplicate of memmove implementation! */
|
||||
void* __cdecl memcpy(void* dest, const void* src, size_t count)
|
||||
{
|
||||
char *char_dest = (char *)dest;
|
||||
char *char_src = (char *)src;
|
||||
|
||||
if ((char_dest <= char_src) || (char_dest >= (char_src+count)))
|
||||
{
|
||||
/* non-overlapping buffers */
|
||||
while(count > 0)
|
||||
{
|
||||
*char_dest = *char_src;
|
||||
char_dest++;
|
||||
char_src++;
|
||||
count--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* overlaping buffers */
|
||||
char_dest = (char *)dest + count - 1;
|
||||
char_src = (char *)src + count - 1;
|
||||
|
||||
while(count > 0)
|
||||
{
|
||||
*char_dest = *char_src;
|
||||
char_dest--;
|
||||
char_src--;
|
||||
count--;
|
||||
}
|
||||
}
|
||||
|
||||
return dest;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue