From 7b5239920bdb7ff858dd88f52cc3d5902499f27f Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Wed, 19 May 2021 15:29:27 +0200 Subject: [PATCH] Fix missing returns. --- src/bases/DynLibLoaderGNU.cxx | 1 + src/engine/Pool.cxx | 3 +-- src/engine/Switch.cxx | 8 +++++--- src/hmi/commandsProc.cxx | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/bases/DynLibLoaderGNU.cxx b/src/bases/DynLibLoaderGNU.cxx index ebbb1acf8..9d46d507d 100644 --- a/src/bases/DynLibLoaderGNU.cxx +++ b/src/bases/DynLibLoaderGNU.cxx @@ -110,6 +110,7 @@ bool DynLibLoaderGNU::unload() dlclose(_handleOnLoadedLib); _handleOnLoadedLib = NULL; } + return false; } bool DynLibLoaderGNU::reload() diff --git a/src/engine/Pool.cxx b/src/engine/Pool.cxx index ccb92b694..53d1465ac 100644 --- a/src/engine/Pool.cxx +++ b/src/engine/Pool.cxx @@ -107,8 +107,7 @@ Any *Pool::getOutSample(int id) for(iter=_container.begin();iter!=_container.end();iter++) if((*iter).first==id) return (*iter).second.outValue(); - if(iter==_container.end()) - throw YACS::Exception("no current case set in pool"); + throw YACS::Exception("no current case set in pool"); } diff --git a/src/engine/Switch.cxx b/src/engine/Switch.cxx index f1b95ea1b..71b63f06c 100644 --- a/src/engine/Switch.cxx +++ b/src/engine/Switch.cxx @@ -82,15 +82,16 @@ void CollectorSwOutPort::getAllRepresented(std::set& represented) con bool CollectorSwOutPort::addInPort(InPort *inPort) { + bool ret = false; if(_currentProducer) {//a specific link is beeing done - bool ret=_currentProducer->addInPort(inPort); + ret=_currentProducer->addInPort(inPort); _currentProducer=0; - return ret; } else//global links asked for(map::iterator iter=_potentialProducers.begin();iter!=_potentialProducers.end();iter++) - (*iter).second->addInPort(inPort); + ret |= (*iter).second->addInPort(inPort); + return ret; } int CollectorSwOutPort::removeInPort(InPort *inPort, bool forward) @@ -559,6 +560,7 @@ Node *Switch::edSetNode(int caseId, Node *node) return ret; } } + return 0; } //! Change the case of a node diff --git a/src/hmi/commandsProc.cxx b/src/hmi/commandsProc.cxx index d0394bb22..0833fca17 100644 --- a/src/hmi/commandsProc.cxx +++ b/src/hmi/commandsProc.cxx @@ -2470,6 +2470,7 @@ bool CommandSetSwitchSelect::localExecute() setErrorMsg(ex); return false; } + return true; } bool CommandSetSwitchSelect::localReverse() @@ -2492,6 +2493,7 @@ bool CommandSetSwitchSelect::localReverse() setErrorMsg(ex); return false; } + return true; } // ---------------------------------------------------------------------------- -- 2.30.2