This changes a few spots in the TUI to use "bool" rather than "int".
Tested on x86-64 Fedora 28.
gdb/ChangeLog
2019-12-30 Tom Tromey <tom@tromey.com>
* tui/tui-interp.c (tui_start_enabled): Now bool.
(_initialize_tui_interp): Update.
* tui/tui-hooks.c (tui_refreshing_registers): Now bool.
(tui_register_changed)
(tui_refresh_frame_and_register_information): Update.
* tui/tui-win.c (tui_update_variables): Return bool.
* tui/tui-win.h (tui_update_variables): Return bool.
* tui/tui.c (tui_get_command_dimension): Return bool.
* tui/tui.h (tui_get_command_dimension): Return bool.
Change-Id: I55b7f2d62d2ef88da3587dc914ada9f463ad8d2b
+2019-12-30 Tom Tromey <tom@tromey.com>
+
+ * tui/tui-interp.c (tui_start_enabled): Now bool.
+ (_initialize_tui_interp): Update.
+ * tui/tui-hooks.c (tui_refreshing_registers): Now bool.
+ (tui_register_changed)
+ (tui_refresh_frame_and_register_information): Update.
+ * tui/tui-win.c (tui_update_variables): Return bool.
+ * tui/tui-win.h (tui_update_variables): Return bool.
+ * tui/tui.c (tui_get_command_dimension): Return bool.
+ * tui/tui.h (tui_get_command_dimension): Return bool.
+
2019-12-29 Bernd Edlinger <bernd.edlinger@hotmail.de>
* buildsym.c (buildsym_compunit::record_line): Do no longer ignore
}
/* Prevent recursion of deprecated_register_changed_hook(). */
-static int tui_refreshing_registers = 0;
+static bool tui_refreshing_registers = false;
/* Observer for the register_changed notification. */
up in the other. So we always use the selected frame here, and ignore
FRAME. */
fi = get_selected_frame (NULL);
- if (tui_refreshing_registers == 0)
+ if (!tui_refreshing_registers)
{
- tui_refreshing_registers = 1;
+ tui_refreshing_registers = true;
TUI_DATA_WIN->check_register_values (fi);
- tui_refreshing_registers = 0;
+ tui_refreshing_registers = false;
}
}
if (tui_is_window_visible (DATA_WIN)
&& (frame_info_changed_p || from_stack))
{
- tui_refreshing_registers = 1;
+ tui_refreshing_registers = true;
TUI_DATA_WIN->check_register_values (fi);
- tui_refreshing_registers = 0;
+ tui_refreshing_registers = false;
}
}
else if (!from_stack)
#include "inferior.h"
#include "main.h"
-/* Set to 1 when the TUI mode must be activated when we first start
+/* Set to true when the TUI mode must be activated when we first start
gdb. */
-static int tui_start_enabled = 0;
+static bool tui_start_enabled = false;
class tui_interp final : public cli_interp_base
{
interp_factory_register (INTERP_TUI, tui_interp_factory);
if (interpreter_p && strcmp (interpreter_p, INTERP_TUI) == 0)
- tui_start_enabled = 1;
+ tui_start_enabled = true;
if (interpreter_p && strcmp (interpreter_p, INTERP_CONSOLE) == 0)
{
/* Update the tui internal configuration according to gdb settings.
Returns 1 if the configuration has changed and the screen should
be redrawn. */
-int
-tui_update_variables (void)
+bool
+tui_update_variables ()
{
- int need_redraw = 0;
+ bool need_redraw = false;
struct tui_translate *entry;
entry = translate (tui_border_mode, tui_border_mode_translate);
if (tui_border_attrs != entry->value)
{
tui_border_attrs = entry->value;
- need_redraw = 1;
+ need_redraw = true;
}
entry = translate (tui_active_border_mode, tui_border_mode_translate);
if (tui_active_border_attrs != entry->value)
{
tui_active_border_attrs = entry->value;
- need_redraw = 1;
+ need_redraw = true;
}
/* If one corner changes, all characters are changed.
if (tui_border_lrcorner != (chtype) entry->value)
{
tui_border_lrcorner = (entry->value < 0) ? ACS_LRCORNER : entry->value;
- need_redraw = 1;
+ need_redraw = true;
}
entry = translate (tui_border_kind, tui_border_kind_translate_llcorner);
tui_border_llcorner = (entry->value < 0) ? ACS_LLCORNER : entry->value;
extern int tui_border_attrs;
extern int tui_active_border_attrs;
-extern int tui_update_variables (void);
+extern bool tui_update_variables ();
extern void tui_initialize_win (void);
return tui_win_list[type]->is_visible ();
}
-int
+bool
tui_get_command_dimension (unsigned int *width,
unsigned int *height)
{
if (!tui_active || (TUI_CMD_WIN == NULL))
- {
- return 0;
- }
+ return false;
*width = TUI_CMD_WIN->width;
*height = TUI_CMD_WIN->height;
- return 1;
+ return true;
}
void
CORE_ADDR, CORE_ADDR);
extern void tui_show_assembly (struct gdbarch *gdbarch, CORE_ADDR addr);
extern bool tui_is_window_visible (enum tui_win_type type);
-extern int tui_get_command_dimension (unsigned int *width,
- unsigned int *height);
+extern bool tui_get_command_dimension (unsigned int *width,
+ unsigned int *height);
/* Initialize readline and configure the keymap for the switching
key shortcut. */