diff --git a/include/dynamic-graph/import.h b/include/dynamic-graph/import.h index a194be76152406880e77627e42214d85f43e908d..56265c16030e86743ec8f97c3904ba9f8527ad0e 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 edda08a7bb6829a9ab6e3664bbb9ebb7228346ac..1b9f067d7aaaa50aa26351c71fbbd54c0c5ad432 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 f895abe2f3c84dee48a3bc480cf33e9204201502..dab1c57297473656e216e5b6cef0a2b9810e15d2 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 8e0b3e1fc1c9cc3291d6033214c8bec6cb2448bb..4bd20d21879b3d745293d9b2f0b5f996bc98fc21 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; }