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

Subversion Repositories plasma

[/] [plasma/] [trunk/] [kernel/] [libc.c] - Diff between revs 416 and 425

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

Rev 416 Rev 425
Line 247... Line 247...
   {
   {
      num = -num;
      num = -num;
      negate = 1;
      negate = 1;
   }
   }
   text[16] = 0;
   text[16] = 0;
   for(place = 15; place >= 0; --place)
   for(place = 15; place > 0; --place)
   {
   {
      digit = (unsigned int)num % (unsigned int)base;
      digit = (unsigned int)num % (unsigned int)base;
      if(num == 0 && place < 15 && base == 10 && negate)
      if(num == 0 && place < 15 && base == 10 && negate)
      {
      {
         c = '-';
         c = '-';
Line 275... Line 275...
            int arg0, int arg1, int arg2, int arg3,
            int arg0, int arg1, int arg2, int arg3,
            int arg4, int arg5, int arg6, int arg7)
            int arg4, int arg5, int arg6, int arg7)
{
{
   int argv[8];
   int argv[8];
   int argc=0, width, length;
   int argc=0, width, length;
   char f, text[20], fill;
   char f=0, prev, text[20], fill;
 
 
   argv[0] = arg0; argv[1] = arg1; argv[2] = arg2; argv[3] = arg3;
   argv[0] = arg0; argv[1] = arg1; argv[2] = arg2; argv[3] = arg3;
   argv[4] = arg4; argv[5] = arg5; argv[6] = arg6; argv[7] = arg7;
   argv[4] = arg4; argv[5] = arg5; argv[6] = arg6; argv[7] = arg7;
 
 
   for(;;)
   for(;;)
   {
   {
 
      prev = f;
      f = *format++;
      f = *format++;
      if(f == 0)
      if(f == 0)
         return argc;
         return argc;
      else if(f == '%')
      else if(f == '%')
      {
      {
Line 340... Line 341...
         }
         }
         s += strlen(s);
         s += strlen(s);
      }
      }
      else
      else
      {
      {
         if(f == '\n')
         if(f == '\n' && prev != '\r')
            *s++ = '\r';
            *s++ = '\r';
         *s++ = f;
         *s++ = f;
         if(f == '\r' && *format == '\n')
 
            *s++ = *format++;
 
      }
      }
      *s = 0;
      *s = 0;
   }
   }
}
}
 
 
Line 578... Line 577...
         seconds -= delta;
         seconds -= delta;
      else
      else
         break;
         break;
   }
   }
   out->tm_year = year + 80;
   out->tm_year = year + 80;
 
   out->tm_yday = seconds / SEC_PER_DAY;
   isLeapYear = IsLeapYear(1980 + year);
   isLeapYear = IsLeapYear(1980 + year);
   for(month = 0; ; ++month)
   for(month = 0; ; ++month)
   {
   {
      delta = SEC_PER_DAY * (DaysInMonth[month] + (isLeapYear && (month == 1)));
      delta = SEC_PER_DAY * (DaysInMonth[month] + (isLeapYear && (month == 1)));
      if(seconds >= delta)
      if(seconds >= delta)
Line 589... Line 589...
      else
      else
         break;
         break;
   }
   }
   out->tm_mon = month;
   out->tm_mon = month;
   out->tm_mday = seconds / SEC_PER_DAY;
   out->tm_mday = seconds / SEC_PER_DAY;
   out->tm_yday = DaysUntilMonth[month] + out->tm_mday;
 
   seconds -= out->tm_mday * SEC_PER_DAY;
   seconds -= out->tm_mday * SEC_PER_DAY;
   ++out->tm_mday;
   ++out->tm_mday;
   out->tm_hour = seconds / (60 * 60);
   out->tm_hour = seconds / (60 * 60);
   seconds -= out->tm_hour * (60 * 60);
   seconds -= out->tm_hour * (60 * 60);
   out->tm_min = seconds / 60;
   out->tm_min = seconds / 60;

powered by: WebSVN 2.1.0

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