tags 646423 +patch
thanks
Failures like this are caused by code that does not maintain sufficient
distinctions* between double and qreal. On arm architectures qreal is
defined as float while everywhere else it is defined as double.
A patch is attatched which changes the type of some local variables
between double and qreal for values passed through pointers/references
and adds some typecasts for values passed as template parameters this
makes the package build.
These changes should have no impact on other architectures.
BTW if you want to test building your package on arm but don't have the
hardware you can run debian arm in qemu
http://www.aurel32.net/info/debian_arm_qemu.php
* assignments between them are ok because assignments between float and
double are ok but assignments between a pointer to double and a pointer
to qreal are not ok, nor is it ok to pass one to a reference parameter
intended for the other. Further there can be issues related to
overloaded functions and to templates.
Description: fix build on arm by changing variable types and adding typecasts
On most architectures qreal is double but on arm architectures qreal is
float. While it is OK to assign between qreal and double (because it is OK
to assign between float and double) some constructions (pointers, references,
templates) require the programmer to care about the distinction.
Author: Peter Green <plugw...@p10link.net>
Bug-Debian: http://bugs.debian.org/646423
--- kst-2.0.3.orig/src/libkstapp/plotrenderitem.cpp
+++ kst-2.0.3/src/libkstapp/plotrenderitem.cpp
@@ -657,9 +657,9 @@ void PlotRenderItem::highlightNearestDat
bool bFoundImage = false;
qreal distance, minDistance = 1.0E300;
- qreal x, y;
+ double x, y;
QPointF matchedPoint;
- qreal imageZ;
+ double imageZ;
qreal dxPerPix = double(projectionRect().width())/double(rect().width());
foreach(RelationPtr relation, relationList()) {
--- kst-2.0.3.orig/src/libkstapp/mainwindow.cpp
+++ kst-2.0.3/src/libkstapp/mainwindow.cpp
@@ -595,7 +595,7 @@ void MainWindow::savePrinterDefaults(QPr
_dialogDefaults->setValue("print/landscape", printer->orientation() == QPrinter::Landscape);
_dialogDefaults->setValue("print/paperSize", int(printer->paperSize()));
- double left, top, right, bottom;
+ qreal left, top, right, bottom;
printer->getPageMargins(&left, &top, &right, &bottom, QPrinter::Millimeter);
_dialogDefaults->setValue("print/topLeftMargin", QPointF(left, top));
_dialogDefaults->setValue("print/bottomRightMargin", QPointF(right, bottom));
--- kst-2.0.3.orig/src/libkstapp/arrowitem.cpp
+++ kst-2.0.3/src/libkstapp/arrowitem.cpp
@@ -54,7 +54,7 @@ void ArrowItem::paint(QPainter *painter)
double sina = sin(theta);
double cosa = cos(theta);
double yin = sqrt(3.0) * deltax;
- double x1, y1, x2, y2;
+ qreal x1, y1, x2, y2;
QMatrix m(cosa, sina, -sina, cosa, 0.0, 0.0);
m.map( deltax, yin, &x1, &y1);
@@ -75,7 +75,7 @@ void ArrowItem::paint(QPainter *painter)
double sina = sin(theta);
double cosa = cos(theta);
double yin = sqrt(3.0) * deltax;
- double x1, y1, x2, y2;
+ qreal x1, y1, x2, y2;
QMatrix m(cosa, sina, -sina, cosa, 0.0, 0.0);
m.map( deltax, yin, &x1, &y1);
--- kst-2.0.3.orig/src/libkstapp/applicationsettingsdialog.cpp
+++ kst-2.0.3/src/libkstapp/applicationsettingsdialog.cpp
@@ -106,8 +106,8 @@ void ApplicationSettingsDialog::setupGri
void ApplicationSettingsDialog::setupFill() {
QGradientStops stops;
- stops.append(qMakePair(1.0, QColor(Qt::white)));
- stops.append(qMakePair(0.0, QColor(Qt::lightGray)));
+ stops.append(qMakePair((qreal)1.0, QColor(Qt::white)));
+ stops.append(qMakePair((qreal)0.0, QColor(Qt::lightGray)));
_fillTab->gradientEditor()->setDefaultGradientStops(stops);
QBrush b = ApplicationSettings::self()->backgroundBrush();
--- kst-2.0.3.orig/src/libkstapp/plotitem.cpp
+++ kst-2.0.3/src/libkstapp/plotitem.cpp
@@ -989,7 +989,7 @@ void PlotItem::paintPlot(QPainter *paint
}
if (isUseAxisScale()) {
QFont font(painter->font());
- qreal pointSize = qMax((font.pointSizeF() * _numberAxisLabelScaleFactor), ApplicationSettings::self()->minimumFontSize());
+ qreal pointSize = qMax((font.pointSizeF() * _numberAxisLabelScaleFactor), (qreal)(ApplicationSettings::self()->minimumFontSize()));
font.setPointSizeF(pointSize);
painter->setFont(font);
@@ -2662,7 +2662,7 @@ void PlotItem::computedRelationalMax(qre
if (relation->ignoreAutoScale())
continue;
- qreal min, max;
+ double min, max;
relation->yRange(projectionRect().left(),
projectionRect().right(),
&min, &max);
@@ -2670,11 +2670,11 @@ void PlotItem::computedRelationalMax(qre
//If the axis is in log mode, the lower extent will be the
//minimum value larger than zero.
if (yAxis()->axisLog())
- minimum = minimum <= 0.0 ? min : qMin(min, minimum);
+ minimum = minimum <= 0.0 ? min : qMin((qreal)min, minimum);
else
- minimum = qMin(min, minimum);
+ minimum = qMin((qreal)min, minimum);
- maximum = qMax(max, maximum);
+ maximum = qMax((qreal)max, maximum);
}
}
}