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