From 2a16b0d7c6c673abd86bbb7eb523894e6544adb6 Mon Sep 17 00:00:00 2001
From: Rickard Sjoberg <rickard.sjoberg@ericsson.com>
Date: Fri, 4 Oct 2019 15:01:35 +0200
Subject: [PATCH] New attempt to fix a clang issue

---
 source/Lib/CommonLib/AdaptiveLoopFilter.cpp | 37 ++++++++++++---------
 source/Lib/CommonLib/TrQuant.cpp            |  8 ++---
 source/Lib/EncoderLib/EncCu.cpp             |  2 +-
 source/Lib/EncoderLib/IntraSearch.h         |  2 +-
 source/Lib/Utilities/program_options_lite.h |  2 +-
 5 files changed, 28 insertions(+), 23 deletions(-)

diff --git a/source/Lib/CommonLib/AdaptiveLoopFilter.cpp b/source/Lib/CommonLib/AdaptiveLoopFilter.cpp
index 9c46592574..063de8e6ab 100644
--- a/source/Lib/CommonLib/AdaptiveLoopFilter.cpp
+++ b/source/Lib/CommonLib/AdaptiveLoopFilter.cpp
@@ -1195,53 +1195,55 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier **classifier, const PelUnitBuf
         clip = fClipSet + cl.classIdx * MAX_NUM_ALF_LUMA_COEFF;
       }
 
+
       if( filtType == ALF_FILTER_7 )
       {
         if( transposeIdx == 1 )
         {
-          filterCoeff = { coef[9], coef[4], coef[10], coef[8], coef[1], coef[5], coef[11], coef[7], coef[3], coef[0], coef[2], coef[6], coef[12] };
-          filterClipp = { clip[9], clip[4], clip[10], clip[8], clip[1], clip[5], clip[11], clip[7], clip[3], clip[0], clip[2], clip[6], clip[12] };
+          filterCoeff = { { coef[9], coef[4], coef[10], coef[8], coef[1], coef[5], coef[11], coef[7], coef[3], coef[0], coef[2], coef[6], coef[12] }};
+          filterClipp = { { clip[9], clip[4], clip[10], clip[8], clip[1], clip[5], clip[11], clip[7], clip[3], clip[0], clip[2], clip[6], clip[12] }};
         }
         else if( transposeIdx == 2 )
         {
-          filterCoeff = { coef[0], coef[3], coef[2], coef[1], coef[8], coef[7], coef[6], coef[5], coef[4], coef[9], coef[10], coef[11], coef[12] };
-          filterClipp = { clip[0], clip[3], clip[2], clip[1], clip[8], clip[7], clip[6], clip[5], clip[4], clip[9], clip[10], clip[11], clip[12] };
+          filterCoeff = { { coef[0], coef[3], coef[2], coef[1], coef[8], coef[7], coef[6], coef[5], coef[4], coef[9], coef[10], coef[11], coef[12] }};
+          filterClipp = { { clip[0], clip[3], clip[2], clip[1], clip[8], clip[7], clip[6], clip[5], clip[4], clip[9], clip[10], clip[11], clip[12] }};
         }
         else if( transposeIdx == 3 )
         {
-          filterCoeff = { coef[9], coef[8], coef[10], coef[4], coef[3], coef[7], coef[11], coef[5], coef[1], coef[0], coef[2], coef[6], coef[12] };
-          filterClipp = { clip[9], clip[8], clip[10], clip[4], clip[3], clip[7], clip[11], clip[5], clip[1], clip[0], clip[2], clip[6], clip[12] };
+          filterCoeff = { { coef[9], coef[8], coef[10], coef[4], coef[3], coef[7], coef[11], coef[5], coef[1], coef[0], coef[2], coef[6], coef[12] }};
+          filterClipp = { { clip[9], clip[8], clip[10], clip[4], clip[3], clip[7], clip[11], clip[5], clip[1], clip[0], clip[2], clip[6], clip[12] }};
         }
         else
         {
-          filterCoeff = { coef[0], coef[1], coef[2], coef[3], coef[4], coef[5], coef[6], coef[7], coef[8], coef[9], coef[10], coef[11], coef[12] };
-          filterClipp = { clip[0], clip[1], clip[2], clip[3], clip[4], clip[5], clip[6], clip[7], clip[8], clip[9], clip[10], clip[11], clip[12] };
+          filterCoeff = { { coef[0], coef[1], coef[2], coef[3], coef[4], coef[5], coef[6], coef[7], coef[8], coef[9], coef[10], coef[11], coef[12] }};
+          filterClipp = { { clip[0], clip[1], clip[2], clip[3], clip[4], clip[5], clip[6], clip[7], clip[8], clip[9], clip[10], clip[11], clip[12] }};
         }
       }
       else
       {
         if( transposeIdx == 1 )
         {
-          filterCoeff = { coef[4], coef[1], coef[5], coef[3], coef[0], coef[2], coef[6] };
-          filterClipp = { clip[4], clip[1], clip[5], clip[3], clip[0], clip[2], clip[6] };
+          filterCoeff = { { coef[4], coef[1], coef[5], coef[3], coef[0], coef[2], coef[6] }};
+          filterClipp = { { clip[4], clip[1], clip[5], clip[3], clip[0], clip[2], clip[6] }};
         }
         else if( transposeIdx == 2 )
         {
-          filterCoeff = { coef[0], coef[3], coef[2], coef[1], coef[4], coef[5], coef[6] };
-          filterClipp = { clip[0], clip[3], clip[2], clip[1], clip[4], clip[5], clip[6] };
+          filterCoeff = { { coef[0], coef[3], coef[2], coef[1], coef[4], coef[5], coef[6] }};
+          filterClipp = { { clip[0], clip[3], clip[2], clip[1], clip[4], clip[5], clip[6] }};
         }
         else if( transposeIdx == 3 )
         {
-          filterCoeff = { coef[4], coef[3], coef[5], coef[1], coef[0], coef[2], coef[6] };
-          filterClipp = { clip[4], clip[3], clip[5], clip[1], clip[0], clip[2], clip[6] };
+          filterCoeff = { { coef[4], coef[3], coef[5], coef[1], coef[0], coef[2], coef[6] }};
+          filterClipp = { { clip[4], clip[3], clip[5], clip[1], clip[0], clip[2], clip[6] }};
         }
         else
         {
-          filterCoeff = { coef[0], coef[1], coef[2], coef[3], coef[4], coef[5], coef[6] };
-          filterClipp = { clip[0], clip[1], clip[2], clip[3], clip[4], clip[5], clip[6] };
+          filterCoeff = { { coef[0], coef[1], coef[2], coef[3], coef[4], coef[5], coef[6] }};
+          filterClipp = { { clip[0], clip[1], clip[2], clip[3], clip[4], clip[5], clip[6] }};
         }
       }
 
