From dd5604e0d7cb0e7d4e1c9e3f9b5f51562c6f3b2f Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Tue, 1 May 2018 20:20:27 +0200
Subject: [PATCH] Fixed a bunch of warnings

---
 src/main.cpp                |  2 +-
 src/mesh/Connectivity2D.hpp | 14 +++++++-------
 src/mesh/GmshReader.cpp     |  6 +++---
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp
index 7172de3b1..3cf9e8f8e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -188,7 +188,7 @@ int main(int argc, char *argv[])
     }
 
     std::ofstream gnuplot("sol.gnu");
-    for (int j=0; j<mesh.numberOfCells(); ++j) {
+    for (size_t j=0; j<mesh.numberOfCells(); ++j) {
       for (int r=0; r<3; ++r) {
 	const Rd& x = mesh.xr()[mesh.connectivity().cellNodes()(j,r)];
 	gnuplot << x[0] << ' ' << x[1] << '\n';
diff --git a/src/mesh/Connectivity2D.hpp b/src/mesh/Connectivity2D.hpp
index 30610c9ce..66603aaa8 100644
--- a/src/mesh/Connectivity2D.hpp
+++ b/src/mesh/Connectivity2D.hpp
@@ -156,7 +156,7 @@ public:
     std::cout << "node_ids.size()=" << node_ids.size() << '\n';
     if ((node_ids[0] != 0) or (node_ids[node_ids.size()-1] != node_ids.size()-1)) {
       std::cerr << "sparse node numerotation NIY\n";
-      for (int i=0; i<node_ids.size(); ++i) {
+      for (size_t i=0; i<node_ids.size(); ++i) {
 	std::cout << "node_ids[" << i << "] = " << node_ids[i] << '\n';
       }
       std::exit(0);
@@ -169,8 +169,8 @@ public:
 
 
     Kokkos::View<unsigned short*> node_nb_cells("node_nb_cells", node_ids.size());
-    int max_node_cells = 0;
-    for (int i=0; i<node_cells_vector.size(); ++i) {
+    size_t max_node_cells = 0;
+    for (size_t i=0; i<node_cells_vector.size(); ++i) {
       const auto& cells_vector = node_cells_vector[i];
       const size_t nb_cells = cells_vector.size();
       node_nb_cells[i] = nb_cells;
@@ -190,10 +190,10 @@ public:
 
     Kokkos::View<unsigned short**> node_cell_local_node("node_cell_local_node",
 							node_ids.size(), max_node_cells);
-    Kokkos::parallel_for(m_number_of_nodes, KOKKOS_LAMBDA(const int& r){
-	for (int J=0; J<node_nb_cells[r]; ++J) {
-	  const int j = node_cells(r,J);
-	  for (int R=0; R<cell_nb_nodes[j]; ++R) {
+    Kokkos::parallel_for(m_number_of_nodes, KOKKOS_LAMBDA(const unsigned int& r){
+	for (unsigned short J=0; J<node_nb_cells[r]; ++J) {
+	  const unsigned int j = node_cells(r,J);
+	  for (unsigned int R=0; R<cell_nb_nodes[j]; ++R) {
 	    if (cell_nodes(j,R) == r) {
 	      node_cell_local_node(r,J)=R;
 	      break;
diff --git a/src/mesh/GmshReader.cpp b/src/mesh/GmshReader.cpp
index c9f240434..121d98d76 100644
--- a/src/mesh/GmshReader.cpp
+++ b/src/mesh/GmshReader.cpp
@@ -783,10 +783,10 @@ GmshReader::__proceedData()
       cell_nodes(jq,3) = __quadrangles[j][3];
     }
     const Kokkos::View<unsigned short*> cell_nb_nodes("cell_nb_nodes", nb_cells);
-    for (int j=0; j<nb_triangles; ++j) {
+    for (size_t j=0; j<nb_triangles; ++j) {
       cell_nb_nodes[j] = 3;
     }
-    for (int j=nb_triangles; j<nb_triangles+nb_quadrangles; ++j) {
+    for (size_t j=nb_triangles; j<nb_triangles+nb_quadrangles; ++j) {
       cell_nb_nodes[j] = 4;
     }
     m_connectivity = new Connectivity2D(cell_nb_nodes, cell_nodes);
@@ -803,7 +803,7 @@ GmshReader::__proceedData()
     MeshType& mesh = *m_mesh;
     std::ofstream gnuplot("mesh.gnu");
 
-    for (int j=0; j<mesh.numberOfCells(); ++j) {
+    for (size_t j=0; j<mesh.numberOfCells(); ++j) {
       for (int r=0; r<3; ++r) {
 	const Rd& x = mesh.xr()[mesh.connectivity().cellNodes()(j,r)];
 	gnuplot << x[0] << ' ' << x[1] << '\n';
-- 
GitLab