From 31ca7349de0c65ccb13625c03d24798a2d3d8741 Mon Sep 17 00:00:00 2001
From: Thomas Moulard <thomas.moulard@gmail.com>
Date: Sat, 1 Jan 2011 02:41:01 +0100
Subject: [PATCH] Remove warnings found by Clang.

---
 include/dynamic-graph/import.h     | 21 ---------------------
 include/dynamic-graph/signal.t.cpp |  6 +++---
 src/dgraph/import.cpp              | 17 +++++++++++++++++
 src/shell/functions.cpp            | 13 +++++++++----
 4 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/include/dynamic-graph/import.h b/include/dynamic-graph/import.h
index a194be7..56265c1 100644
--- a/include/dynamic-graph/import.h
+++ b/include/dynamic-graph/import.h
@@ -36,27 +36,6 @@ namespace dynamicgraph
       /// Used to store paths where the import statement
       /// will look for scripts or plug-ins.
       typedef std::vector<boost::filesystem::path> paths_t;
-
-      /// \brief Import paths list.
-      ///
-      /// This vector of string is similar to Unix variables such as
-      /// PATH. It contains all paths that are used to search when
-      /// importing a script.
-      ///
-      /// The look-up is made from right to left:
-      ///
-      /// On Unix:
-      ///  importPaths = A:B:C
-      /// On Microsoft Windows:
-      ///  importPaths = A;B;C
-      ///
-      /// When typing "import foo", C will be searched first then B
-      /// and A. The search stops when the file is found.
-      extern paths_t importPaths;
-
-      /// \brief Already imported paths to avoid multiple inclusion.
-      extern paths_t alreadyImportedPaths;
-
     } // end of anonymous namespace.
 
     /// \brief Implement sot interpretor import command.
diff --git a/include/dynamic-graph/signal.t.cpp b/include/dynamic-graph/signal.t.cpp
index edda08a..1b9f067 100644
--- a/include/dynamic-graph/signal.t.cpp
+++ b/include/dynamic-graph/signal.t.cpp
@@ -214,7 +214,7 @@ namespace dynamicgraph
 		  signalTime = t;
 		  return setTcopy(*Treference);
 		}
-	      catch( MutexError le )
+	      catch(const MutexError&)
 		{ return accessCopy (); }
 	    }
 
@@ -242,7 +242,7 @@ namespace dynamicgraph
 		  copyInit = true;
 		  return switchTcopy ();
 		}
-	      catch( MutexError le )
+	      catch(const MutexError&)
 		{ return accessCopy (); }
 	    }
 	  break;
@@ -280,7 +280,7 @@ namespace dynamicgraph
 		setTcopy(t);
 		(*TreferenceNonConst)=t;
 	      }
-	    catch( MutexError le )
+	    catch(const MutexError&)
 	      { /* TODO ERROR */ }
 	  }
       }
diff --git a/src/dgraph/import.cpp b/src/dgraph/import.cpp
index f895abe..dab1c57 100644
--- a/src/dgraph/import.cpp
+++ b/src/dgraph/import.cpp
@@ -64,7 +64,24 @@ namespace dynamicgraph
       /// Initialize import paths list (called during static initialization).
       paths_t initializePaths ();
 
+      /// \brief Import paths list.
+      ///
+      /// This vector of string is similar to Unix variables such as
+      /// PATH. It contains all paths that are used to search when
+      /// importing a script.
+      ///
+      /// The look-up is made from right to left:
+      ///
+      /// On Unix:
+      ///  importPaths = A:B:C
+      /// On Microsoft Windows:
+      ///  importPaths = A;B;C
+      ///
+      /// When typing "import foo", C will be searched first then B
+      /// and A. The search stops when the file is found.
       paths_t importPaths = initializePaths ();
+
+      /// \brief Already imported paths to avoid multiple inclusion.
       paths_t alreadyImportedPaths;
 
       /// Search for a module.
diff --git a/src/shell/functions.cpp b/src/shell/functions.cpp
index 8e0b3e1..4bd20d2 100644
--- a/src/shell/functions.cpp
+++ b/src/shell/functions.cpp
@@ -22,6 +22,7 @@
 
 #include <boost/foreach.hpp>
 #include <boost/format.hpp>
+#include <boost/numeric/conversion/converter.hpp>
 
 #include <dynamic-graph/debug.h>
 #include <dynamic-graph/entity.h>
@@ -345,7 +346,7 @@ ShellFunctions::cmdCopy (const std::string cmdLine,
       sig2.setConstantDefault ();
       sig2.plug (&sig2);
     }
-  catch (ExceptionAbstract& err)
+  catch (const ExceptionAbstract&)
     {
       throw;
     }
@@ -539,8 +540,12 @@ ShellFunctions::cmdSleep (const std::string cmdLine,
 
   double secs = 0.;
   cmdArg >> secs;
-  if (secs > 0)
-    sleep (int (secs));
+
+  typedef boost::numeric::converter<int, double> Double2Int;
+  int secs_ = Double2Int::convert (secs);
+
+  if (secs_ > 0)
+    sleep (secs_);
 }
 
 void
@@ -578,7 +583,7 @@ ShellFunctions::cmdCompletionList (const std::string cmdLine,
       std::ofstream completionFile (aFileName.c_str ());
       g_pool.writeCompletionList (completionFile);
     }
-  catch (const ExceptionAbstract & err)
+  catch (const ExceptionAbstract &)
     {
       throw;
     }
-- 
GitLab