Skip to content

Commit

Permalink
fix coverity 1075398,1076096,1076114 (init,int32/64,return), re #11328
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeMPouzols committed Mar 12, 2015
1 parent 816b1f7 commit 1456d58
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Code/Mantid/Framework/DataHandling/src/LoadRawHelper.cpp
Expand Up @@ -38,9 +38,11 @@ using namespace API;

/// Constructor
LoadRawHelper::LoadRawHelper()
: isisRaw(new ISISRAW2), m_list(false), m_spec_list(), m_spec_min(0),
m_spec_max(EMPTY_INT()), m_numberOfPeriods(0), m_specTimeRegimes(),
m_prog(0), m_bmspeclist(false) {}
: isisRaw(new ISISRAW2), m_list(false), m_interval(false), m_spec_list(),
m_spec_min(0), m_spec_max(EMPTY_INT()), m_numberOfPeriods(0), m_cache_options(),
m_specTimeRegimes(), m_prog(0.0), m_numberOfSpectra(0), m_monitordetectorList(),
m_bmspeclist(false), m_total_specs(0), m_logCreator() {
}

LoadRawHelper::~LoadRawHelper() {}

Expand Down Expand Up @@ -1078,17 +1080,21 @@ void LoadRawHelper::loadSpectra(
int64_t noTimeRegimes = getNumberofTimeRegimes();
int64_t lengthIn = static_cast<int64_t>(isisRaw->t_ntc1 + 1);

const int64_t periodTimesNSpectraP1 = period *
(static_cast<int64_t>(m_numberOfSpectra) + 1);
// loop through spectra
for (specid_t i = 1; i <= m_numberOfSpectra; ++i) {
int64_t histToRead = i + period * (m_numberOfSpectra + 1);
int64_t histToRead = i + periodTimesNSpectraP1;
if ((i >= m_spec_min && i < m_spec_max) ||
(m_list &&
find(m_spec_list.begin(), m_spec_list.end(), i) !=
m_spec_list.end())) {
progress(m_prog, "Reading raw file data...");

// read spectrum from raw file
readData(file, histToRead);
if (!readData(file, histToRead))
throw std::runtime_error("Error reading raw file, in "
"LoadRawHelper::loadSpectra, readData failed");
// set workspace data
setWorkspaceData(ws_sptr, timeChannelsVec, wsIndex, i, noTimeRegimes,
lengthIn, 1);
Expand Down

0 comments on commit 1456d58

Please sign in to comment.