From 5f48d886a9ce0b7d109a26c860adf66330ca65cf Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 17 Aug 2022 11:47:17 -0600 Subject: Use checked_static_cast in more places I went through all the uses of dynamic_cast<> in gdb, looking for ones that could be replaced with checked_static_cast. This patch is the result. Regression tested on x86-64 Fedora 34. --- gdb/tui/tui-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/tui') diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 0efaf69..a30000e 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -45,6 +45,7 @@ #include "gdb_curses.h" #include #include "pager.h" +#include "gdbsupport/gdb-checked-static-cast.h" /* This redefines CTRL if it is not already defined, so it must come after terminal state releated include files like and @@ -832,8 +833,7 @@ tui_setup_io (int mode) tui_old_stdout = gdb_stdout; tui_old_stderr = gdb_stderr; tui_old_stdlog = gdb_stdlog; - tui_old_uiout = dynamic_cast (current_uiout); - gdb_assert (tui_old_uiout != nullptr); + tui_old_uiout = gdb::checked_static_cast (current_uiout); /* Reconfigure gdb output. */ gdb_stdout = tui_stdout; -- cgit v1.1