[Gardening] Remove more dead code from IOHandler

Remove more dead code and reformat the file.

llvm-svn: 368116
This commit is contained in:
Jonas Devlieghere 2019-08-07 01:50:03 +00:00
parent 1c9ca7d101
commit 171dd2e6e5
1 changed files with 6 additions and 29 deletions

View File

@ -382,7 +382,7 @@ bool IOHandlerEditline::GetLine(std::string &line, bool &interrupted) {
if (GetLastError() == ERROR_OPERATION_ABORTED)
continue;
#else
if (fgets(buffer, sizeof(buffer), in) == nullptr) {
if (fgets(buffer, sizeof(buffer), in) == nullptr) {
#endif
const int saved_errno = errno;
if (feof(in))
@ -949,11 +949,6 @@ public:
}
void PutChar(int ch) { ::waddch(m_window, ch); }
void PutCString(const char *s, int len = -1) { ::waddnstr(m_window, s, len); }
void Refresh() { ::wrefresh(m_window); }
void DeferredRefresh() {
// We are using panels, so we don't need to call this...
//::wnoutrefresh(m_window);
}
void SetBackground(int color_pair_idx) {
::wbkgd(m_window, COLOR_PAIR(color_pair_idx));
}
@ -1239,8 +1234,6 @@ public:
void SetCanBeActive(bool b) { m_can_activate = b; }
const WindowDelegateSP &GetDelegate() const { return m_delegate_sp; }
void SetDelegate(const WindowDelegateSP &delegate_sp) {
m_delegate_sp = delegate_sp;
}
@ -1394,8 +1387,6 @@ public:
std::string &GetName() { return m_name; }
std::string &GetKeyName() { return m_key_name; }
int GetDrawWidth() const {
return m_max_submenu_name_length + m_max_submenu_key_name_length + 8;
}
@ -1549,7 +1540,6 @@ bool Menu::WindowDelegateDraw(Window &window, bool force) {
menu->DrawMenuTitle(window, false);
}
window.PutCString(" |");
window.DeferredRefresh();
} break;
case Menu::Type::Item: {
@ -1572,7 +1562,6 @@ bool Menu::WindowDelegateDraw(Window &window, bool force) {
submenus[i]->DrawMenuTitle(window, is_selected);
}
window.MoveCursor(cursor_x, cursor_y);
window.DeferredRefresh();
} break;
default:
@ -1878,8 +1867,6 @@ public:
return m_window_sp;
}
WindowDelegates &GetWindowDelegates() { return m_window_delegates; }
protected:
WindowSP m_window_sp;
WindowDelegates m_window_delegates;
@ -1916,9 +1903,7 @@ struct Row {
return 0;
}
void Expand() {
expanded = true;
}
void Expand() { expanded = true; }
std::vector<Row> &GetChildren() {
ProcessSP process_sp = value.GetProcessSP();
@ -2273,8 +2258,6 @@ public:
m_selected_item = nullptr;
}
window.DeferredRefresh();
return true; // Drawing handled
}
@ -2624,14 +2607,12 @@ protected:
class ValueObjectListDelegate : public WindowDelegate {
public:
ValueObjectListDelegate()
: m_rows(), m_selected_row(nullptr),
m_selected_row_idx(0), m_first_visible_row(0), m_num_rows(0),
m_max_x(0), m_max_y(0) {}
: m_rows(), m_selected_row(nullptr), m_selected_row_idx(0),
m_first_visible_row(0), m_num_rows(0), m_max_x(0), m_max_y(0) {}
ValueObjectListDelegate(ValueObjectList &valobj_list)
: m_rows(), m_selected_row(nullptr),
m_selected_row_idx(0), m_first_visible_row(0), m_num_rows(0),
m_max_x(0), m_max_y(0) {
: m_rows(), m_selected_row(nullptr), m_selected_row_idx(0),
m_first_visible_row(0), m_num_rows(0), m_max_x(0), m_max_y(0) {
SetValues(valobj_list);
}
@ -2674,8 +2655,6 @@ public:
DisplayRows(window, m_rows, g_options);
window.DeferredRefresh();
// Get the selected row
m_selected_row = GetRowForRowIndex(m_selected_row_idx);
// Keep the cursor on the selected row so the highlight and the cursor are
@ -3780,7 +3759,6 @@ public:
window.Printf(" with status = %i", exit_status);
}
}
window.DeferredRefresh();
return true;
}
@ -4238,7 +4216,6 @@ public:
}
}
}
window.DeferredRefresh();
return true; // Drawing handled
}