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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [or1ksim/] [testsuite/] [test-code-or1k/] [support/] [support.c] - Diff between revs 90 and 93

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

Rev 90 Rev 93
Line 126... Line 126...
   @param[in] base  The base to use.
   @param[in] base  The base to use.
 
 
   @return  the length of the string created.                                */
   @return  the length of the string created.                                */
/* --------------------------------------------------------------------------*/
/* --------------------------------------------------------------------------*/
static int
static int
print_base (long int   uval,
print_base (long unsigned int  uval,
            char       buf[],
            char       buf[],
            int        base)
            unsigned int       base)
{
{
  /* Initially print backwards. Always have at least a zero. */
  /* Initially print backwards. Always have at least a zero. */
  int  i = 0;
  int  i = 0;
 
 
  do
  do
Line 269... Line 269...
 
 
  /* Array to store the number in. We know the max for 32 bits is 10
  /* Array to store the number in. We know the max for 32 bits is 10
     digits. Allow for end of string marker */
     digits. Allow for end of string marker */
  char  num_array[11];
  char  num_array[11];
 
 
  int  num_width = print_base (val, num_array, 10);
  int  num_width = print_base ((unsigned long int) val, num_array, 10);
 
 
  /* Now print out the number. */
  /* Now print out the number. */
  num_width += is_signed_p ? 1 : 0;
  num_width += is_signed_p ? 1 : 0;
 
 
  if (num_width < width)
  if (num_width < width)
Line 324... Line 324...
   @param[in] base             Base to use when printing
   @param[in] base             Base to use when printing
 
 
   @return  The number of chars printed                                      */
   @return  The number of chars printed                                      */
/* --------------------------------------------------------------------------*/
/* --------------------------------------------------------------------------*/
static int
static int
printf_unsigned_base (long int  val,
printf_unsigned_base (unsigned long int  val,
                      int       width,
                      int       width,
                      int       leading_zeros_p,
                      int       leading_zeros_p,
                      int       base)
                      unsigned int       base)
{
{
  int  is_signed_p = 0;
  int  is_signed_p = 0;
 
 
  /* Note if we need a sign */
  /* Note if we need a sign */
  if (val < 0)
  if (val < 0)

powered by: WebSVN 2.1.0

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