+
       for( int ii = 0; ii < clsSizeY; ii++ )
       {
         pImg0 = pImgYPad0 + j + ii * srcStride;
@@ -1415,3 +1417,6 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier **classifier, const PelUnitBuf
     pImgYPad6 += srcStride2;
   }
 }
+
+
+
diff --git a/source/Lib/CommonLib/TrQuant.cpp b/source/Lib/CommonLib/TrQuant.cpp
index 11ecdde183..5e65217b83 100644
--- a/source/Lib/CommonLib/TrQuant.cpp
+++ b/source/Lib/CommonLib/TrQuant.cpp
@@ -818,14 +818,14 @@ void TrQuant::xT( const TransformUnit &tu, const ComponentID &compID, const CPel
   {
     const int      shift              = ((floorLog2(width )) + bitDepth + TRANSFORM_MATRIX_SHIFT) - maxLog2TrDynamicRange + COM16_C806_TRANS_PREC;
     CHECK( shift < 0, "Negative shift" );
-    CHECKD( ( transformWidthIndex < 0 ), "There is a problem with the width." );
+    //    CHECKD( ( transformWidthIndex < 0 ), "There is a problem with the width." );
     fastFwdTrans[trTypeHor][transformWidthIndex]( block, dstCoeff.buf, shift, 1, 0, skipWidth );
   }
   else //if (iWidth == 1) //1-D vertical transform
   {
     int shift = ( ( floorLog2(height) ) + bitDepth + TRANSFORM_MATRIX_SHIFT ) - maxLog2TrDynamicRange + COM16_C806_TRANS_PREC;
     CHECK( shift < 0, "Negative shift" );
-    CHECKD( ( transformHeightIndex < 0 ), "There is a problem with the height." );
+    //    CHECKD( ( transformHeightIndex < 0 ), "There is a problem with the height." );
     fastFwdTrans[trTypeVer][transformHeightIndex]( block, dstCoeff.buf, shift, 1, 0, skipHeight );
   }
 }
