[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #44970] Build fails on ARM because qreal is a
From: |
Andreas Weber |
Subject: |
[Octave-bug-tracker] [bug #44970] Build fails on ARM because qreal is a typedef for float |
Date: |
Thu, 30 Apr 2015 20:39:45 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.4.0 |
Update of bug #44970 (project octave):
Summary: Build fails on arm => Build fails on ARM
because qreal is a typedef for float
_______________________________________________________
Follow-up Comment #1:
http://koji.fedoraproject.org/koji/getfile?taskID=9608836&name=build.log&offset=-4000
http://doc.qt.io/qt-4.8/qtglobal.html#qreal-typedef
says:
typedef qreal
Typedef for double on all platforms except for those using CPUs with ARM
architectures. On ARM-based platforms, qreal is a typedef for float for
performance reasons.
This causes the problem in
Matrix
toRgb (const QColor& c)
{
Matrix rgb (1, 3);
double* rgbData = rgb.fortran_vec ();
c.getRgbF (rgbData, rgbData+1, rgbData+2);
return rgb;
}
I think this is a ugly patch but just to give an idea:
diff -r 3797df921988 libgui/graphics/QtHandlesUtils.cc
--- a/libgui/graphics/QtHandlesUtils.cc Wed Apr 29 17:09:24 2015 -0700
+++ b/libgui/graphics/QtHandlesUtils.cc Thu Apr 30 22:38:27 2015 +0200
@@ -152,7 +152,12 @@
Matrix rgb (1, 3);
double* rgbData = rgb.fortran_vec ();
- c.getRgbF (rgbData, rgbData+1, rgbData+2);
+ // qreal is a typedef for double except for ARM CPU
+ // architectures where it is a typedef for float. (Bug #44970)
+ qreal tmp[3];
+ c.getRgbF (tmp[0], tmp[1], tmp[2]);
+ for (k=0; k<3; ++k)
+ rgbData[k] = tmp[k];
return rgb;
}
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?44970>
_______________________________________________
Nachricht gesendet von/durch Savannah
http://savannah.gnu.org/