From a45b99a4785e99ddaca382039c751f88464d2f21 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sat, 7 Jul 2012 18:24:19 +0000
Subject: [PATCH] fixes for clang compiler

---
 Geo/GFace.cpp               | 4 ++--
 Geo/GFace.h                 | 2 +-
 Geo/gmshVertex.cpp          | 2 +-
 Geo/gmshVertex.h            | 2 +-
 contrib/gmm/gmm_blas.h      | 2 +-
 contrib/gmm/gmm_interface.h | 8 ++++----
 contrib/gmm/gmm_matrix.h    | 4 ++--
 7 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp
index bc24b569f5..ef9a2f2304 100644
--- a/Geo/GFace.cpp
+++ b/Geo/GFace.cpp
@@ -1217,11 +1217,11 @@ int GFace::poincareMesh()
   return vs.size() - es.size() + getNumMeshElements();
 }
 
-int GFace::genusGeom()
+int GFace::genusGeom() const
 {
   int nSeams = 0;
   std::set<GEdge*> single_seams;
-  for (std::list<GEdge*>::iterator it = l_edges.begin();
+  for (std::list<GEdge*>::const_iterator it = l_edges.begin();
        it!=l_edges.end();++it){
     if ((*it)->isSeam(this)){
       nSeams++;
diff --git a/Geo/GFace.h b/Geo/GFace.h
index 282b4bc92d..9aa758b0a1 100644
--- a/Geo/GFace.h
+++ b/Geo/GFace.h
@@ -133,7 +133,7 @@ class GFace : public GEntity
   // by default, genus is ZERO
   int poincareMesh();
   int genusMesh() { return (poincareMesh() + edgeLoops.size() - 2) / 2; }
-  virtual int genusGeom();
+  virtual int genusGeom() const;
   virtual bool checkTopology() const { return true; }
 
   // return the point on the face corresponding to the given parameter
diff --git a/Geo/gmshVertex.cpp b/Geo/gmshVertex.cpp
index 985580e0ee..8aa47ebbb6 100644
--- a/Geo/gmshVertex.cpp
+++ b/Geo/gmshVertex.cpp
@@ -133,7 +133,7 @@ SPoint2 gmshVertex::reparamOnFace(const GFace *face, int dir) const
   }
 }
 
-void gmshVertex::writeGEO(FILE *fp)
+void gmshVertex::writeGEO(FILE *fp, const std::string &meshSizeParameter)
 {
   fprintf(fp, "Point(%d) = {%.16g, %.16g, %.16g, %.16g};\n",
           v->Num, v->Pos.X, v->Pos.Y, v->Pos.Z, v->lc);
diff --git a/Geo/gmshVertex.h b/Geo/gmshVertex.h
index e2d7bfcdb4..f1549fdbd8 100644
--- a/Geo/gmshVertex.h
+++ b/Geo/gmshVertex.h
@@ -33,7 +33,7 @@ class gmshVertex : public GVertex {
     v->lc = meshSize;
   }
   virtual SPoint2 reparamOnFace(const GFace *gf, int) const;
-  virtual void writeGEO(FILE *fp);
+  virtual void writeGEO(FILE *fp, const std::string &meshSizeParameter="");
 };
 
 #endif
diff --git a/contrib/gmm/gmm_blas.h b/contrib/gmm/gmm_blas.h
index 31c76cc460..f320ea0f63 100644
--- a/contrib/gmm/gmm_blas.h
+++ b/contrib/gmm/gmm_blas.h
@@ -292,7 +292,7 @@ namespace gmm {
 		      abstract_sparse) {
     GMM_ASSERT2(vect_size(v1) == mat_ncols(ps) &&
 		vect_size(v2) == mat_nrows(ps), "dimensions mismatch");
-    size_type nr = mat_nrows(ps);
+    //size_type nr = mat_nrows(ps);
     typename linalg_traits<V2>::const_iterator
       it = vect_const_begin(v2), ite = vect_const_end(v2);
     typename strongest_value_type3<V1,V2,MATSP>::value_type res(0);
diff --git a/contrib/gmm/gmm_interface.h b/contrib/gmm/gmm_interface.h
index d7693d6bf3..5f197f6bcf 100644
--- a/contrib/gmm/gmm_interface.h
+++ b/contrib/gmm/gmm_interface.h
@@ -831,8 +831,8 @@ namespace gmm {
     }
     
     void fill(T a, T b = T(0)) { 
-      std::fill(begin_, end+nbc*nbl, b);
-      iterator p = begin_, e = end+nbc*nbl;
+      std::fill(begin_, end()+nbc*nbl, b);
+      iterator p = begin_, e = end()+nbc*nbl;
       while (p < e) { *p = a; p += nbl+1; }
     }
     inline size_type nrows(void) const { return nbl; }
@@ -957,8 +957,8 @@ namespace gmm {
     }
     
     void fill(T a, T b = T(0)) { 
-      std::fill(begin_, end+nbc*nbl, b);
-      iterator p = begin_, e = end+nbc*nbl;
+      std::fill(begin_, end()+nbc*nbl, b);
+      iterator p = begin_, e = end()+nbc*nbl;
       while (p < e) { *p = a; p += nbc+1; }
     }
     inline size_type nrows(void) const { return nbl; }
diff --git a/contrib/gmm/gmm_matrix.h b/contrib/gmm/gmm_matrix.h
index e6cb2a76c2..09946f09e5 100644
--- a/contrib/gmm/gmm_matrix.h
+++ b/contrib/gmm/gmm_matrix.h
@@ -858,8 +858,8 @@ namespace gmm
   };
 
   template <typename MAT> void block_matrix<MAT>::do_clear(void) { 
-    for (size_type j = 0, l = 0; j < ncolblocks_; ++j)
-      for (size_type i = 0, k = 0; i < nrowblocks_; ++i)
+    for (size_type j = 0; j < ncolblocks_; ++j)
+      for (size_type i = 0; i < nrowblocks_; ++i)
 	clear(block(i,j));
   }
 
-- 
GitLab