From f4d9e7b2d359c0e4a500128cc99bc9c8e3bd591e Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 13 May 2014 14:04:06 +0000
Subject: [PATCH] fix warnings

---
 Geo/boundaryLayersData.cpp | 27 +++++++++++++--------------
 Mesh/meshPartition.cpp     |  2 +-
 Numeric/HilbertCurve.cpp   |  4 ++--
 Numeric/decasteljau.cpp    |  4 ++--
 Plugin/CurvedBndDist.cpp   |  2 +-
 5 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/Geo/boundaryLayersData.cpp b/Geo/boundaryLayersData.cpp
index 36c2638bd8..dc0f707a6d 100644
--- a/Geo/boundaryLayersData.cpp
+++ b/Geo/boundaryLayersData.cpp
@@ -1055,9 +1055,11 @@ static int createColumnsBetweenFaces(GRegion *gr,
 
 
   for (std::set<int>::iterator it = gs.begin(); it != gs.end() ; ++it){
-    std::pair<std::multimap<int, GFace*>::iterator, std::multimap<int, GFace*>::iterator> range = lGroup.equal_range(*it);
+    std::pair<std::multimap<int, GFace*>::iterator,
+              std::multimap<int, GFace*>::iterator> range = lGroup.equal_range(*it);
     std::vector<GFace*> joint;
-    for (std::multimap<int, GFace*>::iterator itm =  range.first ; itm !=  range.second ; itm++)
+    for (std::multimap<int, GFace*>::iterator itm =  range.first ;
+         itm !=  range.second ; itm++)
       joint.push_back(itm->second);
     joints.push_back(joint);
     //    SVector3 avg (0,0,0);
@@ -1069,7 +1071,6 @@ static int createColumnsBetweenFaces(GRegion *gr,
     }
     SVector3 avg = computeBestNormal(ns);
 
-
     std::vector<MVertex*> _column;
     std::vector<SMetric3> _metrics;
     avg.normalize();
@@ -1082,7 +1083,6 @@ static int createColumnsBetweenFaces(GRegion *gr,
   //    printf("%d %d\n",gs.size(),joints.size());
   //  }
 
-
   // create wedges
   if (joints.size() > 1){
     for (unsigned int I = 0     ; I < joints.size() ; I++){
@@ -1131,7 +1131,7 @@ static void createColumnsOnSymmetryPlane(MVertex *myV,
       //	  printf("%d columns\n",N);
       std::set<GFace*>::iterator itff = _allGFaces.begin();
       GFace *g1 = *itff ; ++itff; GFace *g2 = *itff;
-      int sense = 1;
+      bool sense = true;
       std::vector<GFace*> _joint;
 
       const BoundaryLayerFan *fan = _face_columns->getFan(myV);
@@ -1144,19 +1144,18 @@ static void createColumnsOnSymmetryPlane(MVertex *myV,
 	if (v11 == myV){
 	  if (v12->onWhat()->dim() == 1){
 	    GEdge *ge1 = (GEdge*)v12->onWhat();
-	    //		printf("COUCOU %d %d %d\n",fan->sense,std::find(l1.begin(),l1.end(),ge1) != l1.end(),std::find(l2.begin(),l2.end(),ge1) != l2.end());
 	    if (std::find(l1.begin(),l1.end(),ge1) != l1.end())sense = fan->sense;
-	    else if (std::find(l2.begin(),l2.end(),ge1) != l2.end())sense = -fan->sense;
-	    //else printf("strange1 %d %d \n");
+	    else if (std::find(l2.begin(),l2.end(),ge1) != l2.end())sense = !fan->sense;
 	  }
-	  else Msg::Error("Cannot choose between directions in a BL (dim = %d)",v12->onWhat()->dim());
+	  else
+            Msg::Error("Cannot choose between directions in a BL (dim = %d)",
+                       v12->onWhat()->dim());
 	}
 	else {
 	  if (v11->onWhat()->dim() == 1){
 	    GEdge *ge1 = (GEdge*)v11->onWhat();
 	    if (std::find(l1.begin(),l1.end(),ge1) != l1.end())sense = fan->sense;
-	    else if (std::find(l2.begin(),l2.end(),ge1) != l2.end())sense = -fan->sense;
-	    //else printf("strange2 %d %d \n");
+	    else if (std::find(l2.begin(),l2.end(),ge1) != l2.end())sense = !fan->sense;
 	  }
 	  else Msg::Error("Cannot choose between directions in a BL");
 	}
@@ -1165,13 +1164,13 @@ static void createColumnsOnSymmetryPlane(MVertex *myV,
 	Msg::Error("No fan on the outgoing BL");
       }
       _joint.push_back(g1);
-      const BoundaryLayerData & c0 = _face_columns->getColumn(myV,sense==1 ? 0 : N-1);
+      const BoundaryLayerData & c0 = _face_columns->getColumn(myV,sense ? 0 : N-1);
       _columns->addColumn(c0._n,myV, c0._column, c0._metrics,_joint);
       _joint.clear();
       _joint.push_back(g2);
-      const BoundaryLayerData & cN = _face_columns->getColumn(myV,sense==1 ? N-1 : 0);
+      const BoundaryLayerData & cN = _face_columns->getColumn(myV,sense ? N-1 : 0);
       _columns->addColumn(cN._n,myV, cN._column, cN._metrics,_joint);
-      if (sense==1){
+      if (sense){
 	for (int k=1;k<N-1;k++){
 	  const BoundaryLayerData & c = _face_columns->getColumn(myV,k);
 	  _columns->addColumn(c._n,myV, c._column, c._metrics);
diff --git a/Mesh/meshPartition.cpp b/Mesh/meshPartition.cpp
index 19241e976e..833609c4eb 100644
--- a/Mesh/meshPartition.cpp
+++ b/Mesh/meshPartition.cpp
@@ -462,7 +462,7 @@ int PartitionGraph(Graph &graph, meshPartitionOptions &options)
           metisOptions[3] = options.refine_algorithm;
           metisOptions[4] = 0;
           for(int u=0;u<options.ncon;u++){
-           ubvec[u]=1.03;
+            ubvec[u] = (float)1.03;
           }
           graph.fillWithMultipleWeights(options.ncon,options.getWeightMapV(), options.getWeightMapE());
           if (options.num_partitions > 1) {
diff --git a/Numeric/HilbertCurve.cpp b/Numeric/HilbertCurve.cpp
index afd34460c2..4d22cf4b88 100644
--- a/Numeric/HilbertCurve.cpp
+++ b/Numeric/HilbertCurve.cpp
@@ -37,7 +37,7 @@ struct HilbertSort
     middle = 0;
     if (arraysize >= threshold) {
       (*depth)++;
-      middle = arraysize * ratio;
+      middle = (int)(arraysize * ratio);
       MultiscaleSortHilbert(vertices, middle, threshold, ratio, depth);
     }
     Sort (&(vertices[middle]),arraysize - middle,0,0,
@@ -54,7 +54,7 @@ struct HilbertSort
     bbox *= 1.01;
     MVertex**pv = &v[0];
     int depth;
-    MultiscaleSortHilbert(pv, v.size(), 64, 0.125,&depth);
+    MultiscaleSortHilbert(pv, (int)v.size(), 64, 0.125,&depth);
   }
 };
 
diff --git a/Numeric/decasteljau.cpp b/Numeric/decasteljau.cpp
index edcf0aaf4d..74cd8723c9 100644
--- a/Numeric/decasteljau.cpp
+++ b/Numeric/decasteljau.cpp
@@ -20,7 +20,7 @@ static int sortedPointInsert(const SPoint3 &p, const double t,
 {
   sortedPoint pnt = {p, t, pts[pos].next};
   pts.push_back(pnt);
-  int newp = pts.size() - 1;
+  int newp = (int)pts.size() - 1;
   pts[pos].next = newp;
   return newp;
 }
@@ -109,7 +109,7 @@ void decasteljau(double tol, const SPoint3 &p0, const SPoint3 &p1, const SPoint3
 static void decasteljau(double tol, std::vector<sortedPoint> &discrete, int pos,
                         const std::vector<SPoint3> &pts, double t0, double te)
 {
-  int order = pts.size() - 1;
+  int order = (int)pts.size() - 1;
   double dmax2 = 0;
   for (int i = 1; i < order ; ++i)
     dmax2 = std::max(dmax2, sqDistPointSegment(pts[i], pts[0], pts[order]));
diff --git a/Plugin/CurvedBndDist.cpp b/Plugin/CurvedBndDist.cpp
index 9b7b90752e..be386c06a1 100644
--- a/Plugin/CurvedBndDist.cpp
+++ b/Plugin/CurvedBndDist.cpp
@@ -16,7 +16,7 @@
 #endif
 
 StringXNumber CurvedBndDistOptions_Number[] = {
- /* {GMSH_FULLRC, "Dim", NULL, -1},*/
+   {GMSH_FULLRC, "Dummy", NULL, -1}
 };
 
 extern "C"
-- 
GitLab