Skip to content

Commit

Permalink
Refs #4473. cppcheck warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartcampbell committed Apr 27, 2012
1 parent 6056279 commit af5ea72
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
20 changes: 10 additions & 10 deletions Code/Mantid/Framework/Crystal/src/SCDCalibratePanels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ namespace Crystal
set< string >::iterator setIt = pnamesSv.begin();
int N = 0;

for( ;setIt != pnamesSv.end(); setIt++ )
for( ;setIt != pnamesSv.end(); ++setIt )
{
string name = (*setIt);
vector< V3D > posParams = component->getPositionParameter(name , false);
Expand Down Expand Up @@ -326,7 +326,7 @@ namespace Crystal

if( Grouping == "OnePanelPerGroup" )
{
for( set< string >::iterator it = AllBankNames.begin(); it != AllBankNames.end(); it++ )
for( set< string >::iterator it = AllBankNames.begin(); it != AllBankNames.end(); ++it )
{
string bankName = (*it);
vector< string > vbankName;
Expand All @@ -336,7 +336,7 @@ namespace Crystal

}else if( Grouping == "AllPanelsInOneGroup" )
{ vector< string > vbankName;
for( set< string >::iterator it = AllBankNames.begin(); it != AllBankNames.end(); it++ )
for( set< string >::iterator it = AllBankNames.begin(); it != AllBankNames.end(); ++it )
{
string bankName = (*it);

Expand Down Expand Up @@ -470,7 +470,7 @@ namespace Crystal
boost::shared_ptr<ParameterMap> pmap1( new ParameterMap());

for( vector< string >::iterator vit = AllBankNames.begin();
vit != AllBankNames.end(); vit++ )
vit != AllBankNames.end(); ++vit )
{
string bankName = (*vit);
updateBankParams( instrument->getComponentByName(bankName), pmap1, pmap0);
Expand Down Expand Up @@ -647,10 +647,10 @@ namespace Crystal

vector< string >banksVec;
vector<vector< string > >::iterator it;
for( it = Groups.begin(); it != Groups.end(); it++ )
for( it = Groups.begin(); it != Groups.end(); ++it )
{

for( vector< string >::iterator itt = (*it).begin(); itt!=(*it).end(); itt++ )
for( vector< string >::iterator itt = (*it).begin(); itt!=(*it).end(); ++itt )
{
banksVec.push_back( (*itt) );
}
Expand Down Expand Up @@ -703,14 +703,14 @@ namespace Crystal
//------------------- For each Group set up Function, --------------------------
//---------------Ties, and Constraint Properties for Fit algorithm--------------------

for( vector<vector< string > >::iterator itv = Groups.begin(); itv !=Groups.end(); itv++)
for( vector<vector< string > >::iterator itv = Groups.begin(); itv !=Groups.end(); ++itv)
{
i++;
string BankNameString = "";
boost::shared_ptr<const RectangularDetector> bank_rect;

//---------------- Set up list of bank names argument -----------------
for( vector< string >::iterator it1 = (*itv).begin(); it1 !=(*itv).end(); it1++)
for( vector< string >::iterator it1 = (*itv).begin(); it1 !=(*itv).end(); ++it1)
{

boost::shared_ptr<const IComponent> bank_cmp = instrument->getComponentByName((*it1));
Expand Down Expand Up @@ -1041,12 +1041,12 @@ namespace Crystal


i = -1;
for( vector<vector< string > >::iterator itv = Groups.begin(); itv != Groups.end(); itv++ )
for( vector<vector< string > >::iterator itv = Groups.begin(); itv != Groups.end(); ++itv )
{
i++;
string BankNameString = "";
boost::shared_ptr<const RectangularDetector> bank_rect;
for( vector< string >::iterator it1 = (*itv).begin(); it1 !=(*itv).end(); it1++ )
for( vector< string >::iterator it1 = (*itv).begin(); it1 !=(*itv).end(); ++it1 )
{

string bankName = (*it1);
Expand Down
5 changes: 3 additions & 2 deletions Code/Mantid/Framework/Kernel/src/CompositeValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ namespace Mantid
// empty or single set of allowed values
if(n_combinations<2)return elem_unique;
// there is more then one combination and we have to identify its union;
for(std::set<std::string>::const_iterator its=elem_unique.begin();its!=elem_unique.end();its++)
for(std::set<std::string>::const_iterator its=elem_unique.begin();its!=elem_unique.end();++its)
{
std::multiset<std::string>::iterator im = elem_all.find(*its);
elem_all.erase(im);
}
std::set<std::string> rez;
for(std::multiset<std::string>::const_iterator im=elem_all.begin();im!=elem_all.end();im++){
for(std::multiset<std::string>::const_iterator im=elem_all.begin();im!=elem_all.end();++im)
{
rez.insert(*im);
}
return rez;
Expand Down

0 comments on commit af5ea72

Please sign in to comment.