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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [bootloaders/] [orpmon/] [common/] [string.c] - Diff between revs 2 and 140

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

Rev 2 Rev 140
Line 195... Line 195...
  }
  }
 
 
  return dest;
  return dest;
}
}
 
 
 
/* memcpy, return  checksum of bytes copied instead of pointer to dest */
 
unsigned char memcpy_crc(void *dest, const void *src, size_t n)
 
{
 
  unsigned char sum = 0;
 
  unsigned char tmp;
 
 
 
  char *cs = (char *) src;
 
  char *cd = (char *) dest;
 
 
 
  while (n--)
 
    {
 
      tmp = *cs++;
 
      sum += tmp;
 
      *cd++ = tmp;
 
    }
 
  return sum;
 
}
 
 
void *memmove(void *dest, void *src, size_t n)
void *memmove(void *dest, void *src, size_t n)
{
{
  char *d = dest;
  char *d = dest;
  char *s = src;
  char *s = src;
Line 222... Line 239...
 
 
  return *p1 - *p2;
  return *p1 - *p2;
}
}
 
 
 
 
void *memchr(const void *s, int c, size_t n)
void *memchr(const void *s, char c, size_t n)
{
{
  char *p = (void *)s;
  char *p = (void *)s;
 
 
  /* search for the character c */
  /* search for the character c */
  while ( (*p != c) && n-- )
  while ( (*p != c) && n-- )

powered by: WebSVN 2.1.0

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