Replace use of magic number with named constant.
authorDoug Evans <xdje42@gmail.com>
Tue, 9 Sep 2014 03:47:57 +0000 (20:47 -0700)
committerDoug Evans <xdje42@gmail.com>
Tue, 9 Sep 2014 03:47:57 +0000 (20:47 -0700)
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
gdb/guile/scm-cmd.c
gdb/python/py-cmd.c

index 59536c61a91e02ac22d0cdb0bcbe76135dd4e0f9..ad5ef6f8729c04733ab3a33659fadca5e623bee9 100644 (file)
@@ -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
index 54bed2cd41adaea2d5141fd57af1cf82e5731fff..2c4b2f841bb1280f24b0a264955796baf3171371 100644 (file)
@@ -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);
index 8bc4bf796e51049419c118d2162c88a5d9accf62..45af66b908c6d07d9b9cec77cbeae1457b6394d4 100644 (file)
@@ -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);