Package: src:yasw
Version: 0.6-1
Severity: important
Tags: patch
Justification: fails to build from source
Hi!
As you already know, yasw fails to build on a few architectures:
filter/layoutfilter.cpp: In member function 'virtual QImage
LayoutFilter::filter(QImage)':
filter/layoutfilter.cpp:197:60: error: no matching function for call to
'qMax(qreal, double)'
leftMargin = qMax((pageWidth - imageWidth) / 2, 0.0);
^
There's a patch in the original RFS bug, I'm filing it here so it doesn't
get lost. As the last upstream release was in 2014, a timely update is
quite unlikely.
Meow!
-- System Information:
Debian Release: buster/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), (1,
'experimental')
Architecture: armhf (armv7l)
Kernel: Linux 4.13.0-00222-g22e5e0f1edea (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Fix build failure on armhf and armel.
This is the result of QT's brain damage: they use inconsistent types on
these architectures: https://doc.qt.io/qt-4.8/qtglobal.html#qreal-typedef
As we don't know whether qreal is float or double, we can't use a suffix for
the literal and need a type cast.
--- yasw-0.6.orig/src/filter/layoutfilter.cpp
+++ yasw-0.6/src/filter/layoutfilter.cpp
@@ -194,10 +194,10 @@ QImage LayoutFilter::filter(QImage input
leftMargin = 0;
break;
case Constants::CenterHAlignment:
- leftMargin = qMax((pageWidth - imageWidth) / 2, 0.0);
+ leftMargin = qMax((pageWidth - imageWidth) / 2, (qreal)0.0);
break;
case Constants::RightHAlignment:
- leftMargin = qMax(pageWidth - imageWidth, 0.0);
+ leftMargin = qMax(pageWidth - imageWidth, (qreal)0.0);
break;
}
switch (Constants::verticalAlignment.indexOf(verticalAlignement)) {
@@ -205,10 +205,10 @@ QImage LayoutFilter::filter(QImage input
topMargin = 0;
break;
case Constants::CenterVAlignment:
- topMargin = qMax((pageHeight - imageHeight) / 2, 0.0);
+ topMargin = qMax((pageHeight - imageHeight) / 2, (qreal)0.0);
break;
case Constants::BottomVAlignment:
- topMargin = qMax(pageHeight - imageHeight, 0.0);
+ topMargin = qMax(pageHeight - imageHeight, (qreal)0.0);
break;
}