Replace use of magic number with named constant.
gdb/ChangeLog: * guile/scm-cmd.c (gdbscm_parse_command_name): Replace magic number with named constant. Fix style of pointer comparison. * python/py-cmd.c (gdbpy_parse_command_name): Ditto.
This commit is contained in:
parent
4c122fc315
commit
d81412aa4b
@ -1,3 +1,9 @@
|
||||
2014-09-08 Doug Evans <xdje42@gmail.com>
|
||||
|
||||
* guile/scm-cmd.c (gdbscm_parse_command_name): Replace magic number
|
||||
with named constant. Fix style of pointer comparison.
|
||||
* python/py-cmd.c (gdbpy_parse_command_name): Ditto.
|
||||
|
||||
2014-09-07 Gabriel Krisman Bertazi <gabriel@krisman.be>
|
||||
|
||||
PR gdb/17035
|
||||
|
@ -531,7 +531,7 @@ gdbscm_parse_command_name (const char *name,
|
||||
|
||||
prefix_text2 = prefix_text;
|
||||
elt = lookup_cmd_1 (&prefix_text2, *start_list, NULL, 1);
|
||||
if (!elt || elt == (struct cmd_list_element *) -1)
|
||||
if (elt == NULL || elt == CMD_LIST_AMBIGUOUS)
|
||||
{
|
||||
msg = xstrprintf (_("could not find command prefix '%s'"), prefix_text);
|
||||
xfree (prefix_text);
|
||||
|
@ -487,7 +487,7 @@ gdbpy_parse_command_name (const char *name,
|
||||
|
||||
prefix_text2 = prefix_text;
|
||||
elt = lookup_cmd_1 (&prefix_text2, *start_list, NULL, 1);
|
||||
if (!elt || elt == (struct cmd_list_element *) -1)
|
||||
if (elt == NULL || elt == CMD_LIST_AMBIGUOUS)
|
||||
{
|
||||
PyErr_Format (PyExc_RuntimeError, _("Could not find command prefix %s."),
|
||||
prefix_text);
|
||||
|
Loading…
Reference in New Issue
Block a user