Convert the suppress_notification flag for the CLI from int to bool.
add_cmd_suppress_notification (const char *name, enum command_class theclass,
cmd_simple_func_ftype *fun, const char *doc,
struct cmd_list_element **list,
- int *suppress_notification)
+ bool *suppress_notification)
{
struct cmd_list_element *element;
cmd_simple_func_ftype *fun,
const char *doc, struct cmd_list_element **subcommands,
int allow_unknown, struct cmd_list_element **list,
- int *suppress_notification)
+ bool *suppress_notification)
{
struct cmd_list_element *element
= add_prefix_cmd (name, theclass, fun, doc, subcommands,
struct cmd_list_element *
add_com_suppress_notification (const char *name, enum command_class theclass,
cmd_simple_func_ftype *fun, const char *doc,
- int *suppress_notification)
+ bool *suppress_notification)
{
return add_cmd_suppress_notification (name, theclass, fun, doc,
&cmdlist, suppress_notification);
{
if (!cmd->is_command_class_help ())
{
- gdb::optional<scoped_restore_tmpl<int>> restore_suppress;
+ gdb::optional<scoped_restore_tmpl<bool>> restore_suppress;
if (cmd->suppress_notification != NULL)
- restore_suppress.emplace (cmd->suppress_notification, 1);
+ restore_suppress.emplace (cmd->suppress_notification, true);
cmd->func (args, from_tty, cmd);
}
cli_suppress_notification', which will be set to true in cmd_func
when this command is being executed. It will be set back to false
when the command has been executed. */
- int *suppress_notification = nullptr;
+ bool *suppress_notification = nullptr;
private:
/* Local state (context) for this command. This can be anything. */
}
/* Suppress notification struct. */
-struct cli_suppress_notification cli_suppress_notification =
- {
- 0 /* user_selected_context_changed */
- };
+struct cli_suppress_notification cli_suppress_notification;
/* Returns the INTERP's data cast as cli_interp if INTERP is a CLI,
and returns NULL otherwise. */
struct cli_suppress_notification
{
/* Inferior, thread, frame selected notification suppressed? */
- int user_selected_context;
+ bool user_selected_context = false;
};
extern struct cli_suppress_notification cli_suppress_notification;
(const char *name, enum command_class theclass,
cmd_simple_func_ftype *fun, const char *doc,
struct cmd_list_element **list,
- int *suppress_notification);
+ bool *suppress_notification);
extern struct cmd_list_element *add_alias_cmd (const char *,
cmd_list_element *,
const char *doc, struct cmd_list_element **subcommands,
int allow_unknown,
struct cmd_list_element **list,
- int *suppress_notification);
+ bool *suppress_notification);
extern struct cmd_list_element *add_abbrev_prefix_cmd (const char *,
enum command_class,
extern struct cmd_list_element *add_com_suppress_notification
(const char *name, enum command_class theclass,
cmd_simple_func_ftype *fun, const char *doc,
- int *supress_notification);
+ bool *supress_notification);
extern struct cmd_list_element *add_info (const char *,
cmd_simple_func_ftype *fun,