From 664cc28693bb9381052b3a92dfbbfae92e5b5642 Mon Sep 17 00:00:00 2001 From: Markus Frank <markus.frank@cern.ch> Date: Thu, 6 Feb 2014 09:50:06 +0000 Subject: [PATCH] Another attempt to please coverity.... --- DDCore/src/Evaluator/Evaluator.cpp | 1 + DDCore/src/Volumes.cpp | 1 - DDCore/src/XML/XMLElements.cpp | 18 +++++++++++------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/DDCore/src/Evaluator/Evaluator.cpp b/DDCore/src/Evaluator/Evaluator.cpp index 2e174e56e..34fc22f0a 100644 --- a/DDCore/src/Evaluator/Evaluator.cpp +++ b/DDCore/src/Evaluator/Evaluator.cpp @@ -110,6 +110,7 @@ static int variable(const string & name, double & result, pchar exp_end = exp_begin + strlen(exp_begin) - 1; if (engine(exp_begin, exp_end, result, exp_end, dictionary) == EVAL::OK) return EVAL::OK; + return EVAL::ERROR_CALCULATION_ERROR; } default: return EVAL::ERROR_CALCULATION_ERROR; diff --git a/DDCore/src/Volumes.cpp b/DDCore/src/Volumes.cpp index 1d66c2dfa..41d06b169 100644 --- a/DDCore/src/Volumes.cpp +++ b/DDCore/src/Volumes.cpp @@ -61,7 +61,6 @@ namespace DD4hep { private: DD_TGeoNodeMatrix& operator=(const DD_TGeoNodeMatrix&) { return *this; } public: - TGeoExtension* m_extension; DD_TGeoNodeMatrix(const TGeoVolume* v, const TGeoMatrix* m) : TGeoNodeMatrix(v, m), DDExtension() { INCREMENT_COUNTER; diff --git a/DDCore/src/XML/XMLElements.cpp b/DDCore/src/XML/XMLElements.cpp index 7d1741a22..270bb3305 100644 --- a/DDCore/src/XML/XMLElements.cpp +++ b/DDCore/src/XML/XMLElements.cpp @@ -116,12 +116,16 @@ void DD4hep::XML::XmlString::release(char** p) { namespace { size_t node_count(XmlElement* e, const XmlChar* t) { size_t cnt = 0; - string tag = _toString(t); - xercesc::DOMElement* elt, *ee = e ? Xml(e).e : 0; - for(elt=ee->getFirstElementChild(); elt; elt=elt->getNextElementSibling()) { - if ( elt->getParentNode() == ee ) { - string child_tag = _toString(elt->getTagName()); - if ( child_tag == tag ) ++cnt; + if ( e ) { + string tag = _toString(t); + xercesc::DOMElement *ee = Xml(e).e; + if ( ee ) { + for(xercesc::DOMElement* elt=ee->getFirstElementChild(); elt; elt=elt->getNextElementSibling()) { + if ( elt->getParentNode() == ee ) { + string child_tag = _toString(elt->getTagName()); + if ( child_tag == tag ) ++cnt; + } + } } } return cnt; @@ -130,7 +134,7 @@ namespace { if ( e ) { size_t cnt = 0; string tag = _toString(t); - xercesc::DOMElement* ee = e ? Xml(e).e : 0; + xercesc::DOMElement* ee = Xml(e).e; if ( ee ) { for(xercesc::DOMElement* elt=ee->getFirstElementChild(); elt; elt=elt->getNextElementSibling()) { if ( elt->getParentNode() == ee ) { -- GitLab