changeset 1309:1f877e0846fe broker

Fixed some warnings + fixed build for C++03
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 04 Mar 2020 13:20:12 +0100
parents adf234ecaa00
children 9bea7e15b519
files Framework/Loaders/SeriesFramesLoader.cpp Framework/Radiography/RadiographyScene.cpp Framework/Scene2DViewport/AngleMeasureTool.cpp Framework/Scene2DViewport/CreateAngleMeasureCommand.cpp Framework/Scene2DViewport/CreateLineMeasureCommand.cpp Framework/Scene2DViewport/LineMeasureTool.cpp Framework/Scene2DViewport/ViewportController.cpp UnitTestsSources/UnitTestsMain.cpp
diffstat 8 files changed, 17 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Loaders/SeriesFramesLoader.cpp	Wed Mar 04 10:21:54 2020 +0100
+++ b/Framework/Loaders/SeriesFramesLoader.cpp	Wed Mar 04 13:20:12 2020 +0100
@@ -226,7 +226,7 @@
         float w = payload.GetWindowingWidth();
         if (w <= 0.01f)
         {
-          w = 0.01;  // Prevent division by zero
+          w = 0.01f;  // Prevent division by zero
         }
 
         const float c = payload.GetWindowingCenter();
--- a/Framework/Radiography/RadiographyScene.cpp	Wed Mar 04 10:21:54 2020 +0100
+++ b/Framework/Radiography/RadiographyScene.cpp	Wed Mar 04 13:20:12 2020 +0100
@@ -715,7 +715,7 @@
     // wipe background before rendering
     if (GetPreferredPhotomotricDisplayMode() == RadiographyPhotometricDisplayMode_Monochrome1)
     {
-      Orthanc::ImageProcessing::Set(layers, 65535.0f);
+      Orthanc::ImageProcessing::Set(layers, 65535);
     }
     else
     {
--- a/Framework/Scene2DViewport/AngleMeasureTool.cpp	Wed Mar 04 10:21:54 2020 +0100
+++ b/Framework/Scene2DViewport/AngleMeasureTool.cpp	Wed Mar 04 13:20:12 2020 +0100
@@ -45,9 +45,9 @@
     IViewport& viewport)
     : MeasureTool(viewport)
 #if ORTHANC_STONE_ENABLE_OUTLINED_TEXT == 1
-    , layerHolder_(boost::make_shared<LayerHolder>(viewport,1,5))
+    , layerHolder_(boost::shared_ptr<LayerHolder>(new LayerHolder(viewport,1,5)))
 #else
-    , layerHolder_(boost::make_shared<LayerHolder>(viewport, 1, 1))
+    , layerHolder_(boost::shared_ptr<LayerHolder>(new LayerHolder(viewport,1,1)))
 #endif
     , angleHighlightArea_(AngleHighlightArea_None)
   {
--- a/Framework/Scene2DViewport/CreateAngleMeasureCommand.cpp	Wed Mar 04 10:21:54 2020 +0100
+++ b/Framework/Scene2DViewport/CreateAngleMeasureCommand.cpp	Wed Mar 04 13:20:12 2020 +0100
@@ -30,7 +30,7 @@
     ScenePoint2D           point)
     : CreateMeasureCommand(viewport)
     , measureTool_(
-      boost::make_shared<AngleMeasureTool>(viewport))
+      boost::shared_ptr<AngleMeasureTool>(new AngleMeasureTool(viewport)))
   {
     
     std::unique_ptr<IViewport::ILock> lock(viewport_.Lock());
--- a/Framework/Scene2DViewport/CreateLineMeasureCommand.cpp	Wed Mar 04 10:21:54 2020 +0100
+++ b/Framework/Scene2DViewport/CreateLineMeasureCommand.cpp	Wed Mar 04 13:20:12 2020 +0100
@@ -30,7 +30,7 @@
     ScenePoint2D           point)
     : CreateMeasureCommand(viewport)
     , measureTool_(
-      boost::make_shared<LineMeasureTool>(viewport))
+      boost::shared_ptr<LineMeasureTool>(new LineMeasureTool(viewport)))
   {
     
     std::unique_ptr<IViewport::ILock> lock(viewport_.Lock());
--- a/Framework/Scene2DViewport/LineMeasureTool.cpp	Wed Mar 04 10:21:54 2020 +0100
+++ b/Framework/Scene2DViewport/LineMeasureTool.cpp	Wed Mar 04 13:20:12 2020 +0100
@@ -35,9 +35,9 @@
     IViewport& viewport)
     : MeasureTool(viewport)
 #if ORTHANC_STONE_ENABLE_OUTLINED_TEXT == 1
