From 501b6e6633e6bc3094064cffa67a003fd18192d6 Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Fri, 15 Jan 2021 11:02:47 +0100
Subject: [PATCH] [MeL] Fix cppcheck 'arg. names diff.' warnings.

---
 .../Mesh2MeshPropertyInterpolation.h          |  6 +++---
 MeshLib/MeshSearch/MeshElementGrid.cpp        | 19 ++++++++++---------
 MeshLib/MeshSearch/MeshElementGrid.h          |  2 +-
 3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h
index 456ced78ac2..a2157419321 100644
--- a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h
+++ b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h
@@ -41,11 +41,11 @@ public:
     /**
      * Calculates entries for the property vector and sets appropriate indices
      * in the mesh elements.
-     * @param mesh the mesh the property information will be calculated and set
-     * via weighted interpolation
+     * @param dest_mesh the mesh the property information will be calculated and
+     * set via weighted interpolation
      * @return true if the operation was successful, false on error
      */
-    bool setPropertiesForMesh(Mesh& mesh) const;
+    bool setPropertiesForMesh(Mesh& dest_mesh) const;
 
 private:
     /**
diff --git a/MeshLib/MeshSearch/MeshElementGrid.cpp b/MeshLib/MeshSearch/MeshElementGrid.cpp
index 8e45f5c60fc..0aa33c7554d 100644
--- a/MeshLib/MeshSearch/MeshElementGrid.cpp
+++ b/MeshLib/MeshSearch/MeshElementGrid.cpp
@@ -21,11 +21,11 @@
 
 #include "GeoLib/GEOObjects.h"
 
-namespace MeshLib {
-
-MeshElementGrid::MeshElementGrid(MeshLib::Mesh const& sfc_mesh) :
-    _aabb{sfc_mesh.getNodes().cbegin(), sfc_mesh.getNodes().cend()},
-    _n_steps({{1,1,1}})
+namespace MeshLib
+{
+MeshElementGrid::MeshElementGrid(MeshLib::Mesh const& mesh)
+    : _aabb{mesh.getNodes().cbegin(), mesh.getNodes().cend()},
+      _n_steps({{1, 1, 1}})
 {
     auto getDimensions =
         [](MathLib::Point3d const& min, MathLib::Point3d const& max)
@@ -49,7 +49,7 @@ MeshElementGrid::MeshElementGrid(MeshLib::Mesh const& sfc_mesh) :
     std::array<double, 3> delta{{ max_pnt[0] - min_pnt[0],
         max_pnt[1] - min_pnt[1], max_pnt[2] - min_pnt[2] }};
 
-    const std::size_t n_eles(sfc_mesh.getNumberOfElements());
+    const std::size_t n_eles(mesh.getNumberOfElements());
     const std::size_t n_eles_per_cell(100);
 
     // *** condition: n_eles / n_cells < n_eles_per_cell
@@ -98,7 +98,7 @@ MeshElementGrid::MeshElementGrid(MeshLib::Mesh const& sfc_mesh) :
     }
 
     _elements_in_grid_box.resize(_n_steps[0]*_n_steps[1]*_n_steps[2]);
-    sortElementsInGridCells(sfc_mesh);
+    sortElementsInGridCells(mesh);
 }
 
 MathLib::Point3d const& MeshElementGrid::getMinPoint() const
@@ -111,9 +111,10 @@ MathLib::Point3d const& MeshElementGrid::getMaxPoint() const
     return _aabb.getMaxPoint();
 }
 
-void MeshElementGrid::sortElementsInGridCells(MeshLib::Mesh const& sfc_mesh)
+void MeshElementGrid::sortElementsInGridCells(MeshLib::Mesh const& mesh)
 {
-    for (auto const element : sfc_mesh.getElements()) {
+    for (auto const element : mesh.getElements())
+    {
         if (! sortElementInGridCells(*element)) {
             OGS_FATAL("Sorting element (id={:d}) into mesh element grid.",
                       element->getID());
diff --git a/MeshLib/MeshSearch/MeshElementGrid.h b/MeshLib/MeshSearch/MeshElementGrid.h
index caae5852840..bd546ffee62 100644
--- a/MeshLib/MeshSearch/MeshElementGrid.h
+++ b/MeshLib/MeshSearch/MeshElementGrid.h
@@ -75,7 +75,7 @@ public:
     MathLib::Point3d const& getMaxPoint() const;
 
 private:
-    void sortElementsInGridCells(MeshLib::Mesh const& sfc_mesh);
+    void sortElementsInGridCells(MeshLib::Mesh const& mesh);
     bool sortElementInGridCells(MeshLib::Element const& element);
 
     GeoLib::AABB _aabb;
-- 
GitLab