From d81412aa4b2669d108de0b4e1d8f881cedebd8a9 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Mon, 8 Sep 2014 20:47:57 -0700 Subject: [PATCH] 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. --- gdb/ChangeLog | 6 ++++++ gdb/guile/scm-cmd.c | 2 +- gdb/python/py-cmd.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 59536c61a9..ad5ef6f872 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2014-09-08 Doug Evans + + * 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 PR gdb/17035 diff --git a/gdb/guile/scm-cmd.c b/gdb/guile/scm-cmd.c index 54bed2cd41..2c4b2f841b 100644 --- a/gdb/guile/scm-cmd.c +++ b/gdb/guile/scm-cmd.c @@ -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); diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c index 8bc4bf796e..45af66b908 100644 --- a/gdb/python/py-cmd.c +++ b/gdb/python/py-cmd.c @@ -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);