[Kst] kdeextragear-2/kst/kst
Andrew Walker
arwalker at sumusltd.com
Fri Aug 6 21:52:02 CEST 2004
CVS commit by arwalker:
Compiler warnings.
Use DBL_EPSILON in place of stl.
M +8 -7 kst2dplot.cpp 1.210
M +4 -4 kstimagedialog_i.cpp 1.15
--- kdeextragear-2/kst/kst/kst2dplot.cpp #1.209:1.210
@@ -20,5 +20,4 @@
#include <math.h>
#include <stdio.h>
-#include <limits>
// include files for Qt
@@ -61,4 +60,7 @@
#define DIFFERENCE_PRECISION 7
#define LABEL_PRECISION 9
+#ifndef DBL_EPSILON
+ #define DBL_EPSILON 2.2204460492503131e-016
+#endif
#ifndef DBL_DIG
#define FULL_PRECISION 15
@@ -451,6 +453,5 @@ void Kst2DPlot::setYLabel(const QString&
void Kst2DPlot::checkRange(double &min_in, double &max_in) {
- double epsilon = std::numeric_limits<double>::epsilon();
- double diff = fabs(1000.0 * min_in) * epsilon;
+ double diff = fabs(1000.0 * min_in) * DBL_EPSILON;
if (max_in <= min_in + diff) {
@@ -4402,5 +4403,5 @@ void Kst2DPlot::plotImages(QPainter& p,
numPoints++;
passTop = true;
- topPoint.setX(((lines[k] - zTL)*CONTOUR_STEP + (zTR - zTL)*i) / (zTR - zTL));
+ topPoint.setX((int)(((lines[k] - zTL)*CONTOUR_STEP + (zTR - zTL)*i) / (zTR - zTL)));
topPoint.setY(j);
}
@@ -4409,5 +4410,5 @@ void Kst2DPlot::plotImages(QPainter& p,
numPoints++;
passBottom = true;
- bottomPoint.setX(((lines[k] - zBL)*CONTOUR_STEP + (zBR - zBL)*i) / (zBR - zBL));
+ bottomPoint.setX((int)(((lines[k] - zBL)*CONTOUR_STEP + (zBR - zBL)*i) / (zBR - zBL)));
bottomPoint.setY(j+CONTOUR_STEP);
}
@@ -4416,5 +4417,5 @@ void Kst2DPlot::plotImages(QPainter& p,
numPoints++;
passLeft = true;
- leftPoint.setY(((lines[k] - zTL)*CONTOUR_STEP + (zBL - zTL)*j) / (zBL - zTL));
+ leftPoint.setY((int)(((lines[k] - zTL)*CONTOUR_STEP + (zBL - zTL)*j) / (zBL - zTL)));
leftPoint.setX(i);
}
@@ -4423,5 +4424,5 @@ void Kst2DPlot::plotImages(QPainter& p,
numPoints++;
passRight = true;
- rightPoint.setY(((lines[k] - zTR)*CONTOUR_STEP + (zBR - zTR)*j) / (zBR - zTR));
+ rightPoint.setY((int)(((lines[k] - zTR)*CONTOUR_STEP + (zBR - zTR)*j) / (zBR - zTR)));
rightPoint.setX(i+CONTOUR_STEP);
}
--- kdeextragear-2/kst/kst/kstimagedialog_i.cpp #1.14:1.15
@@ -231,5 +231,5 @@ bool KstImageDialogI::new_I() {
//need a contour map only
QColor tempColor = _contourColor->color();
- image = new KstImage(tag_name, array, _numContourLines->text().toDouble(), tempColor);
+ image = new KstImage(tag_name, array, _numContourLines->text().toInt(), tempColor);
} else if (_colorOnly->isChecked()) {
//need a color map only
@@ -241,5 +241,5 @@ bool KstImageDialogI::new_I() {
KPalette* newPal = new KPalette(_palette->currentText());
image = new KstImage(tag_name, array, lowerZDouble, upperZDouble, newPal,
- _numContourLines->text().toDouble(), tempColor);
+ _numContourLines->text().toInt(), tempColor);
}
@@ -284,5 +284,5 @@ bool KstImageDialogI::edit_I() {
//need a contour map only
QColor tempColor = _contourColor->color();
- DP->changeToContourOnly(_tagName->text(), array, _numContourLines->text().toDouble(), tempColor);
+ DP->changeToContourOnly(_tagName->text(), array, _numContourLines->text().toInt(), tempColor);
} else if (_colorOnly->isChecked()) {
//need a color map only
@@ -294,5 +294,5 @@ bool KstImageDialogI::edit_I() {
KPalette* newPal = new KPalette(_palette->currentText());
DP->changeToColorAndContour(_tagName->text(), array, lowerZDouble, upperZDouble, newPal,
- _numContourLines->text().toDouble(), tempColor);
+ _numContourLines->text().toInt(), tempColor);
}
DP->writeUnlock();
More information about the Kst
mailing list