From 2e251391bc7fd3bb703d3cba1be9611365e46e96 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Thu, 18 Aug 2016 12:05:32 +0000
Subject: [PATCH] fix compile

---
 Geo/discreteDiskFace.cpp                      | 29 ++++++++++---------
 .../MeshQualityOptimizer.h                    |  5 ++--
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/Geo/discreteDiskFace.cpp b/Geo/discreteDiskFace.cpp
index 86c7cfdbb5..3f205ee6b4 100644
--- a/Geo/discreteDiskFace.cpp
+++ b/Geo/discreteDiskFace.cpp
@@ -462,7 +462,7 @@ bool discreteDiskFace::checkOrientationUV()
   discreteDiskFaceTriangle *ct;
 
   if(_order==1){
-    double initial, current; // initial and current orientation
+    double current; // initial and current orientation
     ct = &_ddft[0];
     double p1[2] = {ct->p[0].x(), ct->p[0].y()};
     double p2[2] = {ct->p[1].x(), ct->p[1].y()};
@@ -1010,7 +1010,8 @@ void discreteDiskFace::printParamMesh()
 
 // computes some kind of maximal distance in a mesh
 
-static void addTo (std::map<MVertex*, std::vector<MElement*> > &v2t, MVertex *v, MElement *t){
+static void addTo (std::map<MVertex*, std::vector<MElement*> > &v2t, MVertex *v, MElement *t)
+{
   std::map<MVertex*, std::vector<MElement*> > :: iterator it = v2t.find(v);
   if (it == v2t.end()){
     std::vector<MElement*> tt; tt.push_back(t);
@@ -1018,7 +1019,9 @@ static void addTo (std::map<MVertex*, std::vector<MElement*> > &v2t, MVertex *v,
   }
   else it->second.push_back(t);
 }
-static void update(std::map<MVertex*,double> &Close, MVertex *v2, double d){
+
+static void update(std::map<MVertex*,double> &Close, MVertex *v2, double d)
+{
   std::map<MVertex*,double>::iterator it = Close.find(v2);
   if (it == Close.end())Close[v2] = d;
   else if (it->second > d) it->second=d;
@@ -1026,9 +1029,11 @@ static void update(std::map<MVertex*,double> &Close, MVertex *v2, double d){
 
 }
 
-static MEdge getEdge (MElement *t, MVertex *v){
+static MEdge getEdge (MElement *t, MVertex *v)
+{
   for (int i=0;i<3;i++)
     if (t->getVertex(i) == v) return t->getEdge((i+1)%3);
+  return MEdge();
 }
 
 /* warning
@@ -1042,9 +1047,8 @@ static double computeDistanceLinePoint (MVertex *v1, MVertex *v2, MVertex *v){
 
 }
 */
-static double computeDistance (MVertex *v1, double d1, MVertex *v2, double d2, MVertex *v){
-
-
+static double computeDistance (MVertex *v1, double d1, MVertex *v2, double d2, MVertex *v)
+{
   //       o------------a
   //
   //
@@ -1077,8 +1081,8 @@ static double computeDistance (MVertex *v1, double d1, MVertex *v2, double d2, M
   return sqrt ((x0-xv)*(x0-xv)+(y0-yv)*(y0-yv));
 }
 
-std::map<MVertex*,double>::iterator closest (std::map<MVertex*,double> &Close){
-
+std::map<MVertex*,double>::iterator closest (std::map<MVertex*,double> &Close)
+{
   std::map<MVertex*,double>::iterator itClose;
   double c = 1.e22;
   for (std::map<MVertex*,double>::iterator it = Close.begin(); it != Close.end(); ++it){
@@ -1090,9 +1094,8 @@ std::map<MVertex*,double>::iterator closest (std::map<MVertex*,double> &Close){
   return itClose;
 }
 
-
-
-double triangulation::geodesicDistance () {
+double triangulation::geodesicDistance ()
+{
   if (bord.empty())return 1.e22;
   std::map<MVertex*, std::vector<MElement*> > v2t;
   for (size_t i=0;i<tri.size();++i){
@@ -1191,8 +1194,6 @@ double triangulation::geodesicDistance () {
   */
 
   return CLOSEST;
-
 }
 
-
 #endif
diff --git a/contrib/MeshQualityOptimizer/MeshQualityOptimizer.h b/contrib/MeshQualityOptimizer/MeshQualityOptimizer.h
index 630bd3f90d..9bcd04df02 100644
--- a/contrib/MeshQualityOptimizer/MeshQualityOptimizer.h
+++ b/contrib/MeshQualityOptimizer/MeshQualityOptimizer.h
@@ -63,9 +63,10 @@ struct MeshQualOptParameters {
       minTargetIdealJac(0.1), minTargetInvCondNum(0.1), weight(1.),
       nbLayers (6) , dim(3) , maxOptIter(300), maxBarrierUpdates(50),
       onlyVisible(true), distanceFactor(12), fixBndNodes(false), strategy(0),
-    maxPatchAdapt(3), maxLayersAdaptFact(2), distanceAdaptFact(2.), nCurses(1), logFileName(""), CPU(0.),
+      maxPatchAdapt(3), maxLayersAdaptFact(2), distanceAdaptFact(2.), nCurses(1), logFileName(""),
+      SUCCESS(-1),
       minIdealJac(0.), maxIdealJac(0.), minInvCondNum(0.), maxInvCondNum(0.),
-      SUCCESS(-1)
+      CPU(0.)
   {
   }
 };
-- 
GitLab