several compiler warnings fixed

This commit is contained in:
jkriege2 2019-11-24 12:20:43 +01:00
parent e21a6076f2
commit 9a667b9c22
6 changed files with 8 additions and 9 deletions

View File

@ -120,8 +120,8 @@ TestMain::TestMain(QWidget *parent) :
gl->addWidget(p21, 0, 0, 1, 3); gl->addWidget(p21, 0, 0, 1, 3);
for (int x=0; x<IMAGE_N; x++) { for (int x=0; x<IMAGE_N; x++) {
for (int y=0; y<IMAGE_N; y++) { for (int y=0; y<IMAGE_N; y++) {
imageRed[y*IMAGE_N+x]=(fabs(x)+fabs(y))/2.0; imageRed[y*IMAGE_N+x]=static_cast<double>(std::abs(x)+std::abs(y))/2.0;
imageGreen[y*IMAGE_N+x]=(fabs(double(IMAGE_N)-x)+fabs(y))/2.0; imageGreen[y*IMAGE_N+x]=(fabs(double(IMAGE_N)-x)+static_cast<double>(std::abs(y)))/2.0;
imageBlue[y*IMAGE_N+x]=sqrt(x*x+y*y); imageBlue[y*IMAGE_N+x]=sqrt(x*x+y*y);
} }
} }

View File

@ -112,7 +112,7 @@ TestWidgetBarcharts::TestWidgetBarcharts(QWidget *parent) :
spinBarLabelAngel=new QSpinBox(this); spinBarLabelAngel=new QSpinBox(this);
spinBarLabelAngel->setPrefix(tr("rotation angel: ")); spinBarLabelAngel->setPrefix(tr("rotation angel: "));
spinBarLabelAngel->setSuffix(QLatin1String("°")); spinBarLabelAngel->setSuffix(QLatin1String("\xB0"));
spinBarLabelAngel->setRange(-180,180); spinBarLabelAngel->setRange(-180,180);
spinBarLabelAngel->setValue(0); spinBarLabelAngel->setValue(0);
spinBarLabelAngel->setSingleStep(15); spinBarLabelAngel->setSingleStep(15);
@ -121,7 +121,7 @@ TestWidgetBarcharts::TestWidgetBarcharts(QWidget *parent) :
spinBarLabelAngel2=new QSpinBox(this); spinBarLabelAngel2=new QSpinBox(this);
spinBarLabelAngel2->setPrefix(tr("rotation angel: ")); spinBarLabelAngel2->setPrefix(tr("rotation angel: "));
spinBarLabelAngel2->setSuffix(QLatin1String("°")); spinBarLabelAngel2->setSuffix(QLatin1String("\xB0"));
spinBarLabelAngel2->setRange(-180,180); spinBarLabelAngel2->setRange(-180,180);
spinBarLabelAngel2->setValue(0); spinBarLabelAngel2->setValue(0);
spinBarLabelAngel2->setSingleStep(15); spinBarLabelAngel2->setSingleStep(15);

View File

@ -223,7 +223,7 @@ inline void jkqtpstatHistogram1D(InputIt first, InputIt last, BinsInputIt binsFi
const double v=jkqtp_todouble(*it); const double v=jkqtp_todouble(*it);
if (JKQTPIsOKFloat(v)) { if (JKQTPIsOKFloat(v)) {
auto itb=std::lower_bound(histX.begin(), histX.end(), v); auto itb=std::lower_bound(histX.begin(), histX.end(), v);
size_t bin=jkqtp_bounded<size_t>(0,static_cast<size_t>(abs(std::distance(histX.begin(), itb))), histY.size()-1); size_t bin=jkqtp_bounded<size_t>(0,static_cast<size_t>(std::abs(std::distance(histX.begin(), itb))), histY.size()-1);
histY[bin]++; histY[bin]++;
} }
} }

View File

@ -754,7 +754,7 @@ void JKQTPGraphBoxplotStyleMixin::plotVerticalKeyMarker(JKQTBasePlotter *parent,
const double min=rect.bottom(); const double min=rect.bottom();
const double max=rect.top(); const double max=rect.top();
const double median=max+rect.height()/2.0; const double median=max+rect.height()/2.0;
const double w=abs(xma-xmi); const double w=fabs(xma-xmi);
const double p25=max+0.75*rect.height(); const double p25=max+0.75*rect.height();
const double p75=max+0.25*rect.height(); const double p75=max+0.25*rect.height();

View File

@ -428,7 +428,6 @@ void JKQTPContourPlot::calcContourLines(QList<QVector<QLineF> > &ContourLines)
JKQTPColumnContourPlot::JKQTPColumnContourPlot(JKQTBasePlotter *parent): JKQTPColumnContourPlot::JKQTPColumnContourPlot(JKQTBasePlotter *parent):
JKQTPContourPlot(parent) JKQTPContourPlot(parent)
{ {
this->imageColumn=imageColumn;
this->datatype=JKQTPMathImageDataType::DoubleArray; this->datatype=JKQTPMathImageDataType::DoubleArray;
} }

View File

@ -804,7 +804,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPDatastore{
*/ */
template <typename TIterator> template <typename TIterator>
size_t addCopiedColumn(TIterator first, TIterator last, const QString& name=QString("")) { size_t addCopiedColumn(TIterator first, TIterator last, const QString& name=QString("")) {
const size_t N=static_cast<size_t>(abs(std::distance(first,last))); const size_t N=static_cast<size_t>(std::abs(std::distance(first,last)));
double* d=static_cast<double*>(malloc(static_cast<size_t>(N)*sizeof(double))); double* d=static_cast<double*>(malloc(static_cast<size_t>(N)*sizeof(double)));
if (N>0) { if (N>0) {
size_t r=0; size_t r=0;
@ -1121,7 +1121,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPDatastore{
*/ */
template <typename TIterator> template <typename TIterator>
std::pair<size_t, size_t> addCopiedMap(TIterator first, TIterator last, const QString& nameKey=QString("map_key"), const QString& nameValue=QString("map_value")) { std::pair<size_t, size_t> addCopiedMap(TIterator first, TIterator last, const QString& nameKey=QString("map_key"), const QString& nameValue=QString("map_value")) {
const size_t N=static_cast<size_t>(abs(std::distance(first,last))); const size_t N=static_cast<size_t>(std::abs(std::distance(first,last)));
double* xvals=static_cast<double*>(malloc(N*sizeof(double))); double* xvals=static_cast<double*>(malloc(N*sizeof(double)));
double* yvals=static_cast<double*>(malloc(N*sizeof(double))); double* yvals=static_cast<double*>(malloc(N*sizeof(double)));
size_t i=0; size_t i=0;