This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Zap struct command de-reference in valprint.c
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 17 Mar 2002 11:12:21 -0500
- Subject: [patch] Zap struct command de-reference in valprint.c
One less thing grubbing around in the internals of the command structure.
(NB: There is a bug in that code - this just makes it easier to see :-)
Committed.
enjoy,
Andrew
2002-03-17 Andrew Cagney <ac131313@redhat.com>
* valprint.c (set_input_radix): Use input_radix.
(set_output_radix): Use output_radix.
(set_input_radix_1, set_output_radix_1): Add FIXME - bad radix
isn't reverted.
Index: valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/valprint.c,v
retrieving revision 1.23
diff -u -r1.23 valprint.c
--- valprint.c 2002/02/05 04:37:22 1.23
+++ valprint.c 2002/03/17 16:07:29
@@ -1294,7 +1294,7 @@
static void
set_input_radix (char *args, int from_tty, struct cmd_list_element *c)
{
- set_input_radix_1 (from_tty, *(unsigned *) c->var);
+ set_input_radix_1 (from_tty, input_radix);
}
/* ARGSUSED */
@@ -1310,6 +1310,8 @@
if (radix < 2)
{
+ /* FIXME: cagney/2002-03-17: This needs to revert the bad radix
+ value. */
error ("Nonsense input radix ``decimal %u''; input radix unchanged.",
radix);
}
@@ -1325,7 +1327,7 @@
static void
set_output_radix (char *args, int from_tty, struct cmd_list_element *c)
{
- set_output_radix_1 (from_tty, *(unsigned *) c->var);
+ set_output_radix_1 (from_tty, output_radix);
}
static void
@@ -1345,6 +1347,8 @@
output_format = 'o'; /* octal */
break;
default:
+ /* FIXME: cagney/2002-03-17: This needs to revert the bad radix
+ value. */
error ("Unsupported output radix ``decimal %u''; output radix unchanged.",
radix);
}