Skip to content

Commit b9d8360

Browse files
committed
build: eliminate GCC8 warnings
1 parent e7aa0aa commit b9d8360

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

modules/bgsegm/src/bgfg_gsoc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ class BackgroundModel {
237237
if (p.y >= size.height)
238238
p.y = size.height - 1;
239239

240-
memcpy(&samples[i * stride + j * nSamples], &bm.samples[p.y * stride + p.x * nSamples], sizeof(BackgroundSampleType) * nSamples);
240+
for (int k = 0; k < nSamples; k++)
241+
samples[i * stride + j * nSamples + k] = bm.samples[p.y * stride + p.x * nSamples + k];
241242
}
242243
}
243244

modules/bioinspired/samples/OpenEXRimages_HDR_Retina_toneMapping.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ int main(int argc, char* argv[])
294294
*/
295295
cv::waitKey(10);
296296
}
297-
}catch(cv::Exception e)
297+
} catch(const cv::Exception& e)
298298
{
299299
std::cerr<<"Error using Retina : "<<e.what()<<std::endl;
300300
}

modules/rgbd/src/linemod.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,8 +994,8 @@ static void spread(const Mat& src, Mat& dst, int T)
994994
int height = src.rows - r;
995995
for (int c = 0; c < T; ++c)
996996
{
997-
orUnaligned8u(&src.at<unsigned char>(r, c), static_cast<const int>(src.step1()), dst.ptr(),
998-
static_cast<const int>(dst.step1()), src.cols - c, height);
997+
orUnaligned8u(&src.at<unsigned char>(r, c), static_cast<int>(src.step1()), dst.ptr(),
998+
static_cast<int>(dst.step1()), src.cols - c, height);
999999
}
10001000
}
10011001
}

modules/sfm/src/libmv_light/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ include(CMake/Installation.cmake)
44
set(BUILD_SHARED_LIBS OFF) # Force static libs for 3rdparty dependencies
55

66
ocv_warnings_disable(CMAKE_CXX_FLAGS -Winconsistent-missing-override -Wsuggest-override)
7+
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
8+
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wclass-memaccess)
9+
endif()
710

811
add_subdirectory(libmv)

0 commit comments

Comments
 (0)