diff --git a/eo/src/eoEasyPSO.h b/eo/src/eoEasyPSO.h index 87c27cad3..25f030595 100644 --- a/eo/src/eoEasyPSO.h +++ b/eo/src/eoEasyPSO.h @@ -174,18 +174,18 @@ protected: // if the flight does not need to be used, use the dummy flight instance class eoDummyFlight:public eoFlight < POT > { - public: - eoDummyFlight () {} - void operator () (POT &) {} - }dummyFlight; + public: + eoDummyFlight () {} + void operator() (POT &) override {} + } dummyFlight; // if the initializer does not need to be used, use the dummy one instead class eoDummyInitializer:public eoInitializerBase < POT > { - public: - eoDummyInitializer () {} - void operator () (POT &) {} - }dummyInit; + public: + eoDummyInitializer () {} + void operator() () override {} + } dummyInit; }; /** diff --git a/eo/src/eoSyncEasyPSO.h b/eo/src/eoSyncEasyPSO.h index 11640af53..183148896 100644 --- a/eo/src/eoSyncEasyPSO.h +++ b/eo/src/eoSyncEasyPSO.h @@ -230,27 +230,25 @@ protected: // if the eval does not need to be used, use the dummy eval instance class eoDummyEval : public eoEvalFunc - { - public: - void operator()(POT &) - {} - } - dummyEval; - - class eoDummyFlight:public eoFlight < POT > { - public: - eoDummyFlight () {} - void operator () (POT &) {} - }dummyFlight; + public: + void operator()(POT &) override {} + } dummyEval; + + class eoDummyFlight:public eoFlight < POT > + { + public: + eoDummyFlight () {} + void operator() (POT &) override {} + } dummyFlight; // if the initializer does not need to be used, use the dummy one instead class eoDummyInitializer:public eoInitializerBase < POT > { - public: - eoDummyInitializer () {} - void operator () (POT &) {} - }dummyInit; + public: + eoDummyInitializer () {} + void operator() () override {} + } dummyInit; }; /** @example t-eoSyncEasyPSO.cpp diff --git a/eo/src/es/CMAParams.cpp b/eo/src/es/CMAParams.cpp index 2862cdd1a..d27204f97 100644 --- a/eo/src/es/CMAParams.cpp +++ b/eo/src/es/CMAParams.cpp @@ -113,16 +113,19 @@ CMAParams::CMAParams(eoParser& parser, unsigned dimensionality) { for (unsigned i = 0; i < weights.size(); ++i) { weights[i] = mu - i; } + break; } case 2: { weights = 1.; + break; } default : { for (unsigned i = 0; i < weights.size(); ++i) { weights[i] = log(mu+1.)-log(i+1.); } + break; } } diff --git a/eo/src/gp/parse_tree.h b/eo/src/gp/parse_tree.h index 84ec04d35..6b9ab80ae 100644 --- a/eo/src/gp/parse_tree.h +++ b/eo/src/gp/parse_tree.h @@ -468,8 +468,11 @@ private : switch(new_arity) { case 3 : args[2].copy(s.args[2]); args[2].parent = this; // no break! + [[fallthrough]]; case 2 : args[1].copy(s.args[1]); args[1].parent = this; + [[fallthrough]]; case 1 : args[0].copy(s.args[0]); args[0].parent = this; + [[fallthrough]]; case 0 : break; default : { @@ -523,7 +526,9 @@ private : switch(arity()) { case 3 : args[2].parent = 0; // no break! + [[fallthrough]]; case 2 : args[1].parent = 0; + [[fallthrough]]; case 1 : args[0].parent = 0; break; case 0 : break; default : @@ -542,7 +547,9 @@ private : switch(arity()) { case 3 : args[2].parent = this; // no break! + [[fallthrough]]; case 2 : args[1].parent = this; + [[fallthrough]]; case 1 : args[0].parent = this; break; case 0 : break; default : diff --git a/eo/src/mpi/implMpi.cpp b/eo/src/mpi/implMpi.cpp index 2dd1ca0d5..d045da3ac 100644 --- a/eo/src/mpi/implMpi.cpp +++ b/eo/src/mpi/implMpi.cpp @@ -161,7 +161,7 @@ namespace mpi MPI_Barrier( MPI_COMM_WORLD ); } - void broadcast( communicator & comm, int value, int root ) + void broadcast( communicator & /*comm*/, int value, int root ) { MPI_Bcast( &value, 1, MPI_INT, root, MPI_COMM_WORLD ); } diff --git a/eo/src/utils/pipecom.cpp b/eo/src/utils/pipecom.cpp index a175112f9..bef9ae2ce 100644 --- a/eo/src/utils/pipecom.cpp +++ b/eo/src/utils/pipecom.cpp @@ -42,16 +42,16 @@ int Check( PCom *com ) } -PCom * PipeComOpen( char *prog ) +PCom * PipeComOpen( const char *prog ) { char *args[2]; - args[0] = prog; + args[0] = strdup( prog ); args[1] = NULL; return PipeComOpenArgv( prog, args ); } -PCom * PipeComOpenArgv( char *prog, char *argv[] ) +PCom * PipeComOpenArgv( const char *prog, char *argv[] ) { int toFils[2]; int toPere[2]; diff --git a/eo/src/utils/pipecom.h b/eo/src/utils/pipecom.h index 56b031708..16685225c 100644 --- a/eo/src/utils/pipecom.h +++ b/eo/src/utils/pipecom.h @@ -23,8 +23,8 @@ typedef struct PipeCommunication { } PCom; -extern PCom *PipeComOpen( char *prog ); -extern PCom *PipeComOpenArgv( char *prog, char *argv[] ); +extern PCom *PipeComOpen( const char *prog ); +extern PCom *PipeComOpenArgv( const char *prog, char *argv[] ); extern int PipeComSend( PCom *to, const char *line ); extern int PipeComSendn( PCom *to, const char *data, int n ); diff --git a/moeo/src/do/make_checkpoint_moeo.h b/moeo/src/do/make_checkpoint_moeo.h index 188c340ea..98bb1e2a1 100644 --- a/moeo/src/do/make_checkpoint_moeo.h +++ b/moeo/src/do/make_checkpoint_moeo.h @@ -66,7 +66,7 @@ bool testDirRes(std::string _dirName, bool _erase); * @param _archive the archive of non-dominated solutions */ template < class MOEOT > -eoCheckPoint < MOEOT > & do_make_checkpoint_moeo (eoParser & _parser, eoState & _state, eoEvalFuncCounter < MOEOT > & _eval, eoContinue < MOEOT > & _continue, eoPop < MOEOT > & _pop, moeoArchive < MOEOT > & _archive) +eoCheckPoint < MOEOT > & do_make_checkpoint_moeo (eoParser & _parser, eoState & _state, eoEvalFuncCounter < MOEOT > & /*_eval*/, eoContinue < MOEOT > & _continue, eoPop < MOEOT > & _pop, moeoArchive < MOEOT > & _archive) { eoCheckPoint < MOEOT > & checkpoint = _state.storeFunctor(new eoCheckPoint < MOEOT > (_continue)); /* the objective vector type */ diff --git a/moeo/src/do/make_ea_moeo.h b/moeo/src/do/make_ea_moeo.h index aee4dcd0d..76559e198 100644 --- a/moeo/src/do/make_ea_moeo.h +++ b/moeo/src/do/make_ea_moeo.h @@ -85,7 +85,7 @@ * @param _archive the archive of non-dominated solutions */ template < class MOEOT > -moeoEA < MOEOT > & do_make_ea_moeo(eoParser & _parser, eoState & _state, eoEvalFunc < MOEOT > & _eval, eoContinue < MOEOT > & _continue, eoGenOp < MOEOT > & _op, moeoArchive < MOEOT > & _archive) +moeoEA < MOEOT > & do_make_ea_moeo(eoParser & _parser, eoState & _state, eoEvalFunc < MOEOT > & _eval, eoContinue < MOEOT > & _continue, eoGenOp < MOEOT > & _op, moeoArchive < MOEOT > & /*_archive*/) { /* the objective vector type */ diff --git a/moeo/src/metric/moeoHyperVolumeMetric.h b/moeo/src/metric/moeoHyperVolumeMetric.h index dc65ac4c9..ce1ee0c1c 100644 --- a/moeo/src/metric/moeoHyperVolumeMetric.h +++ b/moeo/src/metric/moeoHyperVolumeMetric.h @@ -55,7 +55,7 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d * @param _normalize allow to normalize data (default true) * @param _rho coefficient to determine the reference point. */ - moeoHyperVolumeMetric(bool _normalize=true, double _rho=1.1): normalize(_normalize), rho(_rho), ref_point(NULL){ + moeoHyperVolumeMetric(bool _normalize=true, double _rho=1.1): normalize(_normalize), rho(_rho) { bounds.resize(ObjectiveVector::Traits::nObjectives()); // initialize bounds in case someone does not want to use them for (unsigned int i=0; i } template - U& findValueImpl(T& t, Arg&... arg, std::true_type) + U& findValueImpl(T& t, Arg&... /*arg*/, std::true_type) { return t; } diff --git a/smp/src/island.cpp b/smp/src/island.cpp index 783d42d75..eb8fa85ca 100644 --- a/smp/src/island.cpp +++ b/smp/src/island.cpp @@ -59,6 +59,10 @@ paradiseo::smp::Island::Island(eoPop& _pop, IntPolicy _pop, _intPolicy, _migPolicy, args...) { } +template