contrib/gdb-7/gdb/utils.c
char *
int_string (LONGEST val, int radix, int is_signed, int width, 
	    int use_c_format)
{
  switch (radix) 
    {
    case 16:
      {
	char *result;

	if (width == 0)
	  result = hex_string (val);
	else
	  result = hex_string_custom (val, width);
	if (! use_c_format)
	  result += 2;
	return result;
      }
    case 10:
      {
	if (is_signed && val < 0)
	  return decimal2str ("-", -val, width);
	else
	  return decimal2str ("", val, width);
      }
    case 8:
      {
	char *result = octal2str (val, width);

	if (use_c_format || val == 0)
	  return result;
	else
	  return result + 1;
      }
    default:
      internal_error (__FILE__, __LINE__,
		      _("failed internal consistency check"));
    }
}
/* Convert VAL to a numeral in the given radix.  For
 * radix 10, IS_SIGNED may be true, indicating a signed quantity;
 * otherwise VAL is interpreted as unsigned.  If WIDTH is supplied, 
 * it is the minimum width (0-padded if needed).  USE_C_FORMAT means
 * to use C format in all cases.  If it is false, then 'x' 
 * and 'o' formats do not include a prefix (0x or leading 0).  */
Convert VAL to a numeral in the given radix.  For
radix 10, IS_SIGNED may be true, indicating a signed quantity;
otherwise VAL is interpreted as unsigned.  If WIDTH is supplied,
it is the minimum width (0-padded if needed).  USE_C_FORMAT means
to use C format in all cases.  If it is false, then 'x'
and 'o' formats do not include a prefix (0x or leading 0).
Convert VAL to a numeral in the given radix . For radix 10 IS_SIGNED may be true indicating a signed quantity ; otherwise VAL is interpreted as unsigned . If WIDTH is supplied it is the minimum width ( 0 - padded if needed ) . USE_C_FORMAT means to use C format in all cases . If it is false then ' x ' and ' o ' formats do not include a prefix ( 0x or leading 0 ) .
char *
int_string (LONGEST val, int radix, int is_signed, int width, 
	    int use_c_format)
{
  switch (radix) 
    {
    case 16:
      {
	char *result;
	if (width == 0)
	  result = hex_string (val);
	else
	  result = hex_string_custom (val, width);
	if (! use_c_format)
	  result += 2;
	return result;
      }
    case 10:
      {
	if (is_signed && val < 0)
	  return decimal2str ("-", -val, width);
	else
	  return decimal2str ("", val, width);
      }
    case 8:
      {
	char *result = octal2str (val, width);
	if (use_c_format || val == 0)
	  return result;
	else
	  return result + 1;
      }
    default:
      internal_error (__FILE__, __LINE__,
		      _("failed internal consistency check"));
    }
}
char * int_string ( LONGEST val , int radix , int is_signed , int width , int use_c_format ) { switch ( radix ) { case 16 : { char * result ; if ( width == 0 ) result = hex_string ( val ) ; else result = hex_string_custom ( val , width ) ; if ( ! use_c_format ) result += 2 ; return result ; } case 10 : { if ( is_signed && val < 0 ) return decimal2str ( " " , - val , width ) ; else return decimal2str ( " " , val , width ) ; } case 8 : { char * result = octal2str ( val , width ) ; if ( use_c_format || val == 0 ) return result ; else return result + 1 ; } default : internal_error ( __FILE__ , __LINE__ , _ ( " " ) ) ; } }
Convert VAL to a numeral in the given radix.
Convert VAL to a numeral in the given radix .