-    , layerHolder_(boost::make_shared<LayerHolder>(viewport, 1, 5))
+    , layerHolder_(boost::shared_ptr<LayerHolder>(new LayerHolder(viewport,1,5)))
 #else
-    , layerHolder_(boost::make_shared<LayerHolder>(viewport, 1, 1))
+    , layerHolder_(boost::shared_ptr<LayerHolder>(new LayerHolder(viewport,1,1)))
 #endif
     , lineHighlightArea_(LineHighlightArea_None)
   {
--- a/Framework/Scene2DViewport/ViewportController.cpp	Wed Mar 04 10:21:54 2020 +0100
+++ b/Framework/Scene2DViewport/ViewportController.cpp	Wed Mar 04 13:20:12 2020 +0100
@@ -66,7 +66,8 @@
 
   ViewportController::ViewportController(IViewport& viewport) 
     : viewport_(viewport)
-    , undoStackW_(boost::make_shared<OrthancStone::UndoStack>())
+    , undoStackW_(boost::shared_ptr<UndoStack>(new UndoStack()))
+
     , scene_(new Scene2D)
     , canvasToSceneFactor_(1)
   {
@@ -75,7 +76,7 @@
   ViewportController::ViewportController(IViewport& viewport,
                                          const Scene2D& scene)
     : viewport_(viewport)
-    , undoStackW_(boost::make_shared<OrthancStone::UndoStack>())
+    , undoStackW_(boost::shared_ptr<UndoStack>(new UndoStack()))
     , scene_(scene.Clone())
     , canvasToSceneFactor_(1)
   {
--- a/UnitTestsSources/UnitTestsMain.cpp	Wed Mar 04 10:21:54 2020 +0100
+++ b/UnitTestsSources/UnitTestsMain.cpp	Wed Mar 04 13:20:12 2020 +0100
@@ -807,21 +807,21 @@
 
   ASSERT_TRUE(OrthancStone::LinearAlgebra::ParseVector(v, "1.2"));
   ASSERT_EQ(1u, v.size());
-  ASSERT_FLOAT_EQ(1.2f, v[0]);
+  ASSERT_DOUBLE_EQ(1.2, v[0]);
 
   ASSERT_TRUE(OrthancStone::LinearAlgebra::ParseVector(v, "-1.2e+2"));
   ASSERT_EQ(1u, v.size());
-  ASSERT_FLOAT_EQ(-120.0f, v[0]);
+  ASSERT_DOUBLE_EQ(-120.0, v[0]);
 
   ASSERT_TRUE(OrthancStone::LinearAlgebra::ParseVector(v, "-1e-2\\2"));
   ASSERT_EQ(2u, v.size());
-  ASSERT_FLOAT_EQ(-0.01f, v[0]);
-  ASSERT_FLOAT_EQ(2.0f, v[1]);
+  ASSERT_DOUBLE_EQ(-0.01, v[0]);
+  ASSERT_DOUBLE_EQ(2.0, v[1]);
 
   ASSERT_TRUE(OrthancStone::LinearAlgebra::ParseVector(v, "1.3671875\\1.3671875"));
   ASSERT_EQ(2u, v.size());
-  ASSERT_FLOAT_EQ(1.3671875, v[0]);
-  ASSERT_FLOAT_EQ(1.3671875, v[1]); 
+  ASSERT_DOUBLE_EQ(1.3671875, v[0]);
+  ASSERT_DOUBLE_EQ(1.3671875, v[1]); 
 }