From af5760b78904dcb70d384ca42a10be314f764868 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Wed, 28 Oct 2009 06:55:32 +0000
Subject: [PATCH] fix warnings

---
 CMakeLists.txt               | 2 +-
 Common/ConnectionManager.cpp | 3 +++
 Common/ConnectionManager.h   | 7 ++++---
 Common/GmshSocket.h          | 1 +
 Mesh/meshPartitionObjects.h  | 4 ++--
 Solver/eigenSolver.h         | 2 +-
 6 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f2346500de..4aa9f46a72 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,9 +39,9 @@ option(ENABLE_OCC "Enable OpenCASCADE geometrical models" ON)
 option(ENABLE_OSMESA "Use OSMesa for offscreen rendering" OFF)
 option(ENABLE_PARSER "Build the GEO file parser" ON)
 option(ENABLE_PETSC "Enable PETSc linear algebra solvers" ON)
-option(ENABLE_SLEPC "Enable SLEPc eigensolvers" ON)
 option(ENABLE_POST "Build the post-processing module" ON)
 option(ENABLE_QT "Build QT GUI" OFF)
+option(ENABLE_SLEPC "Enable SLEPc eigensolvers" ON)
 option(ENABLE_TAUCS "Enable Taucs linear algebra solver" ON)
 option(ENABLE_TETGEN "Enable Tetgen mesh generator" ON)
 option(ENABLE_TETGEN_NEW "Enable experimental version of Tetgen" OFF)
diff --git a/Common/ConnectionManager.cpp b/Common/ConnectionManager.cpp
index a66d7d4594..2af24e7bfc 100644
--- a/Common/ConnectionManager.cpp
+++ b/Common/ConnectionManager.cpp
@@ -25,6 +25,9 @@ ConnectionManager::ConnectionManager()
 
 std::string ConnectionManager::getSocketName()
 {
+  // FIXME: this should be changed to incorporate info about the
+  // connection number (i.e. the integer in the _all map) so that we
+  // can have several connections active at the same time
   std::string sockname;
   if(!strstr(CTX::instance()->solver.socketName.c_str(), ":")){
     // Unix socket
diff --git a/Common/ConnectionManager.h b/Common/ConnectionManager.h
index 0eded54417..801cdeb16f 100644
--- a/Common/ConnectionManager.h
+++ b/Common/ConnectionManager.h
@@ -67,9 +67,10 @@ class ConnectionManager {
   // a pointer to the server when the remote program is running, or 0
   // when stopped
   GmshServer *_server;
-  // a static map of all available remote programs: ints 0, 1, ... 4
-  // are reserved for the main solver menu; int -1 is used when
-  // permanently listening for incoming connections
+  // a static map of all available remote programs: values 0, 1, 2, 3,
+  // 4 are reserved for the main solver menu; -1 is used when
+  // permanently listening for incoming connections; 99 is used for
+  // remote Gmsh
   static std::map<int, ConnectionManager*> _all;
  public:
   ConnectionManager();
diff --git a/Common/GmshSocket.h b/Common/GmshSocket.h
index 7743db7b03..f513a56758 100644
--- a/Common/GmshSocket.h
+++ b/Common/GmshSocket.h
@@ -204,6 +204,7 @@ class GmshSocket{
     }
     return 0;
   }
+  // str should be allocated with size (len+1)
   int ReceiveString(int len, char *str)
   {
     if(_ReceiveData(str, len) == len) {
diff --git a/Mesh/meshPartitionObjects.h b/Mesh/meshPartitionObjects.h
index c0a934c9f0..7a3cc4a0ea 100644
--- a/Mesh/meshPartitionObjects.h
+++ b/Mesh/meshPartitionObjects.h
@@ -141,7 +141,7 @@ class Graph
   {
     const int i = numGrVert++;
     xadj[i] = adjncy.size();
-    vwgts[i-1]=(int)(1.0);
+    vwgts[i-1] = 1;
     grVertMapIt->second.write(adjncy);
     element[i] = grVertMapIt->first;
     // Translated vertex numbers start from 1
@@ -151,7 +151,7 @@ class Graph
   {
     int num = 0;
     for(std::vector<int>::iterator it = wgts.begin(); it != wgts.end(); it++){
-      vwgts[num]= 1.0; //*it;
+      vwgts[num]= 1; //*it;
        num++;
     }
   }
diff --git a/Solver/eigenSolver.h b/Solver/eigenSolver.h
index 3fffcaf6f4..0ca589d14e 100644
--- a/Solver/eigenSolver.h
+++ b/Solver/eigenSolver.h
@@ -44,7 +44,7 @@ class eigenSolver{
   {
     Msg::Error("Eigen solver requires SLEPc");
   }
-  int getNumEigenValues(){ return 0.; }
+  int getNumEigenValues(){ return 0; }
   std::complex<double> getEigenValue(int num){ return 0.; }
   std::vector<std::complex<double> > &getEigenVector(int num){ return _dummy; }
 };
-- 
GitLab