Skip to content
Snippets Groups Projects
Commit eba38a9c authored by Thomas Moulard's avatar Thomas Moulard
Browse files

Fix pedantic, -Wextra warnings.

parent 9f3e22e4
No related branches found
No related tags found
No related merge requests found
......@@ -97,8 +97,8 @@ class DYNAMICGRAPH_EXPORT DebugTrace
inline void traceTemplate( const char* format,...)
{ DG_COMMON_TRACES; tmpbuffer.str(""); }
inline DebugTrace& pre( const std::ostream& dummy ) { return *this; }
inline DebugTrace& pre( const std::ostream& dummy,int level )
inline DebugTrace& pre( const std::ostream&) { return *this; }
inline DebugTrace& pre( const std::ostream&, int level)
{ traceLevel = level; return *this; }
/* inline DebugTrace& preTemplate( const std::ostream& dummy,int level ) */
/* { traceLevelTemplate = level; return *this; } */
......@@ -142,14 +142,14 @@ inline bool dgTDEBUG_ENABLE( const int & level ) { return level<=VP_TEMPLATE_DEB
# define dgDEBUG(level) if( 1 ) ; else std::cout
# define dgDEBUGMUTE(level) if( 1 ) ; else std::cout
# define dgERROR dgERRORFLOW.outputbuffer << dgPREERROR
inline void dgDEBUGF( const int level,const char* format,...) { return; }
inline void dgDEBUGF( const char* format,...) { return; }
inline void dgERRORF( const int level,const char* format,...) { return; }
inline void dgERRORF( const char* format,...) { return; }
inline void dgDEBUGF( const int, const char*,...) { return; }
inline void dgDEBUGF( const char*, ...) { return; }
inline void dgERRORF( const int, const char*,...) { return; }
inline void dgERRORF( const char*, ...) { return; }
// TEMPLATE
# define dgTDEBUG(level) if( 1 ) ; else std::cout
inline void dgTDEBUGF( const int level,const char* format,...) { return; }
inline void dgTDEBUGF( const char* format,...) { return; }
inline void dgTDEBUGF( const int, const char*,...) { return; }
inline void dgTDEBUGF( const char*,...) { return; }
#define dgDEBUG_ENABLE(level) false
#define dgTDEBUG_ENABLE(level) false
......
......@@ -94,7 +94,7 @@ class DYNAMICGRAPH_EXPORT Entity
std::ostream& os );
virtual SignalBase<int>* test(void) { return 0; }
virtual void test2( SignalBase<int>* ptr ) { return ; }
virtual void test2( SignalBase<int>* ) { return ; }
virtual const std::string& getCommandList( void ) const;
};
......
......@@ -109,16 +109,17 @@ class DYNAMICGRAPH_EXPORT EntityRegisterer
* of classType to the g_factory. It is then possible to create it
* with the g_factory.
*/
#define DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(classType,className) \
const std::string classType::CLASS_NAME = className; \
extern "C" { \
Entity *EntityMaker##_##classType( const std::string& objname ) \
{ \
return new classType( objname ); \
} \
EntityRegisterer reg##_##classType( className, \
&EntityMaker##_##classType ); \
} \
#define DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(classType,className) \
const std::string classType::CLASS_NAME = className; \
extern "C" { \
Entity *EntityMaker##_##classType( const std::string& objname ) \
{ \
return new classType( objname ); \
} \
EntityRegisterer reg##_##classType( className, \
&EntityMaker##_##classType ); \
} \
struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
} // namespace dynamicgraph
......
......@@ -51,7 +51,7 @@ class SignalBase : public boost::noncopyable
const bool& getReady( void ) const { return ready; }
const std::string& getName( void ) const { return name; }
virtual void setPeriodTime( const Time& p ) {}
virtual void setPeriodTime( const Time& ) {}
virtual Time getPeriodTime( void ) const { return 1; }
public:
......@@ -65,11 +65,11 @@ class SignalBase : public boost::noncopyable
/* --- DEPENDENCIES ------------------------------------------------------- */
virtual void addDependency( const SignalBase<Time>& signal ) {}
virtual void removeDependency( const SignalBase<Time>& signal ) {}
virtual void addDependency( const SignalBase<Time>& ) {}
virtual void removeDependency( const SignalBase<Time>& ) {}
virtual void clearDependencies( void ) {}
virtual bool needUpdate( const Time& t ) const {return ready;}
virtual bool needUpdate( const Time& ) const {return ready;}
inline void setReady( const bool sready = true ) { ready = sready; }
virtual std::ostream &
......@@ -79,9 +79,9 @@ class SignalBase : public boost::noncopyable
}
virtual std::ostream&
displayDependencies( std::ostream& os,const int depth=-1,
displayDependencies( std::ostream& os,const int=-1,
std::string space="",
std::string next1="",std::string next2="" ) const
std::string next1="",std::string ="" ) const
{
os << space << next1 << "-- ";
display(os); return os;
......@@ -115,22 +115,22 @@ class SignalBase : public boost::noncopyable
/* Generic set function. Should be reimplemented by the specific Signal.
* Sets a signal value
*/
virtual void set( std::istringstream& value )
virtual void set( std::istringstream&)
{ DG_THROW ExceptionSignal( ExceptionSignal::SET_IMPOSSIBLE,
"Set operation not possible with this signal. ",
"(while trying to set %s).",this->getName().c_str() );
}
virtual void get( std::ostream& os ) const
virtual void get(std::ostream&) const
{ DG_THROW ExceptionSignal( ExceptionSignal::SET_IMPOSSIBLE,
"Get operation not possible with this signal. ",
"(while trying to get %s).",this->getName().c_str() );
}
virtual inline void recompute( const Time & t)
virtual inline void recompute( const Time &)
{ DG_THROW ExceptionSignal( ExceptionSignal::SET_IMPOSSIBLE,
"Recompute operation not possible with this signal. ",
"(while trying to recompute %s).",this->getName().c_str() );
}
virtual void trace( std::ostream& os ) const
virtual void trace( std::ostream& ) const
{ DG_THROW ExceptionSignal( ExceptionSignal::SET_IMPOSSIBLE,
"Trace operation not possible with this signal. ",
"(while trying to trace %s).",this->getName().c_str() );
......
......@@ -87,7 +87,7 @@ namespace dynamicgraph {
template< class T,class Time >
Signal<T,Time>::
Signal( std::string name )
:__SIGNAL_INIT(name,,NULL,NULL,NULL)
:__SIGNAL_INIT(name,T(),NULL,NULL,NULL)
{
return;
}
......
......@@ -63,7 +63,7 @@ void DebugTrace::openFile( const char * filename )
//std::cout << filename << dg_debugfile.good() << dg_debugfile.is_open() << std::endl;
}
void DebugTrace::closeFile( const char * filename )
void DebugTrace::closeFile(const char *)
{
if( dg_debugfile.good()&&dg_debugfile.is_open() ) { dg_debugfile.close(); }
dg_debugfile.setstate( std::ios::failbit ) ;
......
......@@ -238,7 +238,7 @@ namespace dynamicgraph
dgDEBUGOUT(15);
}
void pushImportPaths (dynamicgraph::Interpreter& interpreter,
void pushImportPaths (dynamicgraph::Interpreter&,
const std::string& cmdLine,
std::istringstream& cmdArg,
std::ostream& os)
......@@ -256,9 +256,9 @@ namespace dynamicgraph
importPaths.push_back (path);
}
void popImportPaths (dynamicgraph::Interpreter& interpreter,
void popImportPaths (dynamicgraph::Interpreter&,
const std::string& cmdLine,
std::istringstream& cmdArg,
std::istringstream&,
std::ostream& os)
{
if (cmdLine == "help")
......
......@@ -52,7 +52,7 @@ using namespace std;
void InterpreterHelper::
cmdPlug( const std::string& obj1, const std::string & signame1,
const std::string& obj2, const std::string & signame2,
std::ostream& os )
std::ostream& )
{
dgDEBUG(20) << "Get Ent1 <"<<obj1<<"> ."<<endl;
Entity& ent1 = g_pool.getEntity(obj1);
......@@ -85,7 +85,7 @@ cmdNew( const std::string& className,
void InterpreterHelper::
cmdDestroy( const std::string& objName,
std::ostream& os)
std::ostream& )
{
dgDEBUG(15) << "Destroy <" << objName <<"> requested."<<endl;
......@@ -96,7 +96,7 @@ cmdDestroy( const std::string& objName,
void InterpreterHelper::
cmdLoadPlugin( const std::string& directory,
const std::string& pluginName,
std::ostream& os )
std::ostream& )
{
if( directory.length() != 0 ) dlPtr.setDirectory( directory );
......@@ -110,7 +110,7 @@ cmdLoadPlugin( const std::string& directory,
void InterpreterHelper::
cmdUnloadPlugin( const std::string& pluginName,
std::ostream& os )
std::ostream& )
{
dgDEBUGIN(15);
......@@ -133,7 +133,7 @@ void InterpreterHelper::
cmdSetSignal( const std::string& objname,
const std::string& signame,
const std::string& value,
std::ostream& os )
std::ostream& )
{
dgDEBUGIN(15);
......@@ -167,7 +167,7 @@ void InterpreterHelper::
cmdComputeSignal( const std::string& objname,
const std::string& signame,
const int &time,
std::ostream& os )
std::ostream& )
{
dgDEBUGIN(15);
......
......@@ -81,7 +81,7 @@ cmdContinueProcedure( const std::string& cmdLine,std::istringstream& args,std::o
}
void ShellProcedure::
cmdEndProcedure( const std::string& cmdLine,std::istringstream& args,std::ostream& os )
cmdEndProcedure( const std::string& cmdLine,std::istringstream&, std::ostream& os )
{
if( cmdLine == "help" )
{
......
......@@ -92,7 +92,7 @@ cmdClearPlugin( const std::string cmdLine, std::istringstream& cmdArg, std::ostr
}
void ShellFunctions::
cmdDisplayPlugins( const std::string cmdLine, std::istringstream& cmdArg, std::ostream& os )
cmdDisplayPlugins( const std::string cmdLine, std::istringstream&, std::ostream& os )
{
if( cmdLine == "help" )
{
......@@ -132,7 +132,7 @@ cmdDisplayFactory( const std::string cmdLine, std::istringstream& cmdArg,
}
void ShellFunctions::
cmdCommentary( const std::string cmdLine, std::istringstream& cmdArg, std::ostream& os )
cmdCommentary( const std::string cmdLine, std::istringstream&, std::ostream& os )
{
if( cmdLine == "help" )
{ os << " # comment with '#': ignore the end of the line." <<endl; }
......@@ -439,7 +439,7 @@ cmdSleep( const std::string cmdLine, istringstream& cmdArg, std::ostream& os )
}
void ShellFunctions::
cmdBeep( const std::string cmdLine, istringstream& cmdArg, std::ostream& os )
cmdBeep( const std::string cmdLine, std::istringstream&, std::ostream& os )
{
if( cmdLine == "help" )
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment