[Lldb-commits] [lldb] 9dbdaea - Remove unused variable "saved_opts".
Sterling Augustine via lldb-commits
lldb-commits at lists.llvm.org
Thu Aug 6 10:20:43 PDT 2020
Author: Sterling Augustine
Date: 2020-08-06T10:20:21-07:00
New Revision: 9dbdaea9a0e6f58417b5bd8980e7ea6723fd1783
URL: https://github.com/llvm/llvm-project/commit/9dbdaea9a0e6f58417b5bd8980e7ea6723fd1783
DIFF: https://github.com/llvm/llvm-project/commit/9dbdaea9a0e6f58417b5bd8980e7ea6723fd1783.diff
LOG: Remove unused variable "saved_opts".
wattr_get is a macro, and the documentation states:
"The parameter opts is reserved for future use,
applications must supply a null pointer."
In practice, passing a variable there is harmless, except
that it is unused inside the macro, which causes unused
variable warnings.
The various places where
Added:
Modified:
lldb/source/Core/IOHandlerCursesGUI.cpp
Removed:
################################################################################
diff --git a/lldb/source/Core/IOHandlerCursesGUI.cpp b/lldb/source/Core/IOHandlerCursesGUI.cpp
index 931ddb2ea9e3..6a24625fc7eb 100644
--- a/lldb/source/Core/IOHandlerCursesGUI.cpp
+++ b/lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -485,8 +485,7 @@ class Window {
bool use_blue_background) {
attr_t saved_attr;
short saved_pair;
- int saved_opts;
- wattr_get(m_window, &saved_attr, &saved_pair, &saved_opts);
+ wattr_get(m_window, &saved_attr, &saved_pair, nullptr);
if (use_blue_background)
::wattron(m_window, COLOR_PAIR(WhiteOnBlue));
while (!string.empty()) {
@@ -522,7 +521,7 @@ class Window {
continue;
}
if (value == 0) { // Reset.
- wattr_set(m_window, saved_attr, saved_pair, &saved_opts);
+ wattr_set(m_window, saved_attr, saved_pair, nullptr);
if (use_blue_background)
::wattron(m_window, COLOR_PAIR(WhiteOnBlue));
} else {
@@ -531,7 +530,7 @@ class Window {
COLOR_PAIR(value - 30 + 1 + (use_blue_background ? 8 : 0)));
}
}
- wattr_set(m_window, saved_attr, saved_pair, &saved_opts);
+ wattr_set(m_window, saved_attr, saved_pair, nullptr);
}
void Touch() {
More information about the lldb-commits
mailing list