diff --git a/uppsrc/ScatterDraw/DataSource.cpp b/uppsrc/ScatterDraw/DataSource.cpp index 4d7820180..cfa4bc845 100644 --- a/uppsrc/ScatterDraw/DataSource.cpp +++ b/uppsrc/ScatterDraw/DataSource.cpp @@ -343,7 +343,7 @@ void DataSource::ZeroCrossing(Getdatafun getdataY, Getdatafun getdataX, bool asc zeros.Clear(); ids.Clear(); - double y_prev, x_prev; + double y_prev = 0, x_prev = 0; int i0; for (i0 = 0; i0 < GetCount(); ++i0) { y_prev = Membercall(getdataY)(i0); @@ -389,7 +389,7 @@ bool DataSource::SinEstim_FreqPhase(double &frequency, double &phase, double avg double T = 0; int numT = 0; double lastZero = Null; - double firstZero; + double firstZero = Null; firstId++; for (int64 id = firstId; id < GetCount(); ++id) { if (IsNull(x(id)) || IsNull(y(id))) diff --git a/uppsrc/ScatterDraw/Legend.cpp b/uppsrc/ScatterDraw/Legend.cpp index 597d04d56..dd0e7d5f1 100644 --- a/uppsrc/ScatterDraw/Legend.cpp +++ b/uppsrc/ScatterDraw/Legend.cpp @@ -63,6 +63,7 @@ void ScatterDraw::DrawLegend(Draw& w) const { plotLeft = int(plotScaleX*hPlotLeft); plotTop = int(plotScaleY*vPlotTop + titleHeight); rectWidth = legendWidth*legendNumCols; + rectHeight = 0; topClip = int(plotScaleY*vPlotTop + titleHeight); nlr = legendNumCols; loclegendRowSpacing = int(legendRowSpacing*textScale); @@ -86,6 +87,7 @@ void ScatterDraw::DrawLegend(Draw& w) const { case RIGHT_TOP: rect.Set(right, top, right + rectWidth, top + rectHeight); break; case LEFT_BOTTOM: rect.Set(left, bottom, left + rectWidth, bottom + rectHeight); break; case RIGHT_BOTTOM: rect.Set(right, bottom, right + rectWidth, bottom + rectHeight);break; + default: rect.Set(0, 0, 0, 0); } w.Clip(int(plotScaleX*hPlotLeft), topClip, plotW, plotH); @@ -160,6 +162,7 @@ void ScatterDraw::DrawRainbowPalette(Draw& w) const { int(plotRight - rainbowPosx), int(plotBottom- rainbowPosy)); break; + default: rect.Set(0, 0, 0, 0); } if (!surfUnits.IsEmpty()) { diff --git a/uppsrc/ScatterDraw/ScatterDraw.h b/uppsrc/ScatterDraw/ScatterDraw.h index cc5bf0416..ac94d7ff1 100644 --- a/uppsrc/ScatterDraw/ScatterDraw.h +++ b/uppsrc/ScatterDraw/ScatterDraw.h @@ -1548,7 +1548,7 @@ void ScatterDraw::Plot(T& w) imin = 0; imax = series[j].PointsData()->GetCount() - 1; } - double dxpix; + double dxpix = 0; if (fastViewX) dxpix = (series[j].PointsData()->x(imax) - series[j].PointsData()->x(imin))/plotW; int npix = 1; @@ -1662,7 +1662,7 @@ void ScatterDraw::Plot(T& w) case ALIGN_LEFT: ddx = 0; break; case ALIGN_CENTER: ddx = -sz.cx/2; break; case ALIGN_RIGHT: ddx = -sz.cx; break; - default: ; // to avoid warning + default: ddx = 0; // to avoid warning } double x = points[i].x + dx + ddx; double y = points[i].y + dy + ddy;