[rkward-tracker] [rkward:bugs] #137 rkward 0.6.3 fails to compile on Linux/ARM

Tom 'spot' Callaway spotrh at users.sf.net
Wed Mar 11 00:39:09 UTC 2015




---

** [bugs:#137] rkward 0.6.3 fails to compile on Linux/ARM**

**Status:** open
**Group:** CRASH
**Created:** Wed Mar 11, 2015 12:39 AM UTC by Tom 'spot' Callaway
**Last Updated:** Wed Mar 11, 2015 12:39 AM UTC
**Owner:** nobody

In the process of updating rkward to 0.6.3 (against R 3.1.3) in Fedora, it was discovered that 0.6.3 failed to compile on ARM. The specific failure was:

~~~~~~~
/builddir/build/BUILD/rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp: In constructor 'RKPluginSpinBox::RKPluginSpinBox(const QDomElement&, RKComponent*, QWidget*)':
/builddir/build/BUILD/rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp:53:97: error: no matching function for call to 'qMax(double&, qreal)'
   double initial = xml->getDoubleAttribute (element, "initial", qMin (max, qMax (min, qreal(0.0))), DL_INFO);
                                                                                                 ^
/builddir/build/BUILD/rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp:53:97: note: candidate is:
In file included from /usr/include/QtCore/qatomic.h:45:0,
                 from /usr/include/QtCore/qhash.h:45,
                 from /usr/include/QtCore/QHash:1,
                 from /builddir/build/BUILD/rkward-0.6.3/rkward/plugin/rkcomponent.h:21,
                 from /builddir/build/BUILD/rkward-0.6.3/rkward/plugin/rkpluginspinbox.h:20,
                 from /builddir/build/BUILD/rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp:17:
/usr/include/QtCore/qglobal.h:1217:34: note: template<class T> const T& qMax(const T&, const T&)
 Q_DECL_CONSTEXPR inline const T &qMax(const T &a, const T &b) { return (a < b) ? b : a; }
                                  ^
/usr/include/QtCore/qglobal.h:1217:34: note:   template argument deduction/substitution failed:
/builddir/build/BUILD/rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp:53:97: note:   deduced conflicting types for parameter 'const T' ('double' and 'qreal {aka float}')
   double initial = xml->getDoubleAttribute (element, "initial", qMin (max, qMax (min, qreal(0.0))), DL_INFO);
~~~~~~~

This failure has been noted in other QT apps, specifically, it is the same issue noted in Debian Bug 638813: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638813

The fix is the same, to cast the necessary parameters of qMax to a double:

~~~~~~~
diff -up rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp.armfix rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp
--- rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp.armfix	2015-03-10 19:37:12.501771989 -0400
+++ rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp	2015-03-10 19:37:45.131562327 -0400
@@ -50,7 +50,7 @@ RKPluginSpinBox::RKPluginSpinBox (const
        if (!intmode) {
                double min = xml->getDoubleAttribute (element, "min", -FLT_MAX, DL_INFO);
                double max = xml->getDoubleAttribute (element, "max", FLT_MAX, DL_INFO);
-               double initial = xml->getDoubleAttribute (element, "initial", qMin (max, qMax (min, qreal(0.0))), DL_INFO);
+               double initial = xml->getDoubleAttribute (element, "initial", qMin (max, qMax (min, double(qreal(0.0)))), DL_INFO);
                int default_precision = xml->getIntAttribute (element, "default_precision", 2, DL_INFO);
                int max_precision = xml->getIntAttribute (element, "max_precision", 8, DL_INFO);

diff -up rkward-0.6.3/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp.armfix rkward-0.6.3/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
--- rkward-0.6.3/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp.armfix	2015-03-10 20:11:02.363493214 -0400
+++ rkward-0.6.3/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp	2015-03-10 20:11:13.903466769 -0400
@@ -105,7 +105,7 @@ static QPen readSimplePen (QDataStream &
 	instream >> lwd >> lty;
 	if (!col.isValid () || (lty == -1L)) return QPen (Qt::NoPen);
 
-	lwd = qMax (qreal(1.0), lwd);	// minimum 1 px as in X11 device
+	lwd = qMax (double(qreal(1.0)), lwd);	// minimum 1 px as in X11 device
 	QPen ret;
 	if (lty != 0) {	// solid
 		QVector<qreal> dashes;
~~~~~~~

I waive any copyright on this patch, and when that is not possible, grant permission for it to be used under the same license as the rest of RKWard.


---

Sent from sourceforge.net because rkward-tracker at lists.sourceforge.net is subscribed to https://sourceforge.net/p/rkward/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/rkward/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/rkward-tracker/attachments/20150311/c5f54db6/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
-------------- next part --------------
_______________________________________________
rkward-tracker mailing list
rkward-tracker at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-tracker


More information about the rkward-tracker mailing list