@@ -879,14 +879,14 @@ void TrQuant::xIT( const TransformUnit &tu, const ComponentID &compID, const CCo
   {
     int shift = ( TRANSFORM_MATRIX_SHIFT + maxLog2TrDynamicRange - 1 ) - bitDepth + COM16_C806_TRANS_PREC;
     CHECK( shift < 0, "Negative shift" );
-    CHECK( ( transformHeightIndex < 0 ), "There is a problem with the height." );
+    //    CHECK( ( transformHeightIndex < 0 ), "There is a problem with the height." );
     fastInvTrans[trTypeVer][transformHeightIndex]( pCoeff.buf, block, shift + 1, 1, 0, skipHeight, clipMinimum, clipMaximum );
   }
   else //if(iHeight == 1) //1-D horizontal transform
   {
     const int      shift              = ( TRANSFORM_MATRIX_SHIFT + maxLog2TrDynamicRange - 1 ) - bitDepth + COM16_C806_TRANS_PREC;
     CHECK( shift < 0, "Negative shift" );
-    CHECK( ( transformWidthIndex < 0 ), "There is a problem with the width." );
+    //    CHECK( ( transformWidthIndex < 0 ), "There is a problem with the width." );
     fastInvTrans[trTypeHor][transformWidthIndex]( pCoeff.buf, block, shift + 1, 1, 0, skipWidth, clipMinimum, clipMaximum );
   }
 
diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp
index 46a8db6ff2..c002ab9c8b 100644
--- a/source/Lib/EncoderLib/EncCu.cpp
+++ b/source/Lib/EncoderLib/EncCu.cpp
@@ -2650,7 +2650,7 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
         pu.mhIntraFlag = true;
         pu.regularMergeFlag = false;
         pu.intraDir[0] = PLANAR_IDX;
-        CHECK(pu.intraDir[0]<0 || pu.intraDir[0]>(NUM_LUMA_MODE - 1), "out of intra mode");
+        //        CHECK(pu.intraDir[0]<0 || pu.intraDir[0]>(NUM_LUMA_MODE - 1), "out of intra mode");
         pu.intraDir[1] = DM_CHROMA_IDX;
       }
       else if (RdModeList[uiMrgHADIdx].isMMVD)
diff --git a/source/Lib/EncoderLib/IntraSearch.h b/source/Lib/EncoderLib/IntraSearch.h
index 664d0b3922..a3ee1da27d 100644
--- a/source/Lib/EncoderLib/IntraSearch.h
+++ b/source/Lib/EncoderLib/IntraSearch.h
@@ -262,7 +262,7 @@ private:
     int getNumCompletedSubParts(ISPType splitType, int iModeIdx)
     {
       const unsigned st = splitType - 1;
-      CHECK(st < 0 || st > 1, "The split type is invalid!");
+      //      CHECK(st < 0 || st > 1, "The split type is invalid!");
       CHECK(iModeIdx < 0 || iModeIdx >(NUM_LUMA_MODE - 1), "The modeIdx is invalid");
       return modeHasBeenTested[iModeIdx][st] ? intraMode[iModeIdx][st].numCompSubParts : -1;
     }
diff --git a/source/Lib/Utilities/program_options_lite.h b/source/Lib/Utilities/program_options_lite.h
index dfd082cb73..696a6cdb1e 100644
--- a/source/Lib/Utilities/program_options_lite.h
+++ b/source/Lib/Utilities/program_options_lite.h
@@ -114,7 +114,7 @@ namespace df
     template<typename T>
     struct Option : public OptionBase
     {
-      Option(const std::string& name, T& storage, T default_val, const std::string& desc)
+      Option(const std::string& name, T& storage, T default_val, const std::string& desc) // qqqqq
       : OptionBase(name, desc), opt_storage(storage), opt_default_val(default_val)
       {}
 
-- 
GitLab