aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-06-19 11:15:56 +0200
committerTom de Vries <tdevries@suse.de>2023-06-19 11:15:56 +0200
commitba769bb0e6fdf5b4c55577b068b93adf2f6d1333 (patch)
tree2aa58d9f30eefeb2dc90a240bed71e3a9b99058e /gdb
parent2e12e798825b9119a250f512416e04b62ed7a2a9 (diff)
downloadgdb-ba769bb0e6fdf5b4c55577b068b93adf2f6d1333.zip
gdb-ba769bb0e6fdf5b4c55577b068b93adf2f6d1333.tar.gz
gdb-ba769bb0e6fdf5b4c55577b068b93adf2f6d1333.tar.bz2
[gdb/tui] Simplify tui_update_variables
Simplify tui_update_variables by using template function assign_return_if_changed. Tested on x86_64-linux.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/tui/tui-win.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 7bceebb..7d58a2d 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -284,28 +284,20 @@ tui_update_variables ()
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 = true;
- }
+ need_redraw
+ |= assign_return_if_changed<int> (tui_border_attrs, entry->value);
+
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 = true;
- }
+ need_redraw
+ |= assign_return_if_changed<int> (tui_active_border_attrs, entry->value);
/* If one corner changes, all characters are changed.
Only check the first one. The ACS characters are determined at
run time by curses terminal management. */
entry = translate (tui_border_kind, tui_border_kind_translate_lrcorner);
int val = (entry->value < 0) ? ACS_LRCORNER : entry->value;
- if (tui_border_lrcorner != (chtype) val)
- {
- tui_border_lrcorner = val;
- need_redraw = true;
- }
+ need_redraw |= assign_return_if_changed<chtype> (tui_border_lrcorner, val);
+
entry = translate (tui_border_kind, tui_border_kind_translate_llcorner);
tui_border_llcorner = (entry->value < 0) ? ACS_LLCORNER : entry->value;