1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-28 06:43:01 +04:00

build: eliminate GCC8 warnings

This commit is contained in:
Alexander Alekhin
2018-07-16 15:34:59 +03:00
parent 4a3dfffd46
commit d5951bc033
12 changed files with 84 additions and 3 deletions
+19 -2
View File
@@ -2916,12 +2916,29 @@ cvInitImageHeader( IplImage * image, CvSize size, int depth,
if( !image )
CV_Error( CV_HeaderIsNull, "null pointer to header" );
#if defined __GNUC__ && __GNUC__ >= 8
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
memset( image, 0, sizeof( *image ));
#if defined __GNUC__ && __GNUC__ >= 8
#pragma GCC diagnostic pop
#endif
image->nSize = sizeof( *image );
icvGetColorModel( channels, &colorModel, &channelSeq );
strncpy( image->colorModel, colorModel, 4 );
strncpy( image->channelSeq, channelSeq, 4 );
for (int i = 0; i < 4; i++)
{
image->colorModel[i] = colorModel[i];
if (colorModel[i] == 0)
break;
}
for (int i = 0; i < 4; i++)
{
image->channelSeq[i] = channelSeq[i];
if (channelSeq[i] == 0)
break;
}
if( size.width < 0 || size.height < 0 )
CV_Error( CV_BadROISize, "Bad input roi" );