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

Subversion Repositories plasma

[/] [plasma/] [trunk/] [kernel/] [libc.c] - Diff between revs 432 and 436

Show entire file | Details | Blame | View Log

Rev 432 Rev 436
Line 59... Line 59...
      c = *dst++ = *src++;
      c = *dst++ = *src++;
   *dst = 0;
   *dst = 0;
   return dstSave;
   return dstSave;
}
}
 
 
 
#ifdef STRNCAT_SIZE
 
char *strncat_size(char *dst, const char *src, int sizeDst)
 
{
 
   int c=1;
 
   char *dstSave=dst;
 
   while(*dst)
 
      ++dst;
 
   sizeDst -= dst - dstSave;
 
   while(--sizeDst > 0 && c)
 
      c = *dst++ = *src++;
 
   *dst = 0;
 
   return dstSave;
 
}
 
#endif
 
 
int strcmp(const char *string1, const char *string2)
int strcmp(const char *string1, const char *string2)
{
{
   int diff, c;
   int diff, c;
   for(;;)
   for(;;)
Line 181... Line 195...
   return n>=0 ? n : -n;
   return n>=0 ? n : -n;
}
}
 
 
 
 
static uint32 Rand1=0x1f2bcda3;
static uint32 Rand1=0x1f2bcda3;
unsigned int rand(void)
int rand(void)
{
{
   Rand1 = 1664525 * Rand1 + 1013904223;  //from D.E. Knuth and H.W. Lewis
   Rand1 = 1664525 * Rand1 + 1013904223;  //from D.E. Knuth and H.W. Lewis
   return Rand1 << 16 | Rand1 >> 16;
   return Rand1 << 16 | Rand1 >> 16;
}
}
 
 

powered by: WebSVN 2.1.0

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