Control: tags -1 + patch
On 2018-02-22 22:23 +0100, Sven Joachim wrote:
> Source: cwidget
> Version: 0.5.17-7
>
> With the upcoming libncursesw6 package (which is not available yet, but
> everything is ready in git and I have asked for an upload to
> experimental), cwidget FTBFS. This is the relevant part, I have
> attached the full build log for reference:
>
> ,----
> | text_layout.cc: In member function 'virtual void
> cwidget::widgets::text_layout::dispatch_mouse(short int, int, int, int,
> mmask_t)':
> | text_layout.cc:89:57: error: no matching function for call to 'max(int,
> size_t)'
> | set_start(std::max(0, start - mouse_wheel_scroll_lines));
> | ^
> `----
So I have good and bad news. The good one is that this error was easy
to fix by casting the 0 to size_t, so that both parameters passed to
std::max have the same type. See the attached patch.
The bad news is that after rebuilding libcwidget3v5 against libncursesw6
aptitude no longer starts:
,----
| $ aptitude
| aptitude: symbol lookup error: aptitude: undefined symbol:
_ZN7cwidget7widgets6widget14dispatch_mouseEsiiim
| $ objdump -T /usr/lib/i386-linux-gnu/libcwidget.so.3.0.0 | grep
widget14dispatch_mouse
| 000dde10 g DF .text 00000002 Base
_ZN7cwidget7widgets6widget14dispatch_mouseEsiiij
`----
This is because mmask_t is of a different type in libncursesw6. Looks
like I may have to go back to the drawing board in ncurses and re-enable
the "--with-mmask-t='long'" configure option there. Oh well. :-(
Cheers,
Sven
Description: Cast 0 to size_t in text_layout::dispatch_mouse
This avoids incompatible parameter types in std::max.
Author: Sven Joachim <[email protected]>
Bug-Debian: https://bugs.debian.org/891161
Last-Update: 2018-02-23
---
src/cwidget/widgets/text_layout.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/cwidget/widgets/text_layout.cc
+++ b/src/cwidget/widgets/text_layout.cc
@@ -86,7 +86,7 @@ namespace cwidget
{
freshen_contents(lastst);
if(start > 0)
- set_start(std::max(0, start - mouse_wheel_scroll_lines));
+ set_start(std::max((size_t)0, start - mouse_wheel_scroll_lines));
}
}
else if((bstate & BUTTON5_PRESSED) != 0)