From a66017746fa66ee1ef6874166b7ad5f02e61b668 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Tue, 9 Jun 2015 09:27:49 -0400 Subject: [PATCH] fixed compiler warnings --- openbr/core/opencvutils.cpp | 4 ++-- openbr/core/qtutils.cpp | 9 ++++----- openbr/plugins/classification/dlib.cpp | 1 - openbr/plugins/classification/lda.cpp | 2 +- openbr/plugins/cmake/vbb.cmake | 3 +++ openbr/plugins/gallery/vbb.cpp | 4 ---- openbr/plugins/gallery/vec.cpp | 6 +----- openbr/plugins/gui/adjacentoverlay.cpp | 2 +- 8 files changed, 12 insertions(+), 19 deletions(-) create mode 100644 openbr/plugins/cmake/vbb.cmake diff --git a/openbr/core/opencvutils.cpp b/openbr/core/opencvutils.cpp index 7a43f95..d937ad8 100644 --- a/openbr/core/opencvutils.cpp +++ b/openbr/core/opencvutils.cpp @@ -417,7 +417,7 @@ void OpenCVUtils::group(vector &rects, vector &confidences, float c vector rweights(nClasses, 0); vector rejectWeights(nClasses, -std::numeric_limits::max()); - for (int i = 0; i < labels.size(); i++) + for (size_t i = 0; i < labels.size(); i++) { int cls = labels[i]; rrects[cls].x += rects[i].x; @@ -430,7 +430,7 @@ void OpenCVUtils::group(vector &rects, vector &confidences, float c if (useConfidences) { // For each class, find maximum confidence - for (int i = 0; i < labels.size(); i++) + for (size_t i = 0; i < labels.size(); i++) { int cls = labels[i]; if (confidences[i] > rejectWeights[cls]) diff --git a/openbr/core/qtutils.cpp b/openbr/core/qtutils.cpp index 9203c71..f746fee 100644 --- a/openbr/core/qtutils.cpp +++ b/openbr/core/qtutils.cpp @@ -533,7 +533,7 @@ bool BlockCompression::open(QIODevice::OpenMode mode) blockReader >> block_size; compressedBlock.resize(block_size); int read_count = blockReader.readRawData(compressedBlock.data(), block_size); - if (read_count != block_size) + if (read_count != int(block_size)) qFatal("Failed to read initial block"); decompressedBlock = qUncompress(compressedBlock); @@ -572,7 +572,6 @@ void BlockCompression::setBasis(QIODevice *_basis) // block from basis qint64 BlockCompression::readData(char *data, qint64 remaining) { - qint64 initial = remaining; qint64 read = 0; while (remaining > 0) { // attempt to read the target amount of data @@ -596,8 +595,8 @@ qint64 BlockCompression::readData(char *data, qint64 remaining) compressedBlock.resize(block_size); int actualRead = blockReader.readRawData(compressedBlock.data(), block_size); - if (actualRead != block_size) - qFatal("Bad read on nominal block size: %d, only got %d", block_size, remaining); + if (actualRead != int(block_size)) + qFatal("Bad read on nominal block size: %d, only got %d", block_size, int(remaining)); decompressedBlock = qUncompress(compressedBlock); @@ -654,7 +653,7 @@ qint64 BlockCompression::writeData(const char *data, qint64 remaining) blockWriter << block_size; int write_count = blockWriter.writeRawData(compressedBlock.data(), block_size); - if (write_count != block_size) + if (write_count != int(block_size)) qFatal("Didn't write enough data"); } else diff --git a/openbr/plugins/classification/dlib.cpp b/openbr/plugins/classification/dlib.cpp index 6326fdd..b8696a3 100644 --- a/openbr/plugins/classification/dlib.cpp +++ b/openbr/plugins/classification/dlib.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include diff --git a/openbr/plugins/classification/lda.cpp b/openbr/plugins/classification/lda.cpp index a8c1f79..86907ca 100644 --- a/openbr/plugins/classification/lda.cpp +++ b/openbr/plugins/classification/lda.cpp @@ -614,7 +614,7 @@ class SparseLDATransform : public Transform assert(ldaOrig.projection.cols() == 1); float ldaStd = EigenUtils::stddev(ldaOrig.projection); for (int i = 0; i < ldaOrig.projection.rows(); i++) - if (abs(ldaOrig.projection(i)) > varThreshold * ldaStd) + if (abs(int(ldaOrig.projection(i))) > varThreshold * ldaStd) selections.append(i); TemplateList newSet; diff --git a/openbr/plugins/cmake/vbb.cmake b/openbr/plugins/cmake/vbb.cmake new file mode 100644 index 0000000..9466141 --- /dev/null +++ b/openbr/plugins/cmake/vbb.cmake @@ -0,0 +1,3 @@ +if(NOT ${BR_WITH_CVMATIO}) + set(BR_EXCLUDED_PLUGINS ${BR_EXCLUDED_PLUGINS} plugins/gallery/vbb.cpp) +endif() diff --git a/openbr/plugins/gallery/vbb.cpp b/openbr/plugins/gallery/vbb.cpp index 9076083..5a217ce 100644 --- a/openbr/plugins/gallery/vbb.cpp +++ b/openbr/plugins/gallery/vbb.cpp @@ -14,8 +14,6 @@ * limitations under the License. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef CVMATIO - #include namespace br @@ -92,5 +90,3 @@ BR_REGISTER(Gallery, vbbGallery) } // namespace br #include "gallery/vbb.moc" - -#endif diff --git a/openbr/plugins/gallery/vec.cpp b/openbr/plugins/gallery/vec.cpp index 13dc3ac..0226798 100644 --- a/openbr/plugins/gallery/vec.cpp +++ b/openbr/plugins/gallery/vec.cpp @@ -40,16 +40,12 @@ class vecGallery : public FileGallery if (write1 != sizeof(count) || write2 != sizeof(size) || write3 != sizeof(temp) || write4 != sizeof(temp)) qFatal("Failed to write header."); - for (int i=0; i= outIm.rows) { - clip_roi.height -= abs(outIm.rows - (clip_roi.height + target_location.top() )); + clip_roi.height -= abs(int(outIm.rows - (clip_roi.height + target_location.top()))); } if (clip_roi.x + clip_roi.width >= im.cols) { clip_roi.width -= abs(im.cols - (clip_roi.x + clip_roi.width + 1)); -- libgit2 0.21.4