Skip to content

Commit

Permalink
Refs #8962 Fixing cppcheck and gcc warnings
Browse files Browse the repository at this point in the history
this should fix the cppcheck and gcc compiler warnings caused by my work on this ticket
  • Loading branch information
keithnbrown committed Apr 14, 2014
1 parent b407634 commit 94d9fb7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/LoadReflTBL.cpp
Expand Up @@ -246,7 +246,6 @@ namespace Mantid
size_t LoadReflTBL::getCells(std::string line, std::vector<std::string> & cols) const
{
//first check the number of commas in the line.
size_t pos = 0;
size_t found = countCommas(line);
if (found == m_expectedCommas)
{
Expand All @@ -263,7 +262,6 @@ namespace Mantid
{
//More than 16 will need further checks as more is only ok when pairs of quotes surround a comma, meaning it isn't a delimiter
std::vector<std::vector<size_t>> quoteBounds;
size_t quotepairs = findQuotePairs(line, quoteBounds);
//if we didn't find any quotes, then there are too many commas and we definitely have too many delimiters
if (quoteBounds.size() == 0)
{
Expand Down
12 changes: 6 additions & 6 deletions Code/Mantid/Framework/DataHandling/src/SaveReflTBL.cpp
Expand Up @@ -46,7 +46,7 @@ namespace Mantid
using namespace API;

/// Empty constructor
SaveReflTBL::SaveReflTBL() : m_stichgroups(), m_nogroup(), m_sep(',')
SaveReflTBL::SaveReflTBL() : m_sep(','), m_stichgroups(), m_nogroup()
{
}

Expand Down Expand Up @@ -112,11 +112,11 @@ namespace Mantid
}

typedef std::map<int, std::vector<size_t>>::iterator map_it_type;
for(map_it_type iterator = m_stichgroups.begin(); iterator != m_stichgroups.end(); iterator++)
for(map_it_type iterator = m_stichgroups.begin(); iterator != m_stichgroups.end(); ++iterator)
{
std::vector<size_t> & rowNos = iterator->second;
int i = 0;
for (i; i < rowNos.size(); ++i)
size_t i = 0;
for (; i < rowNos.size(); ++i)
{
//for each row in the group print the first 5 columns to file
TableRow row = ws->getRow(rowNos[i]);
Expand All @@ -126,7 +126,7 @@ namespace Mantid
}
}
//if i comes out of that loop as less than 3, then we need to add the blank runs
for (i; i < 3; ++i)
for (; i < 3; ++i)
{
for (int j = 0; j < 5; ++j)
{
Expand All @@ -142,7 +142,7 @@ namespace Mantid
//now do the same for the ungrouped

typedef std::vector<size_t>::iterator vec_it_type;
for(vec_it_type iterator = m_nogroup.begin(); iterator != m_nogroup.end(); iterator++)
for(vec_it_type iterator = m_nogroup.begin(); iterator != m_nogroup.end(); ++iterator)
{
TableRow row = ws->getRow(*iterator);
for (int j = 0; j < 5; ++j)
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/DataHandling/test/SaveReflTBLTest.h
Expand Up @@ -204,7 +204,7 @@ class SaveReflTBLTest : public CxxTest::TestSuite
TS_ASSERT_THROWS_NOTHING(Poco::File(m_abspath).remove());
}

ITableWorkspace_sptr CreateWorkspace(bool colFail = false)
ITableWorkspace_sptr CreateWorkspace()
{
ITableWorkspace_sptr ws = WorkspaceFactory::Instance().createTable();
AnalysisDataService::Instance().addOrReplace(m_name, ws);
Expand Down

0 comments on commit 94d9fb7

Please sign in to comment.