ReactOS 0.4.16-dev-109-gf4cb10f
memmove.c
Go to the documentation of this file.
1#include <string.h>
2
3#if defined(_MSC_VER) && (_MSC_VER >= 1910 || !defined(_WIN64))
4#pragma function(memmove)
5#endif /* _MSC_VER */
6
7/* NOTE: This code is duplicated in memcpy function */
8void * __cdecl memmove(void *dest,const void *src,size_t count)
9{
10 char *char_dest = (char *)dest;
11 char *char_src = (char *)src;
12
13 if ((char_dest <= char_src) || (char_dest >= (char_src+count)))
14 {
15 /* non-overlapping buffers */
16 while(count > 0)
17 {
18 *char_dest = *char_src;
19 char_dest++;
20 char_src++;
21 count--;
22 }
23 }
24 else
25 {
26 /* overlaping buffers */
27 char_dest = (char *)dest + count - 1;
28 char_src = (char *)src + count - 1;
29
30 while(count > 0)
31 {
32 *char_dest = *char_src;
33 char_dest--;
34 char_src--;
35 count--;
36 }
37 }
38
39 return dest;
40}
#define __cdecl
Definition: accygwin.h:79
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum src
Definition: glext.h:6340
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static char * dest
Definition: rtl.c:135