ReactOS  0.4.13-dev-100-gc8611ae
memcpy.c File Reference
#include <string.h>
Include dependency graph for memcpy.c:

Go to the source code of this file.

Functions

void *__cdecl memcpy (void *dest, const void *src, size_t count)
 

Function Documentation

◆ memcpy()

void* __cdecl memcpy ( void dest,
const void src,
size_t  count 
)

Definition at line 8 of file memcpy.c.

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 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum src
Definition: glext.h:6340
static char * dest
Definition: rtl.c:135