OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [newlib/] [newlib/] [newlib/] [libc/] [string/] [strcpy.c] - Diff between revs 39 and 56

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 39 Rev 56
Line 60... Line 60...
char*
char*
_DEFUN (strcpy, (dst0, src0),
_DEFUN (strcpy, (dst0, src0),
        char *dst0 _AND
        char *dst0 _AND
        _CONST char *src0)
        _CONST char *src0)
{
{
#ifdef PREFER_SIZE_OVER_SPEED
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
  char *s = dst0;
  char *s = dst0;
 
 
  while (*dst0++ = *src0++)
  while (*dst0++ = *src0++)
    ;
    ;
 
 
Line 74... Line 74...
  _CONST char *src = src0;
  _CONST char *src = src0;
  long *aligned_dst;
  long *aligned_dst;
  _CONST long *aligned_src;
  _CONST long *aligned_src;
 
 
  /* If SRC or DEST is unaligned, then copy bytes.  */
  /* If SRC or DEST is unaligned, then copy bytes.  */
  if (UNALIGNED (src, dst))
  if (!UNALIGNED (src, dst))
    {
    {
      while (*dst++ = *src++)
 
        ;
 
      return dst0;
 
    }
 
 
 
  aligned_dst = (long*)dst;
  aligned_dst = (long*)dst;
  aligned_src = (long*)src;
  aligned_src = (long*)src;
 
 
  /* SRC and DEST are both "long int" aligned, try to do "long int"
  /* SRC and DEST are both "long int" aligned, try to do "long int"
     sized copies.  */
     sized copies.  */
Line 93... Line 88...
      *aligned_dst++ = *aligned_src++;
      *aligned_dst++ = *aligned_src++;
    }
    }
 
 
  dst = (char*)aligned_dst;
  dst = (char*)aligned_dst;
  src = (char*)aligned_src;
  src = (char*)aligned_src;
 
    }
 
 
  while (*dst++ = *src++)
  while (*dst++ = *src++)
    ;
    ;
  return dst0;
  return dst0;
#endif /* not PREFER_SIZE_OVER_SPEED */
#endif /* not PREFER_SIZE_OVER_SPEED */

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.