From 4d57622ae4e2a83b83069ba0ade3e68d534e937e Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Thu, 16 Apr 2020 09:22:09 +0200
Subject: [PATCH] [GL] Fix cppcoreguidelines-pro-type-member-init.

---
 GeoLib/Grid.h        | 4 ++--
 GeoLib/Raster.cpp    | 2 +-
 GeoLib/SurfaceGrid.h | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/GeoLib/Grid.h b/GeoLib/Grid.h
index 8e0120b9898..8e6c075ab67 100644
--- a/GeoLib/Grid.h
+++ b/GeoLib/Grid.h
@@ -377,7 +377,7 @@ template <typename POINT>
 template <typename T>
 std::array<std::size_t,3> Grid<POINT>::getGridCoords(T const& pnt) const
 {
-    std::array<std::size_t,3> coords;
+    std::array<std::size_t,3> coords{};
     for (std::size_t k(0); k < 3; k++)
     {
         if (pnt[k] < _min_pnt[k])
@@ -407,7 +407,7 @@ template <typename P>
 std::array<double,6> Grid<POINT>::getPointCellBorderDistances(P const& p,
     std::array<std::size_t,3> const& coords) const
 {
-    std::array<double,6> dists;
+    std::array<double,6> dists{};
     dists[0] = std::abs(p[2]-_min_pnt[2] + coords[2]*_step_sizes[2]); // bottom
     dists[5] = std::abs(p[2]-_min_pnt[2] + (coords[2]+1)*_step_sizes[2]); // top
 
diff --git a/GeoLib/Raster.cpp b/GeoLib/Raster.cpp
index 7cdd4653a02..7336958d5de 100644
--- a/GeoLib/Raster.cpp
+++ b/GeoLib/Raster.cpp
@@ -99,7 +99,7 @@ double Raster::interpolateValueAtPoint(MathLib::Point3d const& pnt) const
     std::array<int,4> const y_nb = {{ 0, 0, yShiftIdx, yShiftIdx }};
 
     // get pixel values
-    std::array<double,4>  pix_val;
+    std::array<double,4>  pix_val{};
     unsigned no_data_count (0);
     for (unsigned j=0; j<4; ++j)
     {
diff --git a/GeoLib/SurfaceGrid.h b/GeoLib/SurfaceGrid.h
index 8106e6476b4..9ddba3ffee2 100644
--- a/GeoLib/SurfaceGrid.h
+++ b/GeoLib/SurfaceGrid.h
@@ -38,8 +38,8 @@ private:
     bool sortTriangleInGridCells(GeoLib::Triangle const*const triangle);
     boost::optional<std::array<std::size_t,3>>
         getGridCellCoordinates(MathLib::Point3d const& p) const;
-    std::array<double,3> _step_sizes;
-    std::array<double,3> _inverse_step_sizes;
+    std::array<double,3> _step_sizes{};
+    std::array<double,3> _inverse_step_sizes{};
     std::array<std::size_t,3> _n_steps;
     std::vector<std::vector<GeoLib::Triangle const*>> _triangles_in_grid_box;
 };
-- 
GitLab