/* See print-utils.h. */
-char *
+const char *
pulongest (ULONGEST u)
{
return decimal2str ("", u, 0);
/* See print-utils.h. */
-char *
+const char *
plongest (LONGEST l)
{
if (l < 0)
/* See print-utils.h. */
-char *
+const char *
phex (ULONGEST l, int sizeof_l)
{
char *str;
xsnprintf (str, PRINT_CELL_SIZE, "%02x", (unsigned short) (l & 0xff));
break;
default:
- str = phex (l, sizeof (l));
+ return phex (l, sizeof (l));
break;
}
/* See print-utils.h. */
-char *
+const char *
phex_nz (ULONGEST l, int sizeof_l)
{
char *str;
xsnprintf (str, PRINT_CELL_SIZE, "%x", (unsigned short) (l & 0xff));
break;
default:
- str = phex_nz (l, sizeof (l));
+ return phex_nz (l, sizeof (l));
break;
}
/* See print-utils.h. */
-char *
+const char *
hex_string (LONGEST num)
{
char *result = get_print_cell ();
/* See print-utils.h. */
-char *
+const char *
hex_string_custom (LONGEST num, int width)
{
char *result = get_print_cell ();
/* See print-utils.h. */
-char *
+const char *
int_string (LONGEST val, int radix, int is_signed, int width,
int use_c_format)
{
{
case 16:
{
- char *result;
+ const char *result;
if (width == 0)
result = hex_string (val);
/* %u for ULONGEST. The result is stored in a circular static buffer,
NUMCELLS deep. */
-extern char *pulongest (ULONGEST u);
+extern const char *pulongest (ULONGEST u);
/* %d for LONGEST. The result is stored in a circular static buffer,
NUMCELLS deep. */
-extern char *plongest (LONGEST l);
+extern const char *plongest (LONGEST l);
/* Convert a ULONGEST into a HEX string, like %lx, with leading zeros.
The result is stored in a circular static buffer, NUMCELLS deep. */
-extern char *phex (ULONGEST l, int sizeof_l);
+extern const char *phex (ULONGEST l, int sizeof_l);
/* Convert a ULONGEST into a HEX string, like %lx, without leading zeros.
The result is stored in a circular static buffer, NUMCELLS deep. */
-extern char *phex_nz (ULONGEST l, int sizeof_l);
+extern const char *phex_nz (ULONGEST l, int sizeof_l);
/* Converts a LONGEST to a C-format hexadecimal literal and stores it
in a static string. Returns a pointer to this string. */
-extern char *hex_string (LONGEST num);
+extern const char *hex_string (LONGEST num);
/* Converts a LONGEST number to a C-format hexadecimal literal and
stores it in a static string. Returns a pointer to this string
that is valid until the next call. The number is padded on the
left with 0s to at least WIDTH characters. */
-extern char *hex_string_custom (LONGEST num, int width);
+extern const char *hex_string_custom (LONGEST num, int width);
/* Convert VAL to a numeral in the given radix. For
* radix 10, IS_SIGNED may be true, indicating a signed quantity;
* 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). */
-extern char *int_string (LONGEST val, int radix, int is_signed, int width,
- int use_c_format);
+extern const char *int_string (LONGEST val, int radix, int is_signed, int width,
+ int use_c_format);
/* Convert a CORE_ADDR into a string. */