From 147695eabb8d0ea393e56c6b3acbb44f76893516 Mon Sep 17 00:00:00 2001 From: Sven Joachim 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. Closes: #1057580 --- debian/patches/fix-ftbfs-with-opaque-ncurses.patch | 52 ++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 53 insertions(+) create mode 100644 debian/patches/fix-ftbfs-with-opaque-ncurses.patch 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 +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(m._window->_maxy), GUI_HEADER_HEIGHT), std::min(static_cast(m._window->_maxx), GUI_LENGTH), 0, 0); ++ _window = subwin(m._window, std::min(static_cast(getmaxy(m._window) - 1 ), GUI_HEADER_HEIGHT), std::min(static_cast(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(_window->_maxy)); ++ return (i >= _scrollOffset.at(_activeProtocol) + STATISTICS::FIRST_OPERATION_LINE && i - _scrollOffset.at(_activeProtocol) + BORDER_SIZE < static_cast(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(m._window->_maxy - GUI_HEADER_HEIGHT), tmp_size), +- std::min(static_cast(m._window->_maxx), GUI_LENGTH), GUI_HEADER_HEIGHT - BORDER_SIZE, 0); ++ _window = subwin(m._window, std::min(static_cast(getmaxy(m._window) - 1 - GUI_HEADER_HEIGHT), tmp_size), ++ std::min(static_cast(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 -- cgit v1.2.3