⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memcpy.c

📁 microwindows移植到S3C44B0的源码
💻 C
字号:
#include <linux/types.h>#include <linux/autoconf.h>void * memcpy(void * to, const void * from, size_t n){#ifdef CONFIG_COLDFIRE  void *xto = to;  size_t temp;  if (!n)    return xto;  if ((long) to & 1)    {      char *cto = to;      const char *cfrom = from;      *cto++ = *cfrom++;      to = cto;      from = cfrom;      n--;    }  if (n > 2 && (long) to & 2)    {      short *sto = to;      const short *sfrom = from;      *sto++ = *sfrom++;      to = sto;      from = sfrom;      n -= 2;    }  temp = n >> 2;  if (temp)    {      long *lto = to;      const long *lfrom = from;      for (; temp; temp--)	*lto++ = *lfrom++;      to = lto;      from = lfrom;    }  if (n & 2)    {      short *sto = to;      const short *sfrom = from;      *sto++ = *sfrom++;      to = sto;      from = sfrom;    }  if (n & 1)    {      char *cto = to;      const char *cfrom = from;      *cto = *cfrom;    }  return xto;#else  const char *c_from = from;  char *c_to = to;  while (n-- > 0)    *c_to++ = *c_from++;  return((void *) to);#endif}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -