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

Subversion Repositories plasma

[/] [plasma/] [trunk/] [kernel/] [libc.c] - Diff between revs 379 and 399

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

Rev 379 Rev 399
Line 52... Line 52...
 
 
char *strncat(char *dst, const char *src, int count)
char *strncat(char *dst, const char *src, int count)
{
{
   int c=1;
   int c=1;
   char *dstSave=dst;
   char *dstSave=dst;
   while(*dst && --count > 0)
   while(*dst)
      ++dst;
      ++dst;
   while(--count > 0 && c)
   while(--count >= 0 && c)
      c = *dst++ = *src++;
      c = *dst++ = *src++;
   *dst = 0;
   *dst = 0;
   return dstSave;
   return dstSave;
}
}
 
 
Line 181... Line 181...
{
{
   return n>=0 ? n : -n;
   return n>=0 ? n : -n;
}
}
 
 
 
 
 
#ifndef _LIBC
static uint32 Rand1=0x1f2bcda3;
static uint32 Rand1=0x1f2bcda3;
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;
   return Rand1;
Line 400... Line 401...
         if(*s)
         if(*s)
            ++s;
            ++s;
      }
      }
   }
   }
}
}
 
#endif //_LIBC
 
 
 
 
#ifdef INCLUDE_DUMP
#ifdef INCLUDE_DUMP
/*********************** dump ***********************/
/*********************** dump ***********************/
void dump(const unsigned char *data, int length)
void dump(const unsigned char *data, int length)

powered by: WebSVN 2.1.0

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