changeset 1979:b31e494e34c5

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 29 Oct 2022 17:10:21 +0200
parents 95449b0e064a
children 0aac8f552d89
files OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.cpp OrthancStone/Sources/Scene2D/Internals/FixedPointAligner.cpp OrthancStone/Sources/Scene2D/Internals/FixedPointAligner.h OrthancStone/Sources/Viewport/ViewportLocker.cpp OrthancStone/Sources/Viewport/ViewportLocker.h
diffstat 5 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.cpp	Sat Oct 29 16:56:16 2022 +0200
+++ b/OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.cpp	Sat Oct 29 17:10:21 2022 +0200
@@ -1053,7 +1053,11 @@
           }
           
           label_.SetText(buf);
-        }            
+        }
+        else
+        {
+          label_.SetText("?");
+        }
       }
     }
 
--- a/OrthancStone/Sources/Scene2D/Internals/FixedPointAligner.cpp	Sat Oct 29 16:56:16 2022 +0200
+++ b/OrthancStone/Sources/Scene2D/Internals/FixedPointAligner.cpp	Sat Oct 29 17:10:21 2022 +0200
@@ -29,7 +29,7 @@
 {
   namespace Internals
   {
-    FixedPointAligner::FixedPointAligner(ViewportController& controller,
+    FixedPointAligner::FixedPointAligner(const ViewportController& controller,
                                          const ScenePoint2D& p) :
       canvas_(p)
     {
--- a/OrthancStone/Sources/Scene2D/Internals/FixedPointAligner.h	Sat Oct 29 16:56:16 2022 +0200
+++ b/OrthancStone/Sources/Scene2D/Internals/FixedPointAligner.h	Sat Oct 29 17:10:21 2022 +0200
@@ -37,7 +37,7 @@
       ScenePoint2D  canvas_;
 
     public:
-      FixedPointAligner(ViewportController& controller,
+      FixedPointAligner(const ViewportController& controller,
                         const ScenePoint2D& p);
 
       void Apply(ViewportController& controller);
--- a/OrthancStone/Sources/Viewport/ViewportLocker.cpp	Sat Oct 29 16:56:16 2022 +0200
+++ b/OrthancStone/Sources/Viewport/ViewportLocker.cpp	Sat Oct 29 17:10:21 2022 +0200
@@ -40,9 +40,9 @@
   }
   
 
-  ViewportLocker::ViewportLocker(boost::weak_ptr<IViewport> viewport)
+  ViewportLocker::ViewportLocker(boost::weak_ptr<IViewport> viewport) :
+    lock1_(viewport.lock())
   {
-    lock1_ = viewport.lock();
     if (lock1_)
     {
       lock2_.reset(lock1_->Lock());
--- a/OrthancStone/Sources/Viewport/ViewportLocker.h	Sat Oct 29 16:56:16 2022 +0200
+++ b/OrthancStone/Sources/Viewport/ViewportLocker.h	Sat Oct 29 17:10:21 2022 +0200
@@ -36,12 +36,12 @@
     IViewport::ILock& GetLock() const;
 
   public:
-    ViewportLocker(IViewport& viewport) :
+    explicit ViewportLocker(IViewport& viewport) :
       lock2_(viewport.Lock())
     {
     }
 
-    ViewportLocker(boost::weak_ptr<IViewport> viewport);
+    explicit ViewportLocker(boost::weak_ptr<IViewport> viewport);
 
     bool IsValid() const
     {