mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-24 09:31:40 +08:00
several compiler warnings fixed
This commit is contained in:
parent
e21a6076f2
commit
9a667b9c22
@ -120,8 +120,8 @@ TestMain::TestMain(QWidget *parent) :
|
||||
gl->addWidget(p21, 0, 0, 1, 3);
|
||||
for (int x=0; x<IMAGE_N; x++) {
|
||||
for (int y=0; y<IMAGE_N; y++) {
|
||||
imageRed[y*IMAGE_N+x]=(fabs(x)+fabs(y))/2.0;
|
||||
imageGreen[y*IMAGE_N+x]=(fabs(double(IMAGE_N)-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)+static_cast<double>(std::abs(y)))/2.0;
|
||||
imageBlue[y*IMAGE_N+x]=sqrt(x*x+y*y);
|
||||
}
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ TestWidgetBarcharts::TestWidgetBarcharts(QWidget *parent) :
|
||||
|
||||
spinBarLabelAngel=new QSpinBox(this);
|
||||
spinBarLabelAngel->setPrefix(tr("rotation angel: "));
|
||||
spinBarLabelAngel->setSuffix(QLatin1String("°"));
|
||||
spinBarLabelAngel->setSuffix(QLatin1String("\xB0"));
|
||||
spinBarLabelAngel->setRange(-180,180);
|
||||
spinBarLabelAngel->setValue(0);
|
||||
spinBarLabelAngel->setSingleStep(15);
|
||||
@ -121,7 +121,7 @@ TestWidgetBarcharts::TestWidgetBarcharts(QWidget *parent) :
|
||||
|
||||
spinBarLabelAngel2=new QSpinBox(this);
|
||||
spinBarLabelAngel2->setPrefix(tr("rotation angel: "));
|
||||
spinBarLabelAngel2->setSuffix(QLatin1String("°"));
|
||||
spinBarLabelAngel2->setSuffix(QLatin1String("\xB0"));
|
||||
spinBarLabelAngel2->setRange(-180,180);
|
||||
spinBarLabelAngel2->setValue(0);
|
||||
spinBarLabelAngel2->setSingleStep(15);
|
||||
|
@ -223,7 +223,7 @@ inline void jkqtpstatHistogram1D(InputIt first, InputIt last, BinsInputIt binsFi
|
||||
const double v=jkqtp_todouble(*it);
|
||||
if (JKQTPIsOKFloat(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]++;
|
||||
}
|
||||
}
|
||||
|
@ -754,7 +754,7 @@ void JKQTPGraphBoxplotStyleMixin::plotVerticalKeyMarker(JKQTBasePlotter *parent,
|
||||
const double min=rect.bottom();
|
||||
const double max=rect.top();
|
||||
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 p75=max+0.25*rect.height();
|
||||
|
||||
|
@ -428,7 +428,6 @@ void JKQTPContourPlot::calcContourLines(QList<QVector<QLineF> > &ContourLines)
|
||||
JKQTPColumnContourPlot::JKQTPColumnContourPlot(JKQTBasePlotter *parent):
|
||||
JKQTPContourPlot(parent)
|
||||
{
|
||||
this->imageColumn=imageColumn;
|
||||
this->datatype=JKQTPMathImageDataType::DoubleArray;
|
||||
}
|
||||
|
||||
|
@ -804,7 +804,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPDatastore{
|
||||
*/
|
||||
template <typename TIterator>
|
||||
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)));
|
||||
if (N>0) {
|
||||
size_t r=0;
|
||||
@ -1121,7 +1121,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPDatastore{
|
||||
*/
|
||||
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")) {
|
||||
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* yvals=static_cast<double*>(malloc(N*sizeof(double)));
|
||||
size_t i=0;
|
||||
|
Loading…
Reference in New Issue
Block a user