From f6eb57c9dd5240c7dbbf75c5210b9b0e5e0157e1 Mon Sep 17 00:00:00 2001
From: Wenqing Wang <wenqing.wang@ufz.de>
Date: Wed, 2 Aug 2017 17:15:39 +0200
Subject: [PATCH] [Warning] Fixed some compilation warnings

---
 Applications/Utils/MeshEdit/swapNodeCoordinateAxes.cpp | 2 +-
 MathLib/LinAlg/Eigen/EigenMatrix.h                     | 3 ++-
 MathLib/LinAlg/UnifiedMatrixSetters.cpp                | 4 ++--
 ProcessLib/HydroMechanics/CreateLocalAssemblers.h      | 2 +-
 ProcessLib/LIE/Common/PostUtils.cpp                    | 1 +
 5 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Applications/Utils/MeshEdit/swapNodeCoordinateAxes.cpp b/Applications/Utils/MeshEdit/swapNodeCoordinateAxes.cpp
index a2c197d483f..3caddf14f35 100644
--- a/Applications/Utils/MeshEdit/swapNodeCoordinateAxes.cpp
+++ b/Applications/Utils/MeshEdit/swapNodeCoordinateAxes.cpp
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
     cmd.parse( argc, argv );
 
     const std::string str_order = new_order_arg.getValue();
-    std::array<int, 3> new_order = {};
+    std::array<int, 3> new_order = {{}};
     if (!parseNewOrder(str_order, new_order))
         return EXIT_FAILURE;
 
diff --git a/MathLib/LinAlg/Eigen/EigenMatrix.h b/MathLib/LinAlg/Eigen/EigenMatrix.h
index e8fd6b2bf06..d2bc182692e 100644
--- a/MathLib/LinAlg/Eigen/EigenMatrix.h
+++ b/MathLib/LinAlg/Eigen/EigenMatrix.h
@@ -195,7 +195,8 @@ void operator()(EigenMatrix &matrix, SPARSITY_PATTERN const& sparsity_pattern)
                   "Set matrix sparsity relies on the EigenMatrix to be in "
                   "row-major storage order.");
 
-    assert(matrix.getNumberOfRows() == sparsity_pattern.size());
+    assert(matrix.getNumberOfRows()
+               == static_cast<EigenMatrix::IndexType>(sparsity_pattern.size()));
 
     matrix.getRawMatrix().reserve(sparsity_pattern);
 }
diff --git a/MathLib/LinAlg/UnifiedMatrixSetters.cpp b/MathLib/LinAlg/UnifiedMatrixSetters.cpp
index 253d0faea5d..b7893d00548 100644
--- a/MathLib/LinAlg/UnifiedMatrixSetters.cpp
+++ b/MathLib/LinAlg/UnifiedMatrixSetters.cpp
@@ -129,7 +129,7 @@ void setMatrix(EigenMatrix& m,
     auto const rows = m.getNumberOfRows();
     auto const cols = m.getNumberOfColumns();
 
-    assert(values.size() == rows*cols);
+    assert(static_cast<EigenMatrix::IndexType>(values.size()) == rows*cols);
     Eigen::MatrixXd tmp(rows, cols);
 
     auto it = values.begin();
@@ -153,7 +153,7 @@ void addToMatrix(EigenMatrix& m,
     auto const rows = m.getNumberOfRows();
     auto const cols = m.getNumberOfColumns();
 
-    assert(values.size() == rows*cols);
+    assert(static_cast<EigenMatrix::IndexType>(values.size()) == rows*cols);
     Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> tmp(rows, cols);
 
     auto it = values.begin();
diff --git a/ProcessLib/HydroMechanics/CreateLocalAssemblers.h b/ProcessLib/HydroMechanics/CreateLocalAssemblers.h
index e8992a5eeae..b7fe22fad98 100644
--- a/ProcessLib/HydroMechanics/CreateLocalAssemblers.h
+++ b/ProcessLib/HydroMechanics/CreateLocalAssemblers.h
@@ -68,7 +68,7 @@ template <int GlobalDim, template <typename, typename, typename, int>
                          class LocalAssemblerImplementation,
           typename LocalAssemblerInterface, typename... ExtraCtorArgs>
 void createLocalAssemblers(
-    const unsigned dimension,
+    const unsigned /*dimension*/,
     std::vector<MeshLib::Element*> const& mesh_elements,
     NumLib::LocalToGlobalIndexMap const& dof_table,
     const unsigned shapefunction_order,
diff --git a/ProcessLib/LIE/Common/PostUtils.cpp b/ProcessLib/LIE/Common/PostUtils.cpp
index f2a778e16ea..95db2e07caa 100644
--- a/ProcessLib/LIE/Common/PostUtils.cpp
+++ b/ProcessLib/LIE/Common/PostUtils.cpp
@@ -138,6 +138,7 @@ void PostProcessTool::createProperties()
         {
             assert(new_prop->size() ==
                    _output_mesh->getNumberOfNodes() * n_dest_comp);
+            (void)(new_prop); // to avoid compilation warning.
         }
         else if (src_prop->getMeshItemType() == MeshLib::MeshItemType::Cell)
         {
-- 
GitLab