Commit 4290e3d6 authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch '22.0-cppcheck-InDetEventAthenaPool' into 'master'

22.0-cppcheck-InDetEventAthenaPool

See merge request !45377
parents bb15f386 f86082ed
......@@ -49,7 +49,7 @@ void Pixel1RawDataContainerCnv_p1::transToPers(const PixelRDO_Container* transCo
persCont->m_collections.resize(numColl);
MSG_DEBUG(log," Preparing " << persCont->m_collections.size() << "Collections");
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++) {
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
// Add in new collection
const PixelRDO_Collection& collection = (**it_Coll);
chanBegin = chanEnd;
......
......@@ -49,7 +49,7 @@ void Pixel1RawDataContainerCnv_p2::transToPers(const PixelRDO_Container* transCo
persCont->m_collections.resize(numColl);
MSG_DEBUG(log, " Preparing " << persCont->m_collections.size() << " Collections" );
for (unsigned int collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++) {
for (unsigned int collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
// Add in new collection
const PixelRDO_Collection& collection = (**it_Coll);
chanBegin = chanEnd;
......
......@@ -73,7 +73,7 @@ InDet::PixelClusterContainer* PixelClusterContainerCnv_p0::createTransient(Pixel
(*itColl)->m_detEl = de;
}
StatusCode sc= trans->addCollection(dcColl, collHash);
StatusCode sc= trans? trans->addCollection(dcColl, collHash): StatusCode::FAILURE;
if (sc.isSuccess()){
MSG_VERBOSE(log,"PixelClusterContainer successfully added to Container !");
} else {
......
......@@ -92,7 +92,7 @@ PixelRDO_Container_PERS* PixelRDO_ContainerCnv::createPersistent(PixelRDO_Contai
PixelRDO_Container::const_iterator it_CollEnd = transCont->end();
// check one element of the container. The container can't be empty for this...
if(it_Coll != it_CollEnd) {
while (it_Coll != it_CollEnd && (*it_Coll)->size() == 0 ) it_Coll++;
while (it_Coll != it_CollEnd && (*it_Coll)->size() == 0 ) ++it_Coll;
if(it_Coll != it_CollEnd) {
const PixelRDORawData *test((**it_Coll)[0]);
if(dynamic_cast<const Pixel1RawData*>(test) != 0 ) {
......
......@@ -44,7 +44,7 @@ void SCT1_RawDataContainerCnv_p1::transToPers(const SCT_RDO_Container* transCont
persCont->m_collections.resize(transCont->numberOfCollections());
MSG_DEBUG(log," Preparing " << persCont->m_collections.size() << "Collections");
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++) {
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
// Add in new collection
const SCT_RDO_Collection& collection = (**it_Coll);
chanBegin = chanEnd;
......
......@@ -72,7 +72,7 @@ InDet::SCT_ClusterContainer* SCT_ClusterContainerCnv_p0::createTransient(SCT_Clu
(*itColl)->m_detEl = de;
}
StatusCode sc= trans->addCollection(dcColl, collHash);
StatusCode sc= trans ? trans->addCollection(dcColl, collHash): StatusCode::FAILURE;
if (sc.isSuccess()){
// MSG_VERBOSE("SCT_ClusterContainer successfully added to Container !");
} else {
......
......@@ -106,7 +106,7 @@ SCT_RDO_Container_PERS* SCT_RDO_ContainerCnv::createPersistent(SCT_RDO_Container
SCT_RDO_Container::const_iterator it_CollEnd = transCont->end();
// check one element of the container. The container can't be empty for this...
if (it_Coll != it_CollEnd) {
while (it_Coll != it_CollEnd && (*it_Coll)->size() == 0) it_Coll++;
while (it_Coll != it_CollEnd && (*it_Coll)->size() == 0) ++it_Coll;
if (it_Coll != it_CollEnd) {
const SCT_RDORawData* test((**it_Coll)[0]);
if (dynamic_cast<const SCT1_RawData*>(test) != nullptr) {
......
......@@ -48,7 +48,7 @@ void SCT_RawDataContainerCnv_p1::transToPers(const SCT_RDO_Container* transCont,
int numColl = transCont->numberOfCollections();
persCont->m_collections.resize(numColl);
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++) {
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
// Add in new collection
const SCT_RDO_Collection& collection = (**it_Coll);
chanBegin = chanEnd;
......
......@@ -58,7 +58,7 @@ void SCT_RawDataContainerCnv_p2::transToPers(const SCT_RDO_Container* transCont,
(persCont->m_numErrorsInRDO).clear();
(persCont->m_allErrorsInContainer).clear();
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++) {
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
/** Add in new collection */
const SCT_RDO_Collection& collection = (**it_Coll);
chanBegin = chanEnd;
......
......@@ -58,7 +58,7 @@ void SCT_RawDataContainerCnv_p3::transToPers(const SCT_RDO_Container* transCont,
(persCont->m_numErrorsInRDO).clear();
(persCont->m_allErrorsInContainer).clear();
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++) {
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
/** Add in new collection */
const SCT_RDO_Collection& collection = (**it_Coll);
chanBegin = chanEnd;
......
......@@ -56,7 +56,7 @@ void SCT_RawDataContainerCnv_p4::transToPers(const SCT_RDO_Container* transCont,
/** we're going to store all the strip errors from each RDO
* in vectors in the collection */
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++) {
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
/** Add in new collection */
const SCT_RDO_Collection& collection = (**it_Coll);
chanBegin = chanEnd;
......
......@@ -63,11 +63,11 @@ InDet::TRT_DriftCircleContainer* TRT_DriftCircleContainerCnv_p0::createTransient
InDet::TRT_DriftCircleCollection::iterator itColl = dcColl->begin();
InDet::TRT_DriftCircleCollection::iterator lastColl = dcColl->end();
for (int num = 0; itColl != lastColl; ++itColl, ++num) {
MSG_DEBUG(log,"PRD " << num);
MSG_DEBUG(log,"PRD " << num);
(*itColl)->m_detEl = de;
}
StatusCode sc= trans->addCollection(dcColl, collHash);
StatusCode sc= trans ? trans->addCollection(dcColl, collHash): StatusCode::FAILURE;
if (sc.isSuccess()){
MSG_VERBOSE(log,"TRT_DriftCircleContainer successfully added to Container !");
} else {
......
......@@ -49,7 +49,7 @@ void TRT_LoLumRawDataContainerCnv_p1::transToPers(const TRT_RDO_Container* trans
persCont->m_collections.resize(numColl);
MSG_DEBUG(log," Preparing " << persCont->m_collections.size() << "Collections");
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++) {
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
// Add in new collection
const TRT_RDO_Collection& collection = (**it_Coll);
chanBegin = chanEnd;
......
......@@ -49,7 +49,7 @@ void TRT_LoLumRawDataContainerCnv_p2::transToPers(const TRT_RDO_Container* trans
persCont->m_collections.resize(numColl);
MSG_DEBUG(log," Preparing " << persCont->m_collections.size() << "Collections");
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++) {
for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
// Add in new collection
const TRT_RDO_Collection& collection = (**it_Coll);
chanBegin = chanEnd;
......
......@@ -45,7 +45,7 @@ void TRT_LoLumRawDataContainerCnv_p3::transToPers(const TRT_RDO_Container* trans
persCont->m_rawdata.resize(trt_number_of_channels);
// Loop over all existing transient collections, add missing collections and missing channels
for (; it_transColl != it_transCollEnd; it_transColl++) {
for (; it_transColl != it_transCollEnd; ++it_transColl) {
const TRT_RDO_Collection& collection = (**it_transColl);
tcoll_id = collection.identify().get_identifier32().get_compact();
......@@ -92,7 +92,7 @@ void TRT_LoLumRawDataContainerCnv_p3::transToPers(const TRT_RDO_Container* trans
while ( trt_channel_id != tchan_id) {
persCont->m_rawdata[trt_channel_index] = dummy_digit;
trt_channel_id += trt_channel_id_increment;
trt_channel_index++;
++trt_channel_index;
}
// Here we have a matching transient channel; write it.
......
......@@ -92,7 +92,7 @@ TRT_RDO_Container_PERS* TRT_RDO_ContainerCnv::createPersistent(TRT_RDO_Container
TRT_RDO_Container::const_iterator it_CollEnd = transCont->end();
// check one element of the container. The container can't be empty for this...
if(it_Coll != it_CollEnd) {
while (it_Coll != it_CollEnd && (*it_Coll)->size() == 0 ) it_Coll++;
while (it_Coll != it_CollEnd && (*it_Coll)->size() == 0 ) ++it_Coll;
if(it_Coll != it_CollEnd) {
const TRT_RDORawData *test((**it_Coll)[0]);
if(dynamic_cast<const TRT_LoLumRawData*>(test) != 0 ) {
......
......@@ -44,7 +44,7 @@ namespace {
std::ostringstream os;
os<<"TRT_RDO_colvector = ["<<rdoV.size()<<"] ";
unsigned count = 0;
for(TRT_RDO_colvector::const_iterator it = rdoV.begin(); it != rdoV.end(); it++) {
for(TRT_RDO_colvector::const_iterator it = rdoV.begin(); it != rdoV.end(); ++it) {
if(++count>maxprint) break;
if(*it) {
os<<(*it)->size()<<" ";
......@@ -67,7 +67,7 @@ void TRT_RDO_ContainerCnv_p1::transToPers(const TRT_RDO_Container* trans, TRT_RD
// retrieving directly from SG.
if(trans->begin() != trans->end()) {
MSG_DEBUG(log,"[p1] using container iterators");
for(TRT_RDO_Container::const_iterator it=trans->begin(); it != trans->end(); it++) {
for(TRT_RDO_Container::const_iterator it=trans->begin(); it != trans->end(); ++it) {
if(*it) {
pers->push_back( *it );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment