From 756304dd1c181f57333ddff45b5f65a98cdc9f74 Mon Sep 17 00:00:00 2001 From: Shanigen Date: Sat, 8 Sep 2018 12:09:19 +0200 Subject: [PATCH] Corrected warnings in CPU ComplexMat This fixes #15. --- src/complexmat.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/complexmat.hpp b/src/complexmat.hpp index 29628cd..eea0bb7 100644 --- a/src/complexmat.hpp +++ b/src/complexmat.hpp @@ -56,9 +56,9 @@ template class ComplexMat_ { void set_channel(int idx, const cv::Mat &mat) { assert(idx >= 0 && idx < n_channels); - for (int i = 0; i < rows; ++i) { + for (uint i = 0; i < rows; ++i) { const std::complex *row = mat.ptr>(i); - for (int j = 0; j < cols; ++j) + for (uint j = 0; j < cols; ++j) p_data[idx * rows * cols + i * cols + j] = row[j]; } } @@ -134,7 +134,7 @@ template class ComplexMat_ { std::vector result; result.reserve(n_channels); - for (int i = 0; i < n_channels; ++i) + for (uint i = 0; i < n_channels; ++i) result.push_back(channel_to_cv_mat(i)); return result; @@ -272,9 +272,9 @@ template class ComplexMat_ { cv::Mat channel_to_cv_mat(int channel_id) const { cv::Mat result(rows, cols, CV_32FC2); - for (int y = 0; y < rows; ++y) { + for (uint y = 0; y < rows; ++y) { std::complex *row_ptr = result.ptr>(y); - for (int x = 0; x < cols; ++x) { + for (uint x = 0; x < cols; ++x) { row_ptr[x] = p_data[channel_id * rows * cols + y * cols + x]; } } -- 2.39.2