1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #11986 from alalek:build_eliminate_gcc8_warnings

This commit is contained in:
Alexander Alekhin
2018-07-17 15:41:36 +00:00
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" );