summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Joachim <svenjoac@gmx.de>2023-12-21 17:12:56 +0100
committerAndrej Shadura <andrew.shadura@collabora.co.uk>2023-12-23 15:50:26 +0100
commit147695eabb8d0ea393e56c6b3acbb44f76893516 (patch)
tree05d6884cf11a170eeeb0651565ac6b68075c33d8
parent6f24883a3375f389a6c23c09d592d5ef316e7423 (diff)
Fix FTBFS with opaque ncurses
Since ncurses patchlevel 20231021 the WINDOW structure is opaque, its members cannot be addressed directly. Use the getmaxy/getmaxx functions ncurses provides for this purpose instead. Closes: #1057580
-rw-r--r--debian/patches/fix-ftbfs-with-opaque-ncurses.patch52
-rw-r--r--debian/patches/series1
2 files changed, 53 insertions, 0 deletions
diff --git a/debian/patches/fix-ftbfs-with-opaque-ncurses.patch b/debian/patches/fix-ftbfs-with-opaque-ncurses.patch
new file mode 100644
index 0000000..4e921fe
--- /dev/null
+++ b/debian/patches/fix-ftbfs-with-opaque-ncurses.patch
@@ -0,0 +1,52 @@
+From: Sven Joachim <svenjoac@gmx.de>
+Date: Thu, 21 Dec 2023 17:12:56 +0100
+Subject: Fix FTBFS with opaque ncurses
+
+Since ncurses patchlevel 20231021 the WINDOW structure is opaque, its
+members cannot be addressed directly. Use the getmaxy/getmaxx
+functions ncurses provides for this purpose instead.
+---
+ analyzers/src/watch/nc_windows/header_window.cpp | 2 +-
+ analyzers/src/watch/nc_windows/statistics_window.cpp | 8 ++++----
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/analyzers/src/watch/nc_windows/header_window.cpp b/analyzers/src/watch/nc_windows/header_window.cpp
+index 8e04818..64ff716 100644
+--- a/analyzers/src/watch/nc_windows/header_window.cpp
++++ b/analyzers/src/watch/nc_windows/header_window.cpp
+@@ -87,7 +87,7 @@ void HeaderWindow::resize(MainWindow& m)
+ }
+ if(m._window != nullptr)
+ {
+- _window = subwin(m._window, std::min(static_cast<int>(m._window->_maxy), GUI_HEADER_HEIGHT), std::min(static_cast<int>(m._window->_maxx), GUI_LENGTH), 0, 0);
++ _window = subwin(m._window, std::min(static_cast<int>(getmaxy(m._window) - 1 ), GUI_HEADER_HEIGHT), std::min(static_cast<int>(getmaxx(m._window) - 1 ), GUI_LENGTH), 0, 0);
+ }
+ if(_window != nullptr)
+ {
+diff --git a/analyzers/src/watch/nc_windows/statistics_window.cpp b/analyzers/src/watch/nc_windows/statistics_window.cpp
+index dccd980..748e3c2 100644
+--- a/analyzers/src/watch/nc_windows/statistics_window.cpp
++++ b/analyzers/src/watch/nc_windows/statistics_window.cpp
+@@ -50,7 +50,7 @@ void StatisticsWindow::destroy()
+
+ bool StatisticsWindow::canWrite(unsigned int i)
+ {
+- return (i >= _scrollOffset.at(_activeProtocol) + STATISTICS::FIRST_OPERATION_LINE && i - _scrollOffset.at(_activeProtocol) + BORDER_SIZE < static_cast<unsigned int>(_window->_maxy));
++ return (i >= _scrollOffset.at(_activeProtocol) + STATISTICS::FIRST_OPERATION_LINE && i - _scrollOffset.at(_activeProtocol) + BORDER_SIZE < static_cast<unsigned int>(getmaxy(_window) - 1));
+ }
+
+ StatisticsWindow::StatisticsWindow(MainWindow& w, StatisticsContainers& c)
+@@ -182,10 +182,10 @@ void StatisticsWindow::resize(MainWindow& m)
+ {
+ tmp_size = _activeProtocol->getAmount() + 2 * BORDER_SIZE + 2 * EMPTY_LINE + STATISTICS::PROTOCOLS_LINE + _activeProtocol->getGroups() * EMPTY_LINE * _activeProtocol->getGroups();
+ }
+- if(m._window != nullptr && m._window->_maxy > GUI_HEADER_HEIGHT)
++ if(m._window != nullptr && getmaxy(m._window) - 1 > GUI_HEADER_HEIGHT)
+ {
+- _window = subwin(m._window, std::min(static_cast<int>(m._window->_maxy - GUI_HEADER_HEIGHT), tmp_size),
+- std::min(static_cast<int>(m._window->_maxx), GUI_LENGTH), GUI_HEADER_HEIGHT - BORDER_SIZE, 0);
++ _window = subwin(m._window, std::min(static_cast<int>(getmaxy(m._window) - 1 - GUI_HEADER_HEIGHT), tmp_size),
++ std::min(static_cast<int>(getmaxx(m._window) - 1), GUI_LENGTH), GUI_HEADER_HEIGHT - BORDER_SIZE, 0);
+ updateProtocol(_activeProtocol);
+ }
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 48cb685..4da32d2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
watch-analyzer-fix-array-bound-error.patch
0001-analyzers-fix-a-couple-format-errors.patch
tirpc.patch
+fix-ftbfs-with-opaque-ncurses.patch