* cli/cli-decode.h (CMD_LIST_AMBIGUOUS): Define.
* cli/cli-decode.c (lookup_cmd_1): Use CMD_LIST_AMBIGUOUS.
(lookup_cmd): Test for CMD_LIST_AMBIGUOUS.
* completer.c (complete_line_internal): Use CMD_LIST_AMBIGUOUS.
* top.c (set_verbose): Use CMD_LIST_AMBIGUOUS.
2011-03-11 Michael Snyder <msnyder@vmware.com>
+ * cli/cli-decode.h (CMD_LIST_AMBIGUOUS): Define.
+ * cli/cli-decode.c (lookup_cmd_1): Use CMD_LIST_AMBIGUOUS.
+ (lookup_cmd): Test for CMD_LIST_AMBIGUOUS.
+ * completer.c (complete_line_internal): Use CMD_LIST_AMBIGUOUS.
+ * top.c (set_verbose): Use CMD_LIST_AMBIGUOUS.
+
* event-loop-c (delete_async_signal_handler): Assert prev_ptr.
(delete_async_event_handler): Ditto.
/* Will be modified in calling routine
if we know what the prefix command is. */
*result_list = 0;
- return (struct cmd_list_element *) -1; /* Ambiguous. */
+ return CMD_LIST_AMBIGUOUS; /* Ambiguous. */
}
/* We've matched something on this list. Move text pointer forward. */
*result_list = clist;
return found;
}
- else if (c == (struct cmd_list_element *) -1)
+ else if (c == CMD_LIST_AMBIGUOUS)
{
/* We've gotten this far properly, but the next step is
ambiguous. We need to set the result list to the best
else
return 0;
}
- else if (c == (struct cmd_list_element *) -1)
+ else if (c == CMD_LIST_AMBIGUOUS)
{
/* Ambigous. Local values should be off prefixlist or called
values. */
*cmd = find_cmd (command, len, cur_list, 1, &nfound);
}
- if (*cmd == (struct cmd_list_element *) -1)
+ if (*cmd == CMD_LIST_AMBIGUOUS)
{
return 0; /* ambiguous */
}
struct cmd_list_element *alias_chain;
};
+/* Flag for an ambiguous cmd_list result. */
+#define CMD_LIST_AMBIGUOUS ((struct cmd_list_element *) -1)
+
/* API to the manipulation of command lists. */
extern struct cmd_list_element *add_cmd (char *, enum command_class,
{
/* An empty line we want to consider ambiguous; that is, it
could be any command. */
- c = (struct cmd_list_element *) -1;
+ c = CMD_LIST_AMBIGUOUS;
result_list = 0;
}
else
possible completions. */
list = NULL;
}
- else if (c == (struct cmd_list_element *) -1)
+ else if (c == CMD_LIST_AMBIGUOUS)
{
char *q;
struct cmd_list_element *showcmd;
showcmd = lookup_cmd_1 (&cmdname, showlist, NULL, 1);
- gdb_assert (showcmd != NULL
- && showcmd != (struct cmd_list_element *) -1);
+ gdb_assert (showcmd != NULL && showcmd != CMD_LIST_AMBIGUOUS);
if (info_verbose)
{