changeset 331:cf828b381bc9

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 18 Oct 2024 13:16:02 +0200
parents c42083d50ddf
children e32ccca4d772
files Framework/ColorSpaces.h ViewerPlugin/Plugin.cpp
diffstat 2 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/ColorSpaces.h	Fri Oct 18 13:08:55 2024 +0200
+++ b/Framework/ColorSpaces.h	Fri Oct 18 13:16:02 2024 +0200
@@ -51,7 +51,7 @@
     {
     }
 
-    RGBColor(const sRGBColor& srgb);
+    explicit RGBColor(const sRGBColor& srgb);
 
     uint8_t GetR() const
     {
@@ -89,9 +89,9 @@
     {
     }
 
-    sRGBColor(const RGBColor& rgb);
+    explicit sRGBColor(const RGBColor& rgb);
 
-    sRGBColor(const XYZColor& xyz);
+    explicit sRGBColor(const XYZColor& xyz);
 
     float GetR() const
     {
@@ -118,9 +118,9 @@
     float  z_;
 
   public:
-    XYZColor(const sRGBColor& srgb);
+    explicit XYZColor(const sRGBColor& srgb);
 
-    XYZColor(const LABColor& lab);
+    explicit XYZColor(const LABColor& lab);
 
     float GetX() const
     {
@@ -163,7 +163,7 @@
     {
     }
 
-    LABColor(const XYZColor& xyz);
+    explicit LABColor(const XYZColor& xyz);
 
     float GetL() const
     {
--- a/ViewerPlugin/Plugin.cpp	Fri Oct 18 13:08:55 2024 +0200
+++ b/ViewerPlugin/Plugin.cpp	Fri Oct 18 13:16:02 2024 +0200
@@ -108,7 +108,6 @@
 
   {
     // New in WSI 2.1
-    char tmp[16];
     sprintf(tmp, "#%02x%02x%02x", locker.GetPyramid().GetBackgroundRed(),
             locker.GetPyramid().GetBackgroundGreen(),
             locker.GetPyramid().GetBackgroundBlue());