Bug 342642

Summary: Kst 2.0.8 fails to compile on Fedora Rawhide Arm
Product: [Applications] kst Reporter: Orion Poplawski <orion>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: major CC: netterfield, rdieter
Priority: NOR    
Version: 2.0.8   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Orion Poplawski 2015-01-08 22:34:31 UTC
Updating kst in Fedora to 2.0.8, fails to compile on arm:

http://koji.fedoraproject.org/koji/getfile?taskID=8554368&name=build.log

/builddir/build/BUILD/Kst-2.0.8/src/libkst/vector.cpp:598:42: error: no matching function for call to 'qMax(double&, qreal)'
           _minPos=qMax(_minPos,qreal(0.0));
/builddir/build/BUILD/Kst-2.0.8/src/libkst/vector.cpp:602:45: error: no matching function for call to 'qMax(double&, qreal)'
           _minPos=qMin(qMax(_v[i],qreal(0.0)),_minPos);
/builddir/build/BUILD/Kst-2.0.8/src/libkst/vector.cpp:629:42: error: no matching function for call to 'qMax(double&, qreal)'
           _minPos=qMax(_minPos,qreal(0.0));
/builddir/build/BUILD/Kst-2.0.8/src/libkst/vector.cpp:633:45: error: no matching function for call to 'qMax(double&, qreal)'
           _minPos=qMin(qMax(_v[i],qreal(0.0)),_minPos);


Reproducible: Always




I believe similar issues with qreal have been addressed before.
Comment 1 Netterfield 2015-01-11 05:22:17 UTC
Git commit 16d4aea302e9f9eeca86e3ad72f448b8303d31b5 by Barth Netterfield.
Committed on 11/01/2015 at 05:19.
Pushed by netterfield into branch 'master'.

Fix some qreal issues.

floating point values which count pixels or screen locations
can and should be qreal.

floating point values which are
involved with computational manipulation of the data
should be double, even though this is slower in ARM.

They shouldn't mix if it can be helped.

M  +1    -1    src/libkst/editablevector.cpp
M  +4    -4    src/libkst/vector.cpp
M  +1    -1    src/libkstmath/curve.cpp
M  +1    -1    src/plugins/dataobject/activitylevel/activitylevel.cpp

http://commits.kde.org/kst-plot/16d4aea302e9f9eeca86e3ad72f448b8303d31b5
Comment 2 Orion Poplawski 2015-01-12 18:15:21 UTC
Thanks, but I still get errors with:
/builddir/build/BUILD/Kst-2.0.8/src/libkst/vector.cpp:598:42: error: no matching function for call to 'qMax(double&, qreal)'
           _minPos=qMax(_minPos,qreal(0.0));
/builddir/build/BUILD/Kst-2.0.8/src/libkst/vector.cpp:602:45: error: no matching function for call to 'qMax(double&, qreal)'
           _minPos=qMin(qMax(_v[i],qreal(0.0)),_minPos);
Comment 3 Orion Poplawski 2015-01-13 00:00:07 UTC
And after those:
/builddir/build/BUILD/Kst-2.0.8/src/libkstmath/curve.cpp:687:83: error: no matching function for call to 'qMax(qreal, double)'
   return qMax(qreal(1.01), PointSize * ((w.width() + w.height()) * (1.0 / 4000.0)));
Comment 4 Netterfield 2015-01-13 02:19:43 UTC
Both of those were changed in git (origin/master (not 2.0.8, which has already been released)).

Let me now if the changes work there.
Comment 5 Orion Poplawski 2015-01-14 23:54:31 UTC
Hmm, I seemed to have missed the vector changes somehow, but I think you are missing:

diff --git a/src/libkstmath/curve.cpp b/src/libkstmath/curve.cpp
index 7e8c4bb..79182e6 100644
--- a/src/libkstmath/curve.cpp
+++ b/src/libkstmath/curve.cpp
@@ -684,7 +684,7 @@ RelationPtr Curve::makeDuplicate() const {
 // and not just pulled out of the air by what looks ~good.
 // They are currently "about right" for printing to US Letter.
 double Curve::pointDim(QRectF w) const {
-  return qMax(qreal(1.01), PointSize * ((w.width() + w.height()) * (1.0 / 4000.0)));
+  return qMax(double(1.01), PointSize * ((w.width() + w.height()) * (1.0 / 4000.0)));
 }

 double Curve::lineDim(const QRectF &R, double linewidth) {
Comment 6 Netterfield 2015-02-21 17:57:37 UTC
Git commit 1365ccf2fd2da59025be623b97b7207f95ba8884 by Barth Netterfield.
Committed on 29/01/2015 at 16:18.
Pushed by netterfield into branch 'master'.

Fix another qreal/double issue

M  +1    -1    src/libkstmath/curve.cpp

http://commits.kde.org/kst-plot/1365ccf2fd2da59025be623b97b7207f95ba8884
Comment 7 Netterfield 2016-03-29 21:23:38 UTC
Can anyone confirm whether this is still breaking?
Comment 8 Rex Dieter 2016-03-29 21:37:07 UTC
Looks good now,
http://koji.fedoraproject.org/koji/buildinfo?buildID=741522