1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-18 17:24:28 +08:00

build: eliminate GCC8 warnings

This commit is contained in:
Alexander Alekhin
2018-07-16 17:09:31 +03:00
parent e7aa0aa2d4
commit b9d83609de
4 changed files with 8 additions and 4 deletions

View File

@@ -237,7 +237,8 @@ public:
if (p.y >= size.height)
p.y = size.height - 1;
memcpy(&samples[i * stride + j * nSamples], &bm.samples[p.y * stride + p.x * nSamples], sizeof(BackgroundSampleType) * nSamples);
for (int k = 0; k < nSamples; k++)
samples[i * stride + j * nSamples + k] = bm.samples[p.y * stride + p.x * nSamples + k];
}
}

View File

@@ -294,7 +294,7 @@ int main(int argc, char* argv[])
*/
cv::waitKey(10);
}
}catch(cv::Exception e)
} catch(const cv::Exception& e)
{
std::cerr<<"Error using Retina : "<<e.what()<<std::endl;
}

View File

@@ -994,8 +994,8 @@ static void spread(const Mat& src, Mat& dst, int T)
int height = src.rows - r;
for (int c = 0; c < T; ++c)
{
orUnaligned8u(&src.at<unsigned char>(r, c), static_cast<const int>(src.step1()), dst.ptr(),
static_cast<const int>(dst.step1()), src.cols - c, height);
orUnaligned8u(&src.at<unsigned char>(r, c), static_cast<int>(src.step1()), dst.ptr(),
static_cast<int>(dst.step1()), src.cols - c, height);
}
}
}

View File

@@ -4,5 +4,8 @@ include(CMake/Installation.cmake)
set(BUILD_SHARED_LIBS OFF) # Force static libs for 3rdparty dependencies
ocv_warnings_disable(CMAKE_CXX_FLAGS -Winconsistent-missing-override -Wsuggest-override)
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wclass-memaccess)
endif()
add_subdirectory(libmv)