Fixed several issues detected by static analysis

This commit is contained in:
Maksim Shabunin 2018-02-22 13:20:35 +03:00
parent fbb2cabe77
commit 92e9d4ec3a
4 changed files with 7 additions and 6 deletions

View File

@ -338,7 +338,7 @@ struct LayerPin
struct LayerData struct LayerData
{ {
LayerData() : id(-1), flag(0) {} LayerData() : id(-1), skip(false), flag(0) {}
LayerData(int _id, const String &_name, const String &_type, LayerParams &_params) LayerData(int _id, const String &_name, const String &_type, LayerParams &_params)
: id(_id), name(_name), type(_type), params(_params), skip(false), flag(0) : id(_id), name(_name), type(_type), params(_params), skip(false), flag(0)
{ {

View File

@ -270,7 +270,7 @@ public:
int poolingType; int poolingType;
float spatialScale; float spatialScale;
PoolingInvoker() : src(0), rois(0), dst(0), mask(0), nstripes(0), PoolingInvoker() : src(0), rois(0), dst(0), mask(0), avePoolPaddedArea(false), nstripes(0),
computeMaxIdx(0), poolingType(MAX), spatialScale(0) {} computeMaxIdx(0), poolingType(MAX), spatialScale(0) {}
static void run(const Mat& src, const Mat& rois, Mat& dst, Mat& mask, Size kernel, static void run(const Mat& src, const Mat& rois, Mat& dst, Mat& mask, Size kernel,

View File

@ -587,12 +587,13 @@ bool TiffDecoder::readData_32FC1(Mat& img)
tsize_t scanlength = TIFFScanlineSize(tif); tsize_t scanlength = TIFFScanlineSize(tif);
tdata_t buf = _TIFFmalloc(scanlength); tdata_t buf = _TIFFmalloc(scanlength);
float* data; float* data;
bool result = true;
for (uint32 row = 0; row < img_height; row++) for (uint32 row = 0; row < img_height; row++)
{ {
if (TIFFReadScanline(tif, buf, row) != 1) if (TIFFReadScanline(tif, buf, row) != 1)
{ {
close(); result = false;
return false; break;
} }
data=(float*)buf; data=(float*)buf;
for (uint32 i=0; i<img_width; i++) for (uint32 i=0; i<img_width; i++)
@ -603,7 +604,7 @@ bool TiffDecoder::readData_32FC1(Mat& img)
_TIFFfree(buf); _TIFFfree(buf);
close(); close();
return true; return result;
} }
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////

View File

@ -92,7 +92,7 @@ protected:
double varTmp; double varTmp;
int index; int index;
public: public:
SimulatedAnnealingANN_MLP(ml::ANN_MLP& x, const Ptr<ml::TrainData>& d) : nn(x), data(d) SimulatedAnnealingANN_MLP(ml::ANN_MLP& x, const Ptr<ml::TrainData>& d) : nn(x), data(d), varTmp(0.0), index(0)
{ {
initVarMap(); initVarMap();
} }