From 067d2b18f8a2995a69c986f9595acbe968bc0ce9 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Fri, 9 Mar 2018 13:07:20 +0100 Subject: [PATCH] Quality SonarCloud things --- tools/clitkUpdateVRTagDicomGenericFilter.txx | 4 ++-- utilities/CxImage/ximaint.cpp | 6 ++++-- utilities/CxImage/ximasel.cpp | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/clitkUpdateVRTagDicomGenericFilter.txx b/tools/clitkUpdateVRTagDicomGenericFilter.txx index a5713c5..fd47485 100644 --- a/tools/clitkUpdateVRTagDicomGenericFilter.txx +++ b/tools/clitkUpdateVRTagDicomGenericFilter.txx @@ -198,8 +198,8 @@ UpdateVRTagDicomGenericFilter::ReadDataElement(std::ifstream& f, //While copy, include the 2 letters of the VRTag //For SQ, I had to count the number of byte with size and endSQ - /* while (f) { - uint32_t tempChar; + /*while (f) { + uint32_t tempChar(0); f.read((char*)&tempChar,1); std::cout << tempChar << std::endl; } diff --git a/utilities/CxImage/ximaint.cpp b/utilities/CxImage/ximaint.cpp index 96b445a..b09d549 100644 --- a/utilities/CxImage/ximaint.cpp +++ b/utilities/CxImage/ximaint.cpp @@ -397,6 +397,8 @@ RGBQUAD CxImage::GetPixelColorInterpolated( kernely[i]=KernelPower((float)(yi+i-1-y)); }//for i break; + default: + i=0; }//switch rr=gg=bb=aa=0; if (((xi+2)=1 && ((yi+2)=1) && !IsIndexed()) { @@ -689,7 +691,7 @@ float CxImage::KernelBSpline(const float x) return (0.16666666666666666667f * (a - (4.0f * b) + (6.0f * c) - (4.0f * d))); - /* equivalent + /* equivalent if (x < -2.0) return(0.0f); if (x < -1.0) @@ -722,7 +724,7 @@ float CxImage::KernelLinear(const float t) // if (-1<=t && t<0) return 1+t; // return 0; - // + // if (t < -1.0f) return 0.0f; if (t < 0.0f) diff --git a/utilities/CxImage/ximasel.cpp b/utilities/CxImage/ximasel.cpp index 669b793..3e7d202 100644 --- a/utilities/CxImage/ximasel.cpp +++ b/utilities/CxImage/ximasel.cpp @@ -137,8 +137,8 @@ bool CxImage::SelectionAddEllipse(RECT r, BYTE level) if (pSelection==NULL) SelectionCreate(); if (pSelection==NULL) return false; - long xradius = abs(r.right - r.left)/2; - long yradius = abs(r.top - r.bottom)/2; + long xradius = labs(r.right - r.left)/2; + long yradius = labs(r.top - r.bottom)/2; if (xradius==0 || yradius==0) return false; long xcenter = (r.right + r.left)/2; -- 2.47.1