From 5c82607003abda391c299d089e4624664a41de7a Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Wed, 14 Nov 2018 00:02:49 +0100
Subject: [PATCH] Fix another bunch of warnings (clang++-7 -Wextra)

---
 src/mesh/Connectivity.hpp       | 26 +++++++++++++-------------
 src/mesh/ConnectivityMatrix.hpp |  8 ++++----
 src/mesh/ItemToItemMatrix.hpp   |  4 ++--
 3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/mesh/Connectivity.hpp b/src/mesh/Connectivity.hpp
index f876f70e1..01c2da0ff 100644
--- a/src/mesh/Connectivity.hpp
+++ b/src/mesh/Connectivity.hpp
@@ -319,7 +319,7 @@ class Connectivity final
   template <ItemType source_item_type,
             ItemType target_item_type>
   PASTIS_INLINE
-  const auto getItemToItemMatrix() const
+  auto getItemToItemMatrix() const
   {
     return ItemToItemMatrix<source_item_type,
                             target_item_type>(_getMatrix(source_item_type,
@@ -327,73 +327,73 @@ class Connectivity final
   }
 
   PASTIS_INLINE
-  const auto cellToFaceMatrix() const
+  auto cellToFaceMatrix() const
   {
     return this->template getItemToItemMatrix<ItemType::cell, ItemType::face>();
   }
 
   PASTIS_INLINE
-  const auto cellToEdgeMatrix() const
+  auto cellToEdgeMatrix() const
   {
     return this->template getItemToItemMatrix<ItemType::cell, ItemType::edge>();
   }
 
   PASTIS_INLINE
-  const auto cellToNodeMatrix() const
+  auto cellToNodeMatrix() const
   {
     return this->template getItemToItemMatrix<ItemType::cell, ItemType::node>();
   }
 
   PASTIS_INLINE
-  const auto faceToCellMatrix() const
+  auto faceToCellMatrix() const
   {
     return this->template getItemToItemMatrix<ItemType::face, ItemType::cell>();
   }
 
   PASTIS_INLINE
-  const auto faceToEdgeMatrix() const
+  auto faceToEdgeMatrix() const
   {
     return this->template getItemToItemMatrix<ItemType::face, ItemType::edge>();
   }
 
   PASTIS_INLINE
-  const auto faceToNodeMatrix() const
+  auto faceToNodeMatrix() const
   {
     return this->template getItemToItemMatrix<ItemType::face, ItemType::node>();
   }
 
   PASTIS_INLINE
-  const auto edgeToCellMatrix() const
+  auto edgeToCellMatrix() const
   {
     return this->template getItemToItemMatrix<ItemType::edge, ItemType::cell>();
   }
 
   PASTIS_INLINE
-  const auto edgeToFaceMatrix() const
+  auto edgeToFaceMatrix() const
   {
     return this->template getItemToItemMatrix<ItemType::edge, ItemType::face>();
   }
 
   PASTIS_INLINE
-  const auto edgeToNodeMatrix() const
+  auto edgeToNodeMatrix() const
   {
     return this->template getItemToItemMatrix<ItemType::edge, ItemType::node>();
   }
 
   PASTIS_INLINE
-  const auto nodeToCellMatrix() const
+  auto nodeToCellMatrix() const
   {
     return this->template getItemToItemMatrix<ItemType::node, ItemType::cell>();
   }
 
   PASTIS_INLINE
-  const auto nodeToFaceMatrix() const
+  auto nodeToFaceMatrix() const
   {
     return this->template getItemToItemMatrix<ItemType::node, ItemType::face>();
   }
 
   PASTIS_INLINE
-  const auto nodeToEdgeMatrix() const
+  auto nodeToEdgeMatrix() const
   {
     return this->template getItemToItemMatrix<ItemType::node, ItemType::edge>();
   }
diff --git a/src/mesh/ConnectivityMatrix.hpp b/src/mesh/ConnectivityMatrix.hpp
index 512c2cfdf..53feb3375 100644
--- a/src/mesh/ConnectivityMatrix.hpp
+++ b/src/mesh/ConnectivityMatrix.hpp
@@ -31,25 +31,25 @@ class ConnectivityMatrix
   }
 
   PASTIS_INLINE
-  const auto numEntries() const
+  auto numEntries() const
   {
     return m_host_matrix.entries.extent(0);
   }
 
   PASTIS_INLINE
-  const auto numRows() const
+  auto numRows() const
   {
     return m_host_matrix.numRows();
   }
 
   PASTIS_INLINE
-  const auto rowConst(const size_t& j) const
+  auto rowConst(const size_t& j) const
   {
     return m_host_matrix.rowConst(j);
   }
 
   PASTIS_INLINE
-  const auto rowMap(const size_t& j) const
+  const auto& rowMap(const size_t& j) const
   {
     return m_host_matrix.row_map[j];
   }
diff --git a/src/mesh/ItemToItemMatrix.hpp b/src/mesh/ItemToItemMatrix.hpp
index 38f8234c7..601951762 100644
--- a/src/mesh/ItemToItemMatrix.hpp
+++ b/src/mesh/ItemToItemMatrix.hpp
@@ -63,7 +63,7 @@ class ItemToItemMatrix
 
  public:
   PASTIS_INLINE
-  const auto operator[](const SourceItemId& source_id) const
+  auto operator[](const SourceItemId& source_id) const
   {
     using RowType = decltype(m_connectivity_matrix.rowConst(source_id));
     return SubItemList<RowType>(m_connectivity_matrix.rowConst(source_id));
@@ -71,7 +71,7 @@ class ItemToItemMatrix
 
   template <typename IndexType>
   PASTIS_INLINE
-  const auto operator[](const IndexType& source_id) const
+  const auto& operator[](const IndexType& source_id) const
   {
     static_assert(std::is_same<IndexType, SourceItemId>(),
                   "ItemToItemMatrix must be indexed using correct ItemId");
-- 
GitLab