From be4f1e7e93aa8994495bf10172210466aaf241c1 Mon Sep 17 00:00:00 2001
From: Fabian Reister <fabian.reister@kit.edu>
Date: Mon, 5 Jun 2023 12:40:56 +0200
Subject: [PATCH] arviz: fixing compiler warnings (old-style cast)

---
 source/RobotAPI/components/ArViz/Client/Client.h       |  4 ++--
 .../components/ArViz/Client/elements/PointCloud.h      | 10 ++++------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/source/RobotAPI/components/ArViz/Client/Client.h b/source/RobotAPI/components/ArViz/Client/Client.h
index f2d406fec..84dcad9ce 100644
--- a/source/RobotAPI/components/ArViz/Client/Client.h
+++ b/source/RobotAPI/components/ArViz/Client/Client.h
@@ -80,8 +80,8 @@ namespace viz
 
         InteractionFeedbackRange interactions() const
         {
-            InteractionFeedback* begin = (InteractionFeedback*) data_.interactions.data();
-            InteractionFeedback* end = begin + data_.interactions.size();
+            const InteractionFeedback* begin = reinterpret_cast<const InteractionFeedback*>(data_.interactions.data());
+            const InteractionFeedback* end = begin + data_.interactions.size();
             return InteractionFeedbackRange{begin, end};
         }
 
diff --git a/source/RobotAPI/components/ArViz/Client/elements/PointCloud.h b/source/RobotAPI/components/ArViz/Client/elements/PointCloud.h
index a77f79632..78591128d 100644
--- a/source/RobotAPI/components/ArViz/Client/elements/PointCloud.h
+++ b/source/RobotAPI/components/ArViz/Client/elements/PointCloud.h
@@ -71,8 +71,8 @@ namespace armarx::viz
         PointCloud& points(std::vector<ColoredPoint> const& ps)
         {
             std::size_t memorySize = ps.size() * sizeof(ps[0]);
-            Ice::Byte* begin = (Ice::Byte*)ps.data();
-            Ice::Byte* end = begin + memorySize;
+            const Ice::Byte* const begin = reinterpret_cast<const Ice::Byte*>(ps.data());
+            const Ice::Byte* const end = begin + memorySize;
             data_->points.assign(begin, end);
             return *this;
         }
@@ -92,8 +92,8 @@ namespace armarx::viz
 
         PointCloud& addPointUnchecked(ColoredPoint const& p)
         {
-            Ice::Byte* begin = (Ice::Byte*)&p;
-            Ice::Byte* end = begin + sizeof(p);
+            const Ice::Byte* const begin = reinterpret_cast<const Ice::Byte*>(&p);
+            const Ice::Byte* const end = begin + sizeof(p);
             data_->points.insert(data_->points.end(), begin, end);
             return *this;
         }
@@ -391,5 +391,3 @@ namespace armarx::viz
     };
 
 }
-
-
-- 
GitLab