Skip to content

Commit

Permalink
Fix cppcheck warnings.
Browse files Browse the repository at this point in the history
Refs #10061
  • Loading branch information
martyngigg committed Sep 1, 2014
1 parent 21b7ea3 commit 069c533
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Code/Mantid/Framework/DataHandling/src/LoadFITS.cpp
Expand Up @@ -244,7 +244,7 @@ namespace DataHandling
loadInst->setProperty<MatrixWorkspace_sptr>("Workspace", retVal);
loadInst->execute();
}
catch (std::exception ex)
catch (std::exception & ex)
{
g_log.information("Cannot load the instrument definition. " + string(ex.what()) );
}
Expand Down Expand Up @@ -336,18 +336,15 @@ namespace DataHandling
buffer16 = static_cast<uint16_t*>(bufferAny);
buffer32 = static_cast<uint32_t*>(bufferAny);

FILE *currFile = NULL;
size_t result = 0;
double val = 0;
bool fileErr;

for(size_t i=binChunkStartIndex; i < binChunkStartIndex+binsThisChunk ; ++i)
{
// Read Data
fileErr = false;
currFile = fopen ( m_allHeaderInfo[i].filePath.c_str(), "rb" );
bool fileErr = false;
FILE * currFile = fopen ( m_allHeaderInfo[i].filePath.c_str(), "rb" );
if (currFile==NULL) fileErr = true;


size_t result = 0;
if(!fileErr)
{
fseek (currFile , FIXED_HEADER_SIZE , SEEK_CUR);
Expand All @@ -363,6 +360,7 @@ namespace DataHandling

for(size_t j=0; j<spectraCount;++j)
{
double val = 0;
if(bitsPerPixel == 8) val = static_cast<double>(buffer8[j]);
if(bitsPerPixel == 16) val = static_cast<double>(buffer16[j]);
if(bitsPerPixel == 32) val = static_cast<double>(buffer32[j]);
Expand Down

0 comments on commit 069c533

Please sign in to